$id_product
$id_product : integer
Represents quantities available It is either synchronized with Stock or manualy set by the seller
setProductDependsOnStock(integer $id_product, integer $depends_on_stock = true, integer $id_shop = null, $id_product_attribute)
For a given id_product, sets if stock available depends on stock
integer | $id_product | |
integer | $depends_on_stock | Optional : true by default |
integer | $id_shop | Optional : gets context by default |
$id_product_attribute |
setProductOutOfStock(integer $id_product, integer $out_of_stock = false, integer $id_shop = null, $id_product_attribute)
For a given id_product, sets if product is available out of stocks
integer | $id_product | |
integer | $out_of_stock | Optional false by default |
integer | $id_shop | Optional gets context by default |
$id_product_attribute |
getQuantityAvailableByProduct(integer $id_product = null, integer $id_product_attribute = null, integer $id_shop = null) : integer
For a given id_product and id_product_attribute, gets its stock available
integer | $id_product | |
integer | $id_product_attribute | Optional |
integer | $id_shop | Optional : gets context by default |
Quantity
updateQuantity(integer $id_product, integer $id_product_attribute, integer $delta_quantity, integer $id_shop = null)
For a given id_product and id_product_attribute updates the quantity available
integer | $id_product | |
integer | $id_product_attribute | Optional |
integer | $delta_quantity | The delta quantity to update |
integer | $id_shop | Optional |
resetProductFromStockAvailableByShopGroup(\ShopGroup $shop_group)
Removes all product quantities from all a group of shops If stocks are shared, remoe all old available quantities for all shops of the group Else remove all available quantities for the current group
\ShopGroup | $shop_group | the ShopGroup object |
dependsOnStock(integer $id_product, integer $id_shop = null) : boolean
For a given product, tells if it depends on the physical (usable) stock
integer | $id_product | |
integer | $id_shop | Optional : gets context if null @see Context::getContext() |
: depends on stock @see $depends_on_stock
addSqlShopRestriction(\DbQuery $sql = null, $shop = null, string $alias = null) : mixed
Add an sql restriction for shops fields - specific to StockAvailable
\DbQuery | $sql | |
$shop | ||
string | $alias | Optional : The current table alias |
the DbQuery object or the sql restriction string