$frame = new \Bitrix\Main\Page\FrameBuffered("my_dynamic"); // или $this->createFrame() в шаблоне
$frame->begin();
// Содержание динамической области
$frame->beginStub();
// Заглушка
$frame->end();
$APPLICATION->get_cookie('NAME', false)
$basketItems = $basket->getBasketItems();
$isset_ids = array();
foreach ($basket as $basketItem) {
$id = $basketItem->getProductId();
// совпал только id
if($productId == $id){
$props = $basketItem->getPropertyCollection();
$vals = $props->getPropertyValues();
// совпадают все параметры
if(
( isset($vals['SIZE']) && $vals['SIZE']['VALUE'] == $_REQUEST["SIZE"] ) &&
( isset($vals['ARTICLE']) && $vals['ARTICLE']['VALUE'] == $arItem["PROPERTY_ARTICUL_VALUE"] ) &&
( isset($vals['COLOR']) && $vals['COLOR']['VALUE'] == $arItem["PROPERTY_COLOR_VALUE"] )
){
echo "finded!";
$basketItem->setField('QUANTITY', $basketItem->getQuantity() + 1);
$basketItem->save();
$isset_ids[] = $id;
}
}
}
CCatalogProduct::add(array('ID' => $row['ID'], 'QUANTITY' => $fields['QUANTITY']));
CModule::IncludeModule('sale');
$arBasketItems = array();
$dbBasketItems = CSaleBasket::GetList(
array(
"NAME" => "ASC",
"ID" => "ASC"
),
array(
"FUSER_ID" => CSaleBasket::GetBasketUserID(),
"LID" => SITE_ID,
"ORDER_ID" => "NULL"
),
false,
false,
array("ID", "CALLBACK_FUNC", "MODULE",
"PRODUCT_ID", "QUANTITY", "DELAY",
"CAN_BUY", "PRICE", "WEIGHT")
);
while ($arItem = $dbBasketItems->Fetch())
{
$arItem = CSaleBasket::GetByID($arItem["ID"]);
$arDiscounts = CCatalogDiscount::GetDiscountByProduct(
$arItem['PRODUCT_ID'],
$USER->GetUserGroupArray(),
"N",
2,
SITE_ID
);
}
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
$email = new PHPMailer();
$email->SetFrom('you@example.com', 'Your Name'); //Name is optional
$email->Subject = 'Message Subject';
$email->Body = $bodytext;
$email->AddAddress( 'destinationaddress@example.com' );
$file_to_attach = 'PATH_OF_YOUR_FILE_HERE';
$email->AddAttachment( $file_to_attach , 'NameOfFile.pdf' );
return $email->Send();
$arResult["DISPLAY_PROPERTIES"] = array();
foreach ($arResult["PROPERTIES"] as $pid => &$arProp)
{
if((is_array($arProp["VALUE"]) && count($arProp["VALUE"])>0) ||
(!is_array($arProp["VALUE"]) && strlen($arProp["VALUE"])>0))
{
$arResult["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arResult['ITEMS'], $arProp, '');
}
}
$arResult['SHOW_OFFERS_PROPS'] = true;
list($PRODUCT_ID, $STORE_ID) = array(53914, 5);
// класс для работы со остатками товара на складах. Не путать с CCatalogStore
$rsStore = CCatalogStoreProduct::GetList(
[],
[
"PRODUCT_ID" => $PRODUCT_ID,
"STORE_ID" => $STORE_ID,
],
false,
false,
[]
);
$arStore = $rsStore->Fetch();
$res = CCatalogStoreProduct::Update(
$arStore['ID'],
[
"PRODUCT_ID" => $PRODUCT_ID,
"STORE_ID" => $STORE_ID,
"AMOUNT" => 0,
]
);