Bitrix Site Manager

CCatalogProduct::QuantityTracer

bool
CCatalogProduct::QuantityTracer(
 int PRODUCT_ID, 
 int DELTA_QUANTITY
);

The method QuantityTracer decrements the number of products in stock. The method succeeds if only the resulting quantity is not below zero and the specified product has the flag Reduce quantity upon order set.

Parameters

ParameterDescription
PRODUCT_ID The ID of the product whose quantity is to be changed.
DELTA_QUANTITY Specifies the number to be subtracted from the product counter.

Return Values

Returns True on success or False otherwise.

Example



<?
// Decrement the quantity of product "5" in stock by 12 items
CCatalogProduct::QuantityTracer(5, 12);
?>