I would love to help out but I’m not sure what you are trying to achieve, so if you could ellaborate a little more and maybe provide an example from another website it will be great.
If you mean to just show the SKU on the product page, you can add that block inside your theme’s customization, just edit the product template.
To make the SKU section dynamic—so it updates automatically when a customer selects a different variant—you’ll need to hook into Shopify’s variant change event using a bit of JavaScript.
Here’s a quick way to make your custom SKU section update without a page refresh:
Add an ID to your SKU container (you already did this – perfect!):
thankyou for your responds. normally when you have a sku on the product page with multiple variants the sku should switch dynamically when another variant is selected. this is not the case with my sku. so my question is how to make the sky dynamically change when another variant is selected
hi thankyou for your response. I tried and added the code to another block but still no result of the dynamic change. hoping you may have another solution
The idea is that you go to your themes, click “Customize”, the go to product page and add a block or a section “Liquid”, then paste my code in this block/section setting.
Otherwise, you can find your “sku” block and add my code right below.
At the moment, I do not see my code included on your product page(s).