D
D
Denis Dormadekhin2019-02-14 18:32:02
1C-Bitrix
Denis Dormadekhin, 2019-02-14 18:32:02

How to trigger cart rendering in a new Bitrix template?

The new component template sale.basket.basket is used, with the mustache template engine
.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Dormadekhin, 2019-02-19
@dormadekhin

I contacted Bitrix support, as it turned out this file was left as a result of an incorrect template update, and it should not be there,
I also asked how to update the contents of the basket, the answer is as follows

BX.Sale.BasketComponent.sendRequest('refreshAjax', {fullRecalculation: 'Y'});

R
Roman Gritsuk, 2019-02-14
@winer

I did not find a separate method for updating. Can be updated like this:

BX.Sale.BasketComponent.fillTotalBlocks();
for(itemId in BX.Sale.BasketComponent.items){
  if(BX.Sale.BasketComponent.items.hasOwnProperty(itemId)){
    BX.Sale.BasketComponent.redrawBasketItemNode(itemId);
  }
}

A
Andrey Korekhov, 2021-06-28
@Haotik

Not quite a beautiful way, but in the script for deleting a product from the upper basket, the following code is called
....
reloadTopBasket('', $('#basket_line, #basket_line_fixed, #basket_line_fixed_mobile'), 200, 2000, 'N', $(this ));
...
It works fine for me and the cart is updated without any problems

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question