Changing theme, need help with variant liquid code for new theme

Nittiyarns
Tourist
28 0 2

Hi Shopify team!

 

I'm trying to change theme to a new one, but the structure of the theme is very confusing. There is no product.liquid for example to make changes in to.

 

Here is a preview of the new theme - https://p5t2tmx1025xbwk0-53994815687.shopifypreview.com

And here is my current theme - https://www.nitti.co.nz/collections/scheepjes-cahlista/products/scheepjes-cahlista-watermelon

 

I have this code inside my current theme's product.liquid template:

  {% if current_variant.incoming %}
<span><p style="color:red"><b>**More Stock Expected Week Of {{ current_variant.next_incoming_date | date: "%b %d, 20%y"}}**</p></span></td><br>
{% else %}
  {% if product.tags contains 'Preorder'%}
        <p style="color:red"><b><i>*This product is a preorder and will ship in 3-4 weeks - payment due at time of order*</i></b></p>
{% endif %}
{% endif %}

	{% for tag in product.tags %}

  {% if tag contains 'Preorder' %}

    {% assign has_preorder = true %}

  {% endif %}

{% endfor %}

{% unless has_preorder == true %}

  {%- if settings.quantity_msg -%}

    {%- assign enableqtyMsg = true -%}

    {%- if current_variant.inventory_management == "shopify" and current_variant.inventory_quantity < settings.max_quantity and current_variant.inventory_quantity != 0 -%}

      {%- assign enableqtyMsg = flase -%}

    {%- endif -%}

    {% assign qtyMsg = 'products.product.quantity_message' | t | split: '{{items}}' %}

    <div id="quantity_message" data-qty="{{settings.max_quantity}}"{%- if enableqtyMsg -%}style="display:none;"{%- endif -%}>{{qtyMsg[0]}} <span class="items">{{product.selected_or_first_available_variant.inventory_quantity}}</span> {{qtyMsg[1]}}</div>

    {% for variant in product.variants %}<span class="hide" id="pvr-{{ variant.id }}">{{variant.inventory_quantity}}</span>{% endfor %}
  {%- endif -%}
{% endunless %}

 

I'm wanting to achieve the same functionality on the new theme - stock quantity for products and individual product variants. Incoming stock date as well as the preorder message too.

 

Is anyone able to help? I've driven myself nuts trying to figure it out today!

 

Thank you!

Replies 0 (0)