define('CATALOG_IBLOCK_ID', 27); //каталог для выгрузки товаров
define('STORE_ID', 1); //id скалада
class AddQuantityStoreEvent
{
public static function AddQuantityStore($ID, $arFields)
{
if ($arFields["IBLOCK_ID"] != CATALOG_IBLOCK_ID) {
return;
}
if ($arFields['QUANTITY'] > 0) {
$arFieldsStoreAmount = Array(
"PRODUCT_ID" => $arFields['ID'],
"STORE_ID" => STORE_ID,
"AMOUNT" => $arFields["QUANTITY"]
);
$id_product_store = \CCatalogStoreProduct::Add($arFieldsStoreAmount);
}
Bitrix\Main\Diag\Debug::writeToFile(array('fields' => $arFields, 'id-product-store' => $id_product_store), "", "log.txt");
}
}
AddEventHandler('catalog', 'OnProductAdd', ['AddQuantityStoreEvent', 'AddQuantityStore']);
$row = mysql_fetch_array($sql);
$text = $row ['text'];
echo "<td>".preg_match_all("#<span(?:.*?)\"id(.*?)\-#si", $text, $matches);
foreach ($matches[1] as $val) {
echo $val." ";}
"</td>";
echo "<td>".preg_match_all("#<span(?:.*?)\"id(.*?)\-#si", $row ['text'], $matches);
foreach ($matches[1] as $val) {
echo $val." ";}
"</td>";