sendToBasket: function()
{
if (!this.canBuy)
{
return;
}
// check recommendation
if (this.product && this.product.id && this.bigData)
{
this.rememberProductRecommendation();
}
this.initBasketUrl();
this.fillBasketProps();
BX.ajax({
method: 'POST',
dataType: 'json',
url: this.basketUrl, //"/polimernye-kolesootbojniki/?action=ADD2BASKET&id=16998"
data: this.basketParams, // ajax_basket: "Y"basket_props: "YToxOntpOjA7czo5OiJBTktFUlNfSU0iO30="quantity: "16"
onsuccess: BX.proxy(this.basketResult, this)
});
},
sendToBasket: function()
{
if (!this.canBuy)
{
return;
}
// check recommendation
if (this.product && this.product.id && this.bigData)
{
this.rememberProductRecommendation();
}
this.initBasketUrl();
this.fillBasketProps();
var url = this.basketUrl.split('id=')[0] + 'id=';
var arrid = [];
var basketParams = [];
var idmaintov = this.arParamsCustom.PRODUCT.ID;
arrid.push(this.basketUrl.split('id=')[1]);
basketParams.push(this.basketParams);
// получает количесво и id товара анкера
if($('#ankers'+idmaintov).val() > 0) {
arrid.push($('#ankers'+idmaintov).data('id'));
var ankersq = Object.assign({}, this.basketParams);
ankersq.quantity = $('#ankers'+idmaintov).val();
basketParams.push(ankersq);
}
// получает количесво и id услуги монтаж 1 анкера
if($('#construction'+idmaintov).prop('checked') && $('#ankers'+idmaintov).val() > 0){
arrid.push($('#construction'+idmaintov).data('id'));
var construction = Object.assign({}, this.basketParams);
construction.quantity = $('#ankers'+idmaintov).val();
basketParams.push(construction);
}
for (let i = 0; i < arrid.length; i++){
BX.ajax({
method: 'POST',
dataType: 'json',
url: url + arrid[i] ,
data: basketParams[i],
onsuccess: BX.proxy(this.basketResult, this)
});
}
},