How to add a property to cart into Bitrix?

In the item card has a property of type list, multiple. Appears this way:
<? if ($arResult["PROPERTIES"]["DIMENSIONS"]["VALUE"]) { ?>
 <div class="catalog-detail__options">
 <select name="size">
 <option disabled><?=GetMessage("SELECT_SIZE")?></option>
 <? foreach($arResult["PROPERTIES"]["DIMENSIONS"]["VALUE"] as $size) { ?>
 <option value="<?=$size?>"><?=$size?></option>
 <? } ?>
 <? } ?>

How to pass it in the bin?
That is, at the moment it is transmitted, but is transmitted in its entirety all, that is, if you specify a single size, it still passed the array of all sizes.
June 3rd 19 at 19:02
2 answers
June 3rd 19 at 19:04
One of the sites we have approximately made through the api
array("CODE" => "DIMENSIONS", "NAME" => "Size", "VALUE" => $_POST['size']),

You need to pass product id, quantity, code property name (and the name randomly is even possible), and the VALUE to pass something jabbed the user, i.e., the size of. I have made it through $_POST. I think the point is clear
The bottom line is clear for a long time, but how to convey?
item id, quantity supplied, the size of the same is transmitted, but the entire array, property, multiple, and Yes, if you choose one size that all passed, Hz. why. - Camilla36 commented on June 3rd 19 at 19:07
which method use to send the product to the cart? - Nedra3 commented on June 3rd 19 at 19:10
If I'm in the right direction was, but kind of in the right because if you remove this piece of code that doesn't work. In the file scripts.js there is such a fragment, the method ADD2BASKET out?:
 var id = $(this).data('id');
 var quantity = $('.quantity-value').val();
 type: 'POST',
 url: '?action=ADD2BASKET&id='+id+'&quantity='+quantity,
 data: ",
 success: function(){
 type: 'POST',
 url: '/ajax.handler.php',
 data: 'PAGE=CART',
 success: function(data){
 var itemTitle = $('h1').text();
 $('.order-notification__title').text(itemTitle+' added to cart!');
 $('.order-notification').fadeIn().animate({'marginRight': '0'});
- Camilla36 commented on June 3rd 19 at 19:13
How to make on js I don't know as not good at it.
But apparently missing arProductParams
Can you help this article - Nedra3 commented on June 3rd 19 at 19:16
June 3rd 19 at 19:06
Like it's not in JS because still passed without it. In the basket there is such code:
<?if(!empty($_GET["act"]) && CModule::IncludeModule("catalog") && CModule::IncludeModule("sale") && CModule::IncludeModule("iblock")){

 if($_GET["act"] == "upd"){
 echo CSaleBasket::Update(intval($_GET['id']), array(
 "QUANTITY" =--> intval($_GET["q"]),
 "DELAY" => "N"
 }elseif($_GET["act"] == "del"){
 echo CSaleBasket::Delete(intval($_GET['id']));
 }elseif($_GET["act"] == "updDeliveryPayment"){

 $delivery_type = $_GET["DEVIVERY_TYPE"];
 $pay_type = $_GET["PAY_TYPE"];
 $receive_address = $_GET["receive_address"];

 $arBasketItems = array();
 $arBasketOrder = array("NAME" => "ASC", "ID" => "ASC");
 $arBasketUser = array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => "NULL");
 $arBasketSelect = array("ID", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "DELAY",
 $dbBasketItems = CSaleBasket::GetList($arBasketOrder, $arBasketUser, false, false, $arBasketSelect);

 while ($arItems = $dbBasketItems->Fetch()){

 $arResult["PRODUCTS_CART"][] = $arItems;

 $arResult["SUM"] += $arItems['PRICE'] * $arItems['QUANTITY'];


 $arD2P = array();
 $arP2D = array();
 $payment_ids = array();
 $delivery_ids = array();

Here's the code, just checked, adds to cart a product with a property:
 30949, //specify the ID of the real item
array("CODE" =--> "DIMENSIONS", "NAME" => "Size", "VALUE" => XXL),

create a page, place this code, run it, see the basket, the property and product have? If so, use this method in the template the item card. - Camilla36 commented on June 3rd 19 at 19:09

Find more questions by tags 1C-Bitrix