Personalized checkout and custom promotions with Shopify Scripts
i use this code to update price , 1st variant price is working fine but the 2nd variant price isnt updating . It's getting update price from 1st variant . here's the website , kindly check and help me ASAP
https://www.revomadic.com/products/smart-cupping-massager-gp?variant=41744379248816
<script>
function change(value){
document.getElementById("count").value= 1*value;
// CODE FOR PRICE
var realPrice = window.localStorage.getItem('realPrice');
var comparePrice = window.localStorage.getItem('comparePrice');
var savePrice = window.localStorage.getItem('savePrice');
var currency = window.localStorage.getItem('currency');
document.querySelector("#ProductPrice .money").innerHTML= currency +(parseInt(realPrice)* parseInt(document.getElementById("count").value)).toLocaleString() + '.00';
document.querySelector("#ComparePrice .money").innerHTML= currency +(parseInt(comparePrice)* parseInt(document.getElementById("count").value)).toLocaleString() + '.00';
var elList = document.querySelectorAll(".number-discount_saved .money");
elList.forEach(el => el.innerHTML= currency +(parseInt(savePrice)* parseInt(document.getElementById("count").value)).toLocaleString() + '.00');
// END PRICE CODE
</script>
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024