K
K
kimqar_ver2021-04-07 14:50:28
1C-Bitrix
kimqar_ver, 2021-04-07 14:50:28

Bitrix price tag in the cart appears only when some product is deleted?

I make a custom basket on Bitrix, it seems to work, but it seems not.
There is no block with the final price tag in the cart. It looks like this:
606d9c7b2dea8300847625.png
To the right of the products there should be a final block with a price tag. But he is not. It only appears when I click for example delete an item in the cart.
Example (deleted 1 product)
606d9cbd834de163268299.png
What could be wrong?
Code of the right block (prices):

<? if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();

use Bitrix\Main\Localization\Loc;

/**
 * @var array $arParams
 */
?>


<script id="basket-total-template" type="text/html">
    <div class="cart-total">
        <p class="cart-total__text mb-15"><?=$arResult['BASKET_ITEMS_COUNT']?> товара</p>
        <div class="mb-45">
            {{#DISCOUNT_PRICE_FORMATED}}

            {{#PRICE_WITHOUT_DISCOUNT_FORMATED}}
            <div class="cart-total__line">
                <span class="cart-total__line-left">Цена без скидки</span>
                <span class="cart-total__line-right" data-entity="basket-total-price">{{{PRICE_WITHOUT_DISCOUNT_FORMATED}}}</span>
            </div>
            {{/PRICE_WITHOUT_DISCOUNT_FORMATED}}

            <div class="cart-total__line">
                <span class="cart-total__line-left">Скидка</span>
                <span class="cart-total__line-right" data-entity="basket-total-price">{{{DISCOUNT_PRICE_FORMATED}}}</span>
            </div>
            {{/DISCOUNT_PRICE_FORMATED}}

            <div class="cart-total__line">
                <span class="cart-total__line-left">Итого</span>
                <span class="cart-total__line-right" data-entity="basket-total-price">{{{PRICE_FORMATED}}}</span>
            </div>

            <div class="cart-total__line">
                <span class="cart-total__line-left">Доставка</span>
                <span class="cart-total__line-right">не выбрана</span>
            </div>
        </div>
        <span class="cart-total__line-left">Бесплатная доставка от {{{FREE_DELIVERY}}}</span>
        <br>
        {{#SHOW_FREE_DELIVERY}}
        <span class="cart-total__line-left">Наберите товаров ещё на {{{NEED_FOR_FREE_DELIVERY}}} для бесплатной доставки</span>
        <br>
        {{/SHOW_FREE_DELIVERY}}
        <button class="button-default button-default_full" data-entity="basket-checkout-button">Перейти к оформлению</button>
        <?/*{{#SHOW_BTN}}
        <button class="button-default button-default_full" data-entity="basket-checkout-button">Перейти к оформлению</button>
        {{/SHOW_BTN}}
        {{^SHOW_BTN}}
        <span class="cart-total__line-left">Минимальная сумма заказа {{MIN_PRICE_ORDER}}</span>
        <br>
        <span class="cart-total__line-left">Наберите товаров ещё на {{NEED_PRICE}}</span>
        {{/SHOW_BTN}}
        */?>
    </div>



    <!--
        <div class="basket-checkout-container" data-entity="basket-checkout-aligner">
    <?/*
    if ($arParams['HIDE_COUPON'] !== 'Y')
    {
      */?>
      <div class="basket-coupon-section">
        <div class="basket-coupon-block-field">
          <div class="basket-coupon-block-field-description">
            <?/*=Loc::getMessage('SBB_COUPON_ENTER')*/?>:
          </div>
          <div class="form">
            <div class="form-group" style="position: relative;">
              <input type="text" class="form-control" id="" placeholder="" data-entity="basket-coupon-input">
              <span class="basket-coupon-block-coupon-btn"></span>
            </div>
          </div>
        </div>
      </div>
      <?/*
    }
    */?>
    <div class="basket-checkout-section">
      <div class="basket-checkout-section-inner">
        <div class="basket-checkout-block basket-checkout-block-total">
          <div class="basket-checkout-block-total-inner">
            <div class="basket-checkout-block-total-title"><?/*=Loc::getMessage('SBB_TOTAL')*/?>:</div>
            <div class="basket-checkout-block-total-description">
              {{#WEIGHT_FORMATED}}
                <?/*=Loc::getMessage('SBB_WEIGHT')*/?>: {{{WEIGHT_FORMATED}}}
                {{#SHOW_VAT}}<br>{{/SHOW_VAT}}
              {{/WEIGHT_FORMATED}}
              {{#SHOW_VAT}}
                <?/*=Loc::getMessage('SBB_VAT')*/?>: {{{VAT_SUM_FORMATED}}}
              {{/SHOW_VAT}}
            </div>
          </div>
        </div>

        <div class="basket-checkout-block basket-checkout-block-total-price">
          <div class="basket-checkout-block-total-price-inner">
            {{#DISCOUNT_PRICE_FORMATED}}
              <div class="basket-coupon-block-total-price-old">
                {{{PRICE_WITHOUT_DISCOUNT_FORMATED}}}
              </div>
            {{/DISCOUNT_PRICE_FORMATED}}

            <div class="basket-coupon-block-total-price-current" data-entity="basket-total-price">
              {{{PRICE_FORMATED}}}
            </div>

            {{#DISCOUNT_PRICE_FORMATED}}
              <div class="basket-coupon-block-total-price-difference">
                <?/*=Loc::getMessage('SBB_BASKET_ITEM_ECONOMY')*/?>
                <span style="white-space: nowrap;">{{{DISCOUNT_PRICE_FORMATED}}}</span>
              </div>
            {{/DISCOUNT_PRICE_FORMATED}}
          </div>
        </div>

        <div class="basket-checkout-block basket-checkout-block-btn">
          <button class="btn btn-lg btn-default basket-btn-checkout{{#DISABLE_CHECKOUT}} disabled{{/DISABLE_CHECKOUT}}"
            data-entity="basket-checkout-button">
            <?/*=Loc::getMessage('SBB_ORDER')*/?>
          </button>
        </div>
      </div>
    </div>

    <?/*
    if ($arParams['HIDE_COUPON'] !== 'Y')
    {
    */?>
      <div class="basket-coupon-alert-section">
        <div class="basket-coupon-alert-inner">
          {{#COUPON_LIST}}
          <div class="basket-coupon-alert text-{{CLASS}}">
            <span class="basket-coupon-text">
              <strong>{{COUPON}}</strong> - <?/*=Loc::getMessage('SBB_COUPON')*/?> {{JS_CHECK_CODE}}
              {{#DISCOUNT_NAME}}({{DISCOUNT_NAME}}){{/DISCOUNT_NAME}}
            </span>
            <span class="close-link" data-entity="basket-coupon-delete" data-coupon="{{COUPON}}">
              <?/*=Loc::getMessage('SBB_DELETE')*/?>
            </span>
          </div>
          {{/COUPON_LIST}}
        </div>
      </div>
      <?/*
    }
    */?>
  </div>-->
</script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ainur Valiev, 2021-04-20
@vaajnur

see the createTotalUnit method in order_ajax.js for what is causing it and why the initialization is not happening.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question