Created
November 21, 2023 15:21
-
-
Save megamosk/81547f5f4e56f2f3dce7ef8c323cddd1 to your computer and use it in GitHub Desktop.
Битрикс резервирование товара и снятие резерва
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//резервирование товара | |
$productId = 12; | |
$a = new \Bitrix\Catalog\Product\CatalogProvider; | |
$resReserve = $a->reserve(array( | |
$productId => ["PRODUCT_ID" => $productId, "QUANTITY" => 15] | |
)); | |
//снятие резерва | |
//для снятия резерва ВАЖНО чтобы QUANTITY был ОТРИЦАТЕЛЬНЫЙ | |
$a = new \Bitrix\Catalog\Product\CatalogProvider; | |
$resReserve = $a->reserve(array( | |
$productId => ["PRODUCT_ID" => $productId, "QUANTITY" => -15 ] | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment