WC_Product_Data_Store_Interface::update_product_sales()
Update a product's sale count directly.
Uses queries rather than update_post_meta so we can do this in one query for performance.
Метод класса: WC_Product_Data_Store_Interface{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$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) (обязательный)
- Product ID.
- $quantity(int|null)
- Stock quantity to use for update.
По умолчанию: null - $operation(строка)
- Either set, increase or decrease.
По умолчанию: 'set'
Код WC_Product_Data_Store_Interface::update_product_sales() WC Product Data Store Interface::update product sales WC 8.7.0
public function update_product_sales( $product_id, $quantity = null, $operation = 'set' );