WooCommerce.NET
WooCommerce.NET copied to clipboard
How to update price for a product
- Wordpress version: 5.7.1
- WooCommerce version: 5.2.2
- WooCommerce.NET version: 0.8.3
Await wc.Product.Update(productId, [confused what to pass here], parms);
What to pass in the second parameter?
You will have to do something like this:
var prod = new WooCommerceNET.WooCommerce.v3.Product();
prod.regular_price = 100m;
// If regPrice == salePrice Woo will actually clear the sale price
prod.sale_price = 75m;
var resultProduct = await wc.Product.Update( 123, prod );