E
E
Egor Tregubenko2018-07-27 09:43:40
1C-Bitrix
Egor Tregubenko, 2018-07-27 09:43:40

Condition for maximum item quantity sale.basket.basket?

Now adding the quantity of goods in the cart works correctly (if 5, it does not add more than 5), how can one add one more condition (pop-up tooltip) to this condition? .For example, in the card itself it is implemented like this:

window.JCCatalogElement.prototype.QuantityMaximumShow = function (curValue) {
  console.log(curValue);
  var tooltip = $('.detail__price-block').tooltip({
    title: 'Количество ' + curValue + ' шт. в данный момент не доступно для заказа. Максимум: ' + this.maxQuantity + ' шт.',
    trigger: 'manual',
    animation: 'fade'
  });
  tooltip.tooltip('show');

  setTimeout(function () {
    tooltip.tooltip('hide');
    tooltip.tooltip('destroy');
  }, 3000);
};

in the basket itself, sale.basket.basket , a slightly different implementation:
<td class="basket-items-list-item-amount">
        <div class="basket-item-block-amount{{#NOT_AVAILABLE}} disabled{{/NOT_AVAILABLE}}"
          data-entity="basket-item-quantity-block">
          <span class="basket-item-amount-btn-minus" data-entity="basket-item-quantity-minus"></span>
          <div class="basket-item-amount-filed-block">

            <input type="text" class="basket-item-amount-filed" value="{{QUANTITY}}" // в этом полу количество товара

              {{#NOT_AVAILABLE}} disabled="disabled"{{/NOT_AVAILABLE}}
              data-value="{{QUANTITY}}" data-entity="basket-item-quantity-field"
              id="basket-item-quantity-{{ID}}">
          </div>
          <span class="basket-item-amount-btn-plus" data-entity="basket-item-quantity-plus"></span>
          <div class="basket-item-amount-field-description">
            <?
            if ($arParams['PRICE_DISPLAY_MODE'] === 'Y')
            {
              ?>
              {{MEASURE_TEXT}}

              <?
            }
            else
            {
              ?>
              {{#SHOW_PRICE_FOR}}
                {{MEASURE_RATIO}} {{MEASURE_TEXT}} =
                <span id="basket-item-price-{{ID}}">{{{PRICE_FORMATED}}}</span>
              {{/SHOW_PRICE_FOR}}
              {{^SHOW_PRICE_FOR}}
                {{MEASURE_TEXT}}
              {{/SHOW_PRICE_FOR}}
              <?
            }
            ?>
          </div>
          {{#SHOW_LOADING}}
            <div class="basket-items-list-item-overlay"></div>
          {{/SHOW_LOADING}}
        </div>
      </td>

what's the syntax? vue?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question