<div class="product-item-detail-info-container">
<div class="product-item-detail-price-old" id="bx_117848907_265_old_price" style="display: none;"></div>
<div class="product-item-detail-price-current" id="bx_117848907_265_price" style="font-size: 30px;">2 000 руб.</div>
<div class="item_economy_price" id="bx_117848907_265_price_discount" style="display: none;"></div>
</div>
<form id="basket" action="/bitrix/templates/dveri/ajax/basket.php" method="POST" enctype="multipart/form-data">
<?
if ($haveOffers && !empty($arResult['OFFERS_PROP']))
{
?>
<input type="hidden" value="<?=$arResult['OFFERS'];?>" id="id" name="id">
<input class="product-item-detail-price-current" type="hidden" value="<?=$base_price["PRICE"];?>" id="price<?//=$itemIds['PRICE_ID']?>" name="price">
<?
}
else {
?>
<input type="hidden" value="<?=$arResult["ID"];?>" id="id" name="id">
<input type="hidden" value="<?=$base_price["PRICE"];?>" id="price" name="price">
<?
}
?>
<input type="hidden" value="Y" name="add" id="add">
<span class="plus">+</span>
<span class="minus">-</span>
<input type="text" name="count" value="1" class="count" id="count">
<button type="button" id="send" name="button" style="cursor: pointer;">В корзину</button>
</form>
<?require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
$count = $_POST['count'];
$id = $_POST['id'];
$add = $_POST['add'];
$mess = '';
$PRICE_ID = '1';
$SITEE_ID = 's5';
\Bitrix\Main\Loader::includeModule('sale');
\Bitrix\Main\Loader::includeModule('catalog');
// Получаем корзину пользователя
$basket = \Bitrix\Sale\Basket::LoadItemsForFUser(
\Bitrix\Sale\Fuser::getId(),
$SITEE_ID
);
if (CModule::IncludeModule("catalog") && CModule::IncludeModule("sale")) {
$product = array('PRODUCT_ID' => $id, 'QUANTITY' => $count);
$result = \Bitrix\Catalog\Product\Basket::addProductToBasket($basket, $product, array('SITE_ID' => $SITEE_ID));
if (!$result->isSuccess()) {
var_dump($result->getErrorMessage());
}
$basket->save();
AddMessage2Log("<br/><br/><pre>".print_r($result,true)."</pre><br/><br/>", "test");
echo $mess;
}
else { echo "Не подключены модули"; }
/**/
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");
?>
У меня была там такая строчка. Выдает
value="undefined"
- это про ценучтобы обновлялся id еще надо было дописать