Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
https://holibdaycelebration.com/collections/krakk-korn/products/pre-sale-krakkle-korn
It's the strangest thing. My prices change with the products that I created thru third party apps , but the inventory that I manually entered (quantity, size, prize, inventory count, sku) does not change with the variant.
I set variant sizes with different variant prices-confirmed in Product and Inventory that the prices are different w/each variant, but it only displays the price of the first variant option which is the cheapest price.
Notes:
View of product-template.liquid attached
View of product-price.liquid file below:
<!-- snippet/product-price.liquid -->
{% if product.title %}
{%- assign compare_at_price = product.compare_at_price -%}
{%- assign price = product.price -%}
{%- assign price_varies = product.price_varies -%}
{%- assign available = product.available -%}
{% else %}
{%- assign compare_at_price = 1999 -%}
{%- assign price = 1999 -%}
{%- assign price_varies = false -%}
{%- assign available = true -%}
{% endif %}
{%- assign money_price = price | money -%}
{% if compare_at_price > price %}
<span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
<s class="product-price__price">{{ compare_at_price | money }}</s>
<span class="product-price__price product-price__sale">
{{ money_price }}
</span>
{% if settings.show_saved_amount and settings.show_discount_amount == 'money_save' %}
<span class="salePrice sale-tag large">
{% assign sale = product.compare_at_price | minus: product.price | money %}
{{ 'products.product.on_save_like_price' | t }} {{sale}}
</span>
{% endif %}
{% else %}
<span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
<span class="product-price__price">{{ money_price }}</span>
{% endif %}
Solved! Go to the solution
This is an accepted solution.
Looks like other products are either single-variant products or each variant has image assigned.
The page you've shared fails because variants have no image assigned.
There are 2 options:
1) assign image to each variant
2) fix the theme code.
In your assets/theme.js there is this commented code (starting @ line 642):
// if (
// !variant.featured_image ||
// variantImage.src=== currentVariantImage.src
// ) {
// return;
// }
This was a check whether newly selected variant has no image assigned or new image is the same as the old one and skip product image update if this is the case.
My recommendation is to uncomment this code (by removing // at the start of each line) unless you know a good reason why this was done.
This is an accepted solution.
Looks like other products are either single-variant products or each variant has image assigned.
The page you've shared fails because variants have no image assigned.
There are 2 options:
1) assign image to each variant
2) fix the theme code.
In your assets/theme.js there is this commented code (starting @ line 642):
// if (
// !variant.featured_image ||
// variantImage.src=== currentVariantImage.src
// ) {
// return;
// }
This was a check whether newly selected variant has no image assigned or new image is the same as the old one and skip product image update if this is the case.
My recommendation is to uncomment this code (by removing // at the start of each line) unless you know a good reason why this was done.
thank you so very much! Adding pics worked perfectly.
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024