Is there a way to automatically time banners for sales?

Hey guys,

I was wondering if it’s possible to make certain banners time to either on /off we have certain sales that end in the evening but right now we have to manually login and change the banner so the right one is shown. is there a way to make a banner automaticly disapear?

Thanks in advance,

Tim

Hi @Tim011 This will need the code editing. plz explain where you want to show the banner and what is currently show.

1 Like

this banner is a slideshow in shopify. Sorry i forgot to mention that but on our slideshow we display our current sales so we want this feature to be a setting in the slide show. The top one on our site : https://ruitershoppasdedeux.nl . So it currently shows our slides that we put into the slideshow and we want to keep it that way but then alo have a feature where we can hide on of the slides if the sale ends.

are you talking about this banner? Do you want to hide a single slide or the whole banner?

A single slide.

if you can find it, plz send me the code of the slider section so I can update it, to add a time limit on the slide.

I am sorry what do you mean by the slider section?

not the sider but slider section, you can find it in the theme code editor > sections folder, there will be a file name something including “slider”. if it is not there, plz just copy the index.liquid or main page.liquid file code, and paste it into a text file attach with your reply

1 Like
{%- capture section_settings -%}
{
  "autoPlay": {{ section.settings.autoplay | json }},
  "prevNextButtons": false,
  "pageDots": {% if section.blocks.size > 1 %}true{% else %}false{% endif %},
  "setGallerySize": {% if section.settings.section_size == 'preserve_ratio' %}true{% else %}false{% endif %},
  "adaptiveHeight": {% if section.settings.section_size == 'preserve_ratio' %}true{% else %}false{% endif %},
  "transitionEffect": {{ section.settings.carousel_effect | json }},
  "cycleSpeed": {{ section.settings.cycle_speed | times: 1000 | json }}
}
{%- endcapture -%}

{% schema %}
{
  "name": "Slideshow",
  "max_blocks": 6,
  "settings": [
    {
      "type": "checkbox",
      "id": "edge_to_edge",
      "label": "Full-width",
      "default": false
    },
    {
      "type": "select",
      "id": "section_size",
      "label": "Image size",
      "options": [
        {
          "value": "preserve_ratio",
          "label": "Original image ratio"
        },
        {
          "value": "small",
          "label": "Small"
        },
        {
          "value": "medium",
          "label": "Medium"
        },
        {
          "value": "large",
          "label": "Large"
        }
      ],
      "default": "preserve_ratio"
    },
    {
      "type": "select",
      "id": "carousel_effect",
      "label": "Transition effect",
      "options": [
        {
          "value": "fade",
          "label": "Fade"
        },
        {
          "value": "slide",
          "label": "Slide"
        }
      ],
      "default": "slide"
    },
    {
      "type": "checkbox",
      "id": "autoplay",
      "label": "Auto rotate between slides",
      "default": true
    },
    {
      "type": "range",
      "id": "cycle_speed",
      "min": 3,
      "max": 8,
      "step": 1,
      "unit": "sec",
      "label": "Change slides every",
      "default": 5
    }
  ],
  "blocks": [
    {
      "type": "image",
      "name": "Slide",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "Image",
          "info": "2160 x 720px .jpg recommended"
        },
        {
          "type": "image_picker",
          "id": "mobile_image",
          "label": "Mobile image",
          "info": "750 x 1100px .jpg recommended. If none is set, desktop image will be used."
        },
        {
          "type": "checkbox",
          "id": "show_overlay",
          "label": "Show overlay",
          "info": "Increase text readability on busy images.",
          "default": false
        },
        {
          "type": "range",
          "id": "overlay_opacity",
          "label": "Overlay opacity",
          "min": 0,
          "max": 100,
          "step": 1,
          "unit": "%",
          "default": 30
        },
        {
          "type": "color",
          "id": "text_color",
          "label": "Text",
          "default": "#ffffff"
        },
        {
          "type": "text",
          "id": "title",
          "label": "Heading",
          "default": "Slide title"
        },
        {
          "type": "textarea",
          "id": "content",
          "label": "Content",
          "default": "Tell your story"
        },
        {
          "type": "select",
          "id": "content_position",
          "label": "Content position",
          "info": "On mobile, content is always centered.",
          "options": [
            {
              "value": "top_left",
              "label": "Top left"
            },
            {
              "value": "top_center",
              "label": "Top center"
            },
            {
              "value": "top_right",
              "label": "Top right"
            },
            {
              "value": "middle_left",
              "label": "Middle left"
            },
            {
              "value": "middle_center",
              "label": "Middle center"
            },
            {
              "value": "middle_right",
              "label": "Middle right"
            },
            {
              "value": "bottom_left",
              "label": "Bottom left"
            },
            {
              "value": "bottom_center",
              "label": "Bottom center"
            },
            {
              "value": "bottom_right",
              "label": "Bottom right"
            }
          ],
          "default": "middle_center"
        },
        {
          "type": "header",
          "content": "Button"
        },
        {
          "type": "color",
          "id": "button_background",
          "label": "Background",
          "default": "#ffffff"
        },
        {
          "type": "color",
          "id": "button_text_color",
          "label": "Text",
          "default": "#000000"
        },
        {
          "type": "text",
          "id": "button_text",
          "label": "Text",
          "default": "Button"
        },
        {
          "type": "url",
          "id": "link",
          "label": "Link",
          "info": "If no text is set for button, the whole image becomes clickable."
        }
      ]
    }
  ],
  "presets": [
    {
      "category": "Image",
      "name": "Slideshow",
      "blocks": [
        {
          "type": "image"
        },
        {
          "type": "image"
        }
      ]
    }
  ]
}
{% endschema %}

No file with slider in it there is a slideshow.liquid file could that be of any use if not i found the main page.liquid

let me know if you want the slideshow.liquid

mainpage.liquid:


{% schema %}
{
  "name": "Page"
}
{% endschema %}

plz share the slideshow.liquid file

here you go:

What time on the client side do you want to show/hide the banner slide.

well im not sure to be honest But we wanna be ablo to do that ourself that we have a little field theme settings> slideshow>slide and here select wenn it shut be hidden.

I might be able to manage adding that field and link it to code myself or maybe the theme makers could help me.

the field then shut be here:

yes, I will just add an option to implement a time limit on the individual slide, It will have two sliders for 1 to 24 limits each, the first one for the starting time to hide and the second one for the end time,

just like when if you want to hide it from evening to midnight you can select 18 from the first slider and 24 from the second.

Does this make sense?

Ahh yes i understand what it needs to do is hide it then after the 24 in your example and not become avaible again. The discounts we offer are temporary so it won’t come back. on the day after it just has to be hidden and then done with. and kept hidden till delted or shown again if we choose to make it visable again.

Is it possible to make an option hide on date: then a field when you want to hide it? still on the individual slides.

yes, it is possible.

But I have a problem here I am unable to edit that code on my Shopify partner test store. the code will be needed to change in your store.

I think your store theme is paid so that is why it is happening.

I can test it out no problem if you send me it ill drop the code in a test version?