Skip to content

Conversation

@88joonyc
Copy link

This pull request allows multiple countdown clocks to render on the product list page.

In order for this to work, an identifier prop is used in the countdown component that dynamically sets the ID for each countdown. For this example case, the identifier is set to product.title. see below:

{%- for block in section.blocks -%}
    {%- case block.type -%}
      {%- when 'countdown' -%}
        {% liquid
          if product.metafields.global.countdown
            render 'countdown-trellis', 
            data: block.settings, 
            date: product.metafields.global.countdown, 
            identifier: product.title
            type: 'block'
          endif
        %}
    {%- endcase -%}
  {%- endfor -%}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants