Update Product Price

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?

Hello,

If you want to change price for a products varients check this out: https://support.wix.com/en/article/setting-different-prices-for-product-option-choices-in-wix-stores

Otherwise you’ll have to either change it from the actual product - here, or create your own custom product page (dynamic page linked to the products collection)

Best,
Majd