Hello
I have done some reading in these forums but cant answer my issue I am experiencing. Our product pages have stopped working properly. When a variant size or price or size/price is selected the image no longer shows nor does the price change.
We are using the mile high theme.
Here is my product.liquid code - any help would be appreciated as I do not know how to fix this.
{% render 'preorder-now-collection-item', product: product %}
{% section "product"%}
{% section 'product-recommendations' %}
{% comment %}
{% assign current_variant = product.selected_or_first_available_variant %}
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": {{ product.title | json }},
"url": {{ shop.url | append: product.url | json }},
{%- if product.featured_media -%}
{%- assign media_size = product.featured_media.preview_image.width | append: 'x' -%}
"image": [
{{ product.featured_media | img_url: media_size | prepend: "https:" | json }}
],
{%- endif -%}
"description": {{ product.description | strip_html | json }},
{%- if current_variant.sku != blank -%}
"sku": {{ current_variant.sku | json }},
{%- endif -%}
"brand": {
"@type": "Thing",
"name": {{ product.vendor | json }}
},
"offers": [
{%- for variant in product.variants -%}
{
"@type" : "Offer",
{%- if variant.sku != blank -%}
"sku": {{ variant.sku | json }},
{%- endif -%}
"availability" : "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
"price" : {{ variant.price | divided_by: 100.00 | json }},
"priceCurrency" : {{ cart.currency.iso_code | json }},
"url" : {{ shop.url | append: variant.url | json }}
}{% unless forloop.last %},{% endunless %}
{%- endfor -%}
]
}
</script>
{% endcomment %}
<script text="text/javascript">
var _learnq = _learnq || [];
var item = {
Name: {{ product.title|json }},
ProductID: {{ product.id|json }},
Categories: {{ product.collections|map:'title'|json }},
ImageURL: "https:{{ product.featured_image.src|img_url:'grande' }}",
URL: "{{ shop.secure_url }}{{ product.url }}",
Brand: {{ product.vendor|json }},
Price: {{ product.price|money|json }},
CompareAtPrice: {{ product.compare_at_price_max|money|json }}
};
_learnq.push(['track', 'Viewed Product', item]);
_learnq.push(['trackViewedItem', {
Title: item.Name,
ItemId: item.ProductID,
Categories: item.Categories,
ImageUrl: item.ImageURL,
Url: item.URL,
Metadata: {
Brand: item.Brand,
Price: item.Price,
CompareAtPrice: item.CompareAtPrice
}
}]);
</script>
<script type="text/javascript">
var _learnq = _learnq || [];
document.getElementById("addToCart").addEventListener('click',function (){
_learnq.push(['track', 'Added to Cart', item]);
});
</script>
<div id="looxReviews" data-product-id="{{product.id}}" class="loox-reviews-default">{{ product.metafields.loox.reviews }}</div>
{% comment %} HelpfulCrowd injected code. Please do not change or remove this and the next comment {% endcomment %}
{% comment %}{% render 'hc-product-tabs', product: product %}{% endcomment %}
{% comment %} HelpfulCrowd injected code. Please do not change or remove this and the previous comment {% endcomment %}
<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="{{product.title}}" />
<meta itemprop="description" content="{{product.description | strip_html | truncatewords: 50}}" />
<meta itemprop="sku" content="{{ product.selected_or_first_available_variant.sku }}" />
<meta itemprop="url" content="{{ shop.secure_url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
<meta itemprop="brand" content="{{ product.vendor }}" />
<meta itemprop="mpn" content="{{ product.selected_or_first_available_variant.sku }}" />
{% if product.metafields.loox.num_reviews %}
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<meta itemprop="bestRating" content="5">
<meta itemprop="worstRating" content="1"/>
<meta itemprop="ratingValue" content="{{ product.metafields.loox.avg_rating }}"/>
<meta itemprop="reviewCount" content="{{ product.metafields.loox.num_reviews }}"/>
</div>
<div itemprop="review" itemscope itemtype="http://schema.org/Review" content = "{{ product.metafields.loox.avg_rating }}">
<span itemprop="name" content="Good Product"></span>
<span itemprop="author" content="{{ shop.name }}"></span>
<meta itemprop="datePublished" content="">
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<meta itemprop="worstRating" content = "0">
<span itemprop="ratingValue" content = "{{ product.metafields.loox.num_reviews }}"></span>
<span itemprop="bestRating" content = "{{ product.metafields.loox.num_reviews }}"></span>
</div>
</div>
{% endif %}
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="{{ shop.currency }}" />
<meta itemprop="price" content="{{product.selected_or_first_available_variant.price|money_without_currency | remove: ','}}" />
<meta itemprop="priceValidUntil" content="{{ "today" | date: '%s' | plus: days | date: "%Y-%m-%d" }}">
<meta itemprop="availability" content="http://schema.org/{% if product.selected_or_first_available_variant.available %}InStock{% else %}OutOfStock{% endif %}"/>
<meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition"/>
<meta itemprop="seller" content="{{ shop.name | escape }}" />
<meta itemprop="url" content="{{ shop.secure_url }}{{ product.selected_or_first_available_variant.url }}">
</div>
</div>
User | Count |
---|---|
23 | |
19 | |
18 | |
17 | |
16 |