WooCommerce.NET icon indicating copy to clipboard operation
WooCommerce.NET copied to clipboard

How to update price for a product

Open haditime opened this issue 3 years ago • 1 comments

  • 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?

haditime avatar May 12 '21 09:05 haditime

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 );

firestormza avatar Jun 14 '21 09:06 firestormza