skip to Main Content
{% if product.type  == 'Patio Furniture/Salsa Table' %}

<div id="dotted" style="height: auto;border-bottom:0px;text-align: center;" class="grid-uniform wrapper">
  <div class="grid__item large--one-whole">
<img alt="woman wearing colorful apron while working with bread doe in the kitchen" src="https://cdn.shopify.com/s/files/1/1418/7648/files/BERLIN_Maud_Chalard_pour_Fermob_9.jpg?1296570615214079092">
    </div>
</div>

{% endif %}

I need to target two specialized templates called product.no-variant and product.jacquard-tablecloths.

This part should go here {% if product.type == 'Patio Furniture/Salsa Table' %}

I’m pretty sure product.type is just the wrong suffix to use, I need the right one.

3

Answers


  1. 1)Are you sure this is actually the product type? You might try printing the product type to be sure.

    {{ product.type }}

    2) Can you use “contains” on the product description instead?

    {% if products.type contains 'Patio Furniture' OR products.type contains 'Salsa Table' %}

    3) Here are all the product fields – would tags be a better choice?

    4) Remember you may have to downcase for certain field comparisons.

    Login or Signup to reply.
  2. I believe you are looking for product.template_suffix

    https://help.shopify.com/themes/liquid/objects/product#product-template_suffix

    Shopify has a cheat sheet here that might help you out.

    https://www.shopify.ca/partners/shopify-cheat-sheet

    Login or Signup to reply.
  3. What you’re looking for is

    {% if template contains 'jacquard-tablecloths' %}
      // Your code here
    {% endif %}
    

    Note: {{ product.template_suffix }} is only useful if you’re just looking to print the name of the current template, which in your case would display “jacquard-tablecloths”.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search