//Получаю данные товара
$arFilterOffers = array('IBLOCK_ID' => 8, 'ID' => 15319);
$rsOffers = CIBlockElement::GetList(array(),$arFilterOffers, false, false, array());
while($Offers = $rsOffers->GetNext()){
$arOffers = $Offers;
}
//Получаю данные цены
$dbPrices = CPrice::GetList(
array(),
array("PRODUCT_ID" => 15319,"CATALOG_GROUP_ID" => 1),
false,
false,
array()
);
while($price = $dbPrices->Fetch()){
$OffersCost = $price;
}
$arFields = array(
"PRODUCT_ID" => $arOffers["ID"],
"PRODUCT_PRICE_ID" => $OffersCost["ID"],
"PRICE" => 100,
"CURRENCY" => "RUB",
"WEIGHT" => 530,
"QUANTITY" => 1,
"LID" => LANG,
"DELAY" => "N",
"CAN_BUY" => "Y",
"NAME" => $arOffers["NAME"],
"CALLBACK_FUNC" => "MyBasketCallback",
"MODULE" => "catalog",
"NOTES" => "",
"ORDER_CALLBACK_FUNC" => "MyBasketOrderCallback",
"DETAIL_PAGE_URL" => $arOffers["DETAIL_PAGE_URL"]
);
CSaleBasket::Add($arFields); |