V
V
Vladimir Kulikov2019-12-01 19:42:02
1C-Bitrix
Vladimir Kulikov, 2019-12-01 19:42:02

How to make +- in bitrix cart?

<?foreach ($arResult["CATEGORIES"] as $category => $items):
            if (empty($items))
              continue;
            ?>
            <?foreach ($items as $v):?>
<pre>
<?php //var_dump($v) ?>
</pre>
            <li class="cart-popup__item">
              <div class="cart-popup__delete"></div>
              <div class="cart-popup__tophalf">
                <div class="cart-popup__art">
                <img src="<?=$v["PICTURE_SRC"]?>" alt="" class="cart-popup__img">
                </div>
                <div class="cart-popup__name">
                <span><?=$v["NAME"]?></span>
                </div>
              </div>
              <div class="cart-popup__bottomhalf">
                <div class="cart-popup__botitem">
                <div class="cart-popup__bottitle">
                  <span>Цена</span>
                </div>
                <div class="cart-popup__nums cart-popup__nums_one">
                  <span><?=$v["PRICE_FMT"]?></span>
                </div>
                </div>
                <div class="cart-popup__botitem">
                <div class="cart-popup__bottitle">
                  <span>Количество</span>
                </div>

                <div class="cart-popup__quant-calc">
                  <div class="cart-popup__calcbtn cart-popup__calcbtn_min">
                  <span>-</span>
                  </div>
                  <div class="cart-popup__calcdisp">
                  <span><?=$v["QUANTITY"]?></span>
                  </div>
                  <div class="cart-popup__calcbtn cart-popup__calcbtn_plus">
                  <span>+</span>
                  </div>
                </div>
                </div>
                <div class="cart-popup__botitem">
                <div class="cart-popup__bottitle">
                  <span>Всего</span>
                </div>
                <div class="cart-popup__nums cart-popup__nums_fin">
                  <span><?=$v["SUM"]?></span>
                  <!--<span><?php//=$v["FULL_PRICE"]?></span>-->
                </div>
                </div>
              </div>
            </li>

            <?endforeach;?>
          <?endforeach;?>

How to make the functionality of adding and decreasing the number of items in the cart? Here is a piece of code. Everything works except +-

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2019-12-02
@anton99zel

Write code in JS, then pass the selected amount to Add2BasketByProductID https://codepen.io/AngReload/pen/jQqjbe

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question