I’m trying to update a Product Price using code.
My page is:
https://fedorjoseph.wixsite.com/mysite/product-page/i-m-a-product-27
I’m using a function that’s called when the Product Page is ready. This is it:
$w.onReady(function () {
console.log(“on Ready function”);
$w(‘#productPage1’).getProduct()
.then((product) => {
product.price = 1000;
console.log("New price is: ");
console.log(product.price)
})
.catch((error) => {
console.log(error);
});
});
In the log the price is the new amount; but the price doesn’t change on the web page. I think I need to find a way to return the object back; but I can’t find a setProduct() function.
How do I update the product price so it displays on the page?