Highlight SKU of selected variant on product page

Evan_Burford1
New Member
3 0 0

I'm trying to highlight the SKU of the selected variant on the product page of this store:

https://tan-teck-seng-electric-co.myshopify.com/products/beam-clamp?variant=12459139792969

I want the red highlight on the SKU to change according to the variant selected. Currently the highlight only changes after refreshing the page. I suspect a bit of Javascript is needed in the selectCallback section. 

Please let me know if you know the code required to make this work. Thank you!

Replies 2 (2)
Derek_soohoo
New Member
1 0 0

How did you get yours to work? I'm having the same issue.

PaulNewton
Shopify Partner
3491 234 679

@Derek_soohoo 

You'd have to add the data of the sku to the variant selector , or in the list of skus each has the variant-id attached to it.

Then either modify the existing option selection javascript or make some custom javascript that listens for the the selectors being changed.

 

Merchants that want this customization can contact me at paull.newton+shopifyforums@gmail.com with this topic, store and theme name.

What important thing did you learn this Black Friday?


Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org

Problem Solved? ✔Accept and Like solutions to help future merchants

Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com