Show or hide Supertime based on products or product information in your cart

Supertime can be configured to be shown or hidden based on product information in the cart by adding some custom theme integration code for interacting with our manual detection mode.

We have provided example use cases with relevant snippets for your cart below -- these are advanced tutorials where you may need help from a Shopify Partner that specializes in custom theme development. Before you review the steps below, please first read more on how Supertime interacts with your cart by reviewing this article.

Use Case: Show Supertime for only certain products with a desired Product Tag

Add this Snippet for identifying when to show Supertime using Product Tags wherever you have your cart templates (e.g. in Debut, it's the  sections -> cart-template.liquid file):

{% assign show_supertime = false %}

{% for item in cart.items %}
  {% for tag in item.product.tags %}
    {% if tag contains "Local Delivery" %}
      {% assign show_supertime = true %}
    {% endif %}
  {% endfor %}
{% endfor %}

{% unless show_supertime %}
<script> SupertimeManualMode = { formSelector: "", refreshSelector: "", buttonSelector: "" };</script>
{% endunless %}

Once completed, Supertime will render when certain products with certain products tags (e.g. if you set a "Local Delivery" tag in your product") are present in your cart. Review the additional use cases below to see alternative snippets for different situations with showing or hiding Supertime.

Additional Use Cases: 

Hide Supertime only when certain products are in your cart using a Product Title

Here's a snippet for identifying when to show Supertime using a Product Item name for creating your show_supertime flag. See above for steps updating your cart's checkout buttons to support this workflow. (e.g. use this snippet for step 1, and then continue through the rest of the provide steps above)

{% assign show_supertime = true %}

{% for item in cart.items %}
    {% if item.product.title contains "Same Day" %}
      {% assign show_supertime = false %}
    {% endif %}
{% endfor %}

{% unless show_supertime %}
<script> SupertimeManualMode = { formSelector: "", refreshSelector: "", buttonSelector: "" };</script>
{% endunless %}

Show Supertime unless you only have certain products in your cart using Product Title

Snippet for identifying when to show Supertime using a Product Item name for creating your show_supertime flag. See above for steps for updating your cart's checkout buttons to support this workflow. (e.g. use this snippet for step 1, and then continue through the rest of the provide steps above)

{% assign show_supertime = false %}

{% for item in cart.items %}
    {% unless item.product.title contains "Gift Card" %}
      {% assign show_supertime = true %}
    {% endunless %}
{% endfor %}

{% unless show_supertime %}
<script> SupertimeManualMode = { formSelector: "", refreshSelector: "", buttonSelector: "" };</script>
{% endunless %}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.