Issue updating correct information for product variants on product page ... My brain hurts! HELP!

New Member
12 0 0

Hey everyone! I have a bit of a head scratcher here!

 

For context:

I am using a theme called Impulse

I am using this line of code to display the SKU and barcode on my product page:

 

{% assign current_variant = product.selected_or_first_available_variant %}
{% if current_variant.sku != "" %}
<p> <span style="font-size: 11px">SKU: {{ current_variant.sku }} | UPC: {{ current_variant.barcode }} </span></p>
{% endif %}

 

It functions properly for regular (non-variant) products. But when a product has variants it will show the SKU and UPC from the first variant only. I'm hoping someone can help guide me in making the SKU/Barcode update as a new variant is selected.

 

I have a second issue that is quite concerning to me. I have noticed that as I change variants the price updates correctly, however when I select a different variant and then I go back and select the 1st variant, it doesn't revert the price. The price stays as the last variant I had selected!

 

I've had both of these things working correctly on other sites. I'm fearing maybe I changed something in JS that I shouldn't have?

 

Any help, advice, direction, or information of any sort would be greatly greatly greatly appreciated!

 

Thanks,

 

Dylan

0 Likes