Hi Liam!
Nope i’m not using the same section for both templates. I’ll re-explain;
I have a snippet that shows the order time and delivery date.
product-detail-order-shipping.liquid
{% if section.settings.order_shipping_time %}
-
- {{ 'products.product.order_within' | t }}
{% endif %}
Then I have the section product-template.liquid linked to the snippet product-template.lquid. Essentially this is what in the front end I see as the product page.
In the SECTION product-template.liquid I have the variables for the shipping info like this:
,
{
"type": "header",
"content": "Order and Shipping Time",
"info": "Working days"
},
{
"type": "checkbox",
"id": "order_shipping_time",
"label": "Enable Order and Shipping Time",
"default": true
},
{
"type": "range",
"id": "deadline_day",
"label": "Deadline each day",
"default": 14,
"min": 0,
"max": 23,
"step": 1,
"unit": "h"
},
{
"type": "range",
"id": "delivery_time",
"label": "Delivery time",
"default": 2,
"min": 1,
"max": 7,
"step": 1,
"unit": "d"
},
Then in my snippet product-template.liquid page (which is what in the front is the product page), there’s a combination of multiple snippets with info about the product - like this:
{% include 'product-detail-stock' %}
{% include 'product-detail-short-description' %}
{% include 'product-detail-size-chart' %}
{% include 'product-detail-wishlist-compare' %}
{% include 'product-detail-sku' %}
{% include 'product-detail-price' %}
{% include 'product-detail-deals' %}
And inside the snippet
product-detail-price.liquid I put the snippet to show the Shipping info, so the product-detail-order-shipping.liquid at the end of the file .
So this is my product-detail-price.liquid :
{% form 'product', product, class:'product-form product-action variants' %}
- {% if product.compare_at_price_max > product.price %}
{{ product.price | money }}
<del> {{ product.compare_at_price | money }}</del>
{% else %}
{{ product.price | money }}
{% endif %}
- {% include 'product-detail-qty' %}
- {% include 'product-detail-btn' %}
{% include 'product-detail-variants' %}
{% endform %}
{% include 'product-detail-order-shipping' %}
Up until here aLL GOOD. This makes my product page have the shipping information as I want.
What I want now is to add this shipping information into my collection pages.
To do this the collection pages is made up of different snippets. I identified that the snippet with the product details is the snippet product-item.liquid
So I tried adding to the snippet product-item.liquid the snippet product-detail-order-shipping.liquid . Like this:
{% include 'product-detail-order-shipping' %}
But it is not working because the snippet product-detail-order-shipping.liquid has an IF statement at the beginning that does not correspond to the section of product-item.liquid . The section linked to the snippet product-item.liquid has none of the variables:
section.settings.order_shipping_time
section.settings.delivery_time
section.settings.deadline_day
So basically what I think I need is to read form the snippet product-item.liquid some variables declared on the section product-template.liquid .
I tried to put the variables directly in in the product-item.liquid instead of adding product-detail-order-shipping.liquid , like this - but it is not working:
product-item.liquid
-
- {{ 'products.product.order_within' | t }}
I also tried like this but not working either
-
- {{ 'products.product.order_within' | t }}
Does this clarify my issue @Liam ?