WC_Product_Data_Store_Interface::update_product_sales()publicWC 1.0

Update a product's sale count directly.

Uses queries rather than update_post_meta so we can do this in one query for performance.

{} It's a method of the class: WC_Product_Data_Store_Interface{}

No Hooks.


null. Nothing.


$WC_Product_Data_Store_Interface = new WC_Product_Data_Store_Interface();
$WC_Product_Data_Store_Interface->update_product_sales( $product_id, $quantity, $operation );
$product_id(int) (required)
Product ID.
Stock quantity to use for update.
Default: null
Either set, increase or decrease.
Default: 'set'

Code of WC_Product_Data_Store_Interface::update_product_sales() WC 6.8.2

public function update_product_sales( $product_id, $quantity = null, $operation = 'set' );