Hey @Liam I have tried the if/else condition as specified by you, but it is not working as expected. I have created a different section just for giftcard with this condition in theme files, but the section use to display irrespective of the if/else condition i.e. even when I have deactivated all the giftcards from store the section is displaying on the homepage it doesn’t hide automatically? Can you please specify if I am doing something wrong here?
Here is the code of the section:
{% if shop.accepts_gift_cards == true %}
{%- liquid
assign has_background_color = false
if section.settings.background_color != blank and section.settings.background_color != 'rgba(0,0,0,0)'
assign has_background_color = true
endif
assign show_animations = false
if settings.enable_section_animations and section.settings.enable_animation
assign show_animations = true
endif
-%}
{%- capture image_sizes -%}
{%- if section.settings.show_small_image -%}
(min-width: 720px) calc(calc(50vw - clamp(18px, 3.3vw, 3.3vw)) * .93), calc((100vw - 80px) * .93)
{%- else -%}
(min-width: 720px) calc(calc(50vw - clamp(18px, 3.3vw, 3.3vw)), calc(100vw - 80px)
{%- endif -%}
{%- endcapture -%}
{%- capture section_classes -%}
section section--divider-{{ section.settings.divider_style }}
{{ section.settings.section_padding }}
{%- endcapture -%}
{%- if section.settings.show_small_image -%}
{%-
render 'image' with
wrapper_class: "image-with-text__small-image",
image: section.settings.image_small,
sizes: "(max-width: 720px) calc(90vw * .42), (max-width: 1500px) calc(50vw * .42), 300px",
aspect_ratio: section.settings.image_small_aspect_ratio,
focal_point: section.settings.image_small_focal_point,
include_placeholder: true,
animate: show_animations
-%}
{%- endif -%}
{%- for block in section.blocks -%}
{%- case block.type -%}
{%- when 'accent' -%}
{%- unless block.settings.accent == blank -%}
{{ block.settings.accent }}
{%- endunless -%}
{%- when 'heading' -%}
{%- unless block.settings.title == blank -%}
##
{{ block.settings.title }}
{%- endunless -%}
{%- when 'subheading' -%}
{%- unless block.settings.subheading == blank -%}
##
{{ block.settings.subheading }}
{%- endunless -%}
{%- when 'text' -%}
{%- unless block.settings.text == blank -%}
{{ block.settings.text }}
{%- endunless -%}
{%- when 'image' -%}
{%-
render 'image-block' with
shopify_attributes: block.shopify_attributes,
wrapper_class: 'image-with-text__text-container-image section-blocks__image section-blocks__image',
image: block.settings.image,
width: block.settings.image_size,
mobile_width: block.settings.image_size_mobile,
break_to_mobile_at: '720',
align: section.settings.text_alignment
-%}
{%- when 'button' -%}
{%-
render 'button-block' with
wrapper_class: "image-with-text__text-container-button section-blocks__button",
link: block.settings.link,
label: block.settings.link_text,
button_style: block.settings.button_style,
is_overlay: true,
button_alignment: section.settings.text_alignment,
buttons_can_inline: true,
forloop: forloop
-%}
{%- when 'play-button' -%}
{%-
render 'play-button-block' with
wrapper_class: 'image-with-text__text-container-play-button section-blocks__video-button',
shopify_attributes: block.shopify_attributes,
poster_image: block.settings.poster_image,
poster_aspect: block.settings.aspect_ratio,
video_url: block.settings.video_url,
label: block.settings.text,
button_alignment: section.settings.text_alignment,
icon_style: block.settings.icon_style
-%}
{%- when 'border' -%}
{%- render 'border-block' -%}
{%- when 'spacer' -%}
{%- render 'spacer-block' with space: block.settings.space -%}
{%- endcase -%}
{%- endfor -%}
{% endif %}