Display SKU on Product Page - Narrative Theme

Highlighted
Tourist
5 1 1

I'm struggling to find the solution to this for the Narrative theme.

I want to show the variant SKU on the product page, but my issue is that the SKU doesn't change when you select another variant. It only shows the SKU of the first loaded variant.

I tried to follow this tutorial by Shopify, but I can't find the line of code that needs editing for the Javascript portion.

 

0 Likes
Highlighted
Shopify Expert
420 43 47

Hello There, 

 

Kindly add the following code to the product-template.liquid section, just below the product title.

{%- assign current_variant = product.selected_or_first_available_variant -%}
<span>{{ current_variant.sku }}</span>

https://shopify.dev/tutorials/customize-theme-show-sku-numbers#show-sku-numbers-on-product-pages-sec...

Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing
0 Likes
Highlighted
Tourist
5 1 1

Hi Pallavi,

I already tried that. I mentioned that I followed the tutorial that you linked in my original post.

Although it shows the SKU, it doesn't change depending on the variant selected.

Thanks though.

0 Likes
Highlighted
New Member
6 0 0

Pallavi, Can you please answer the question. Thanks.

0 Likes