Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi All,
Im trying to add certain fields to the product page like SKU.
i have managed to add the fields to the page but they do not update upon selecting the variants.
i cant find the callback functions in the theme code of broadcast - the thing that makes the price and images update as you select a variant.
Can someone guide me on this please?
Hello @Davethebrave ,
You can try to follow these steps:
// Example code to update the SKU field
function updateSku(variant) {
var skuElement = $('.product-sku'); // Replace with the selector for your SKU element
skuElement.text(variant.sku);
}
// Example callback function that gets triggered on variant change
function onVariantChange(variant) {
// Call your existing code that updates the price and images here
// Update the SKU field
updateSku(variant);
}
Hope this can help.
Ali Reviews team.
Hi ALi,
thanks for that - but i cant find any of those terms in the files of BROADCAST
see picture attached - relevant?
Its too late but here is the call back function for broadcast theme that handles the product information update on variant change event.