Skip to content

Instantly share code, notes, and snippets.

@megamosk
Created November 21, 2023 15:21
Show Gist options
  • Save megamosk/81547f5f4e56f2f3dce7ef8c323cddd1 to your computer and use it in GitHub Desktop.
Save megamosk/81547f5f4e56f2f3dce7ef8c323cddd1 to your computer and use it in GitHub Desktop.
Битрикс резервирование товара и снятие резерва
<?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