Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/tech 586 plp countdown timer #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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.

1 participant