Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

SV

Newbie
  
  • Posts

    1
  • Joined

  • Last visited

SV's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter

Recent Badges

0

Reputation

  1. Добрый день всем! Помогите решить задачу, кто сталкивался. Хочу сделать добавление товара в корзину по клику Версия 2.0.1.1 Попробовал в шаблоне product.tpl через js добавить количество в input - добавление товара работает, цена увеличивается/уменьшается, но перестает работать кнопка "Купить" - она же добавляет товар в корзину. Родной код: <div class="form-group"> <label class="control-label" for="input-quantity"><?php echo $entry_qty; ?></label> <input type="text" name="quantity" value="<?php echo $minimum; ?>" size="2" id="input-quantity" class="form-control" /> <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" /> </div> Меняю на: <div class="form-group"> <span class="minus">-</span> <input type="text" name="quantity" value="<?php echo $minimum; ?>" size="2" id="input-quantity" class="form-control" /> <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" /> <span class="plus">+</span> </div> JS: <script type="text/javascript" > $(document).ready(function() { $('.minus').click(function () { var $input = $(this).parent().find('input'); var count = parseInt($input.val()) - 1; count = count < 1 ? 1 : count; $input.val(count); $input.change(); return false; }); $('.plus').click(function () { var $input = $(this).parent().find('input'); $input.val(parseInt($input.val()) + 1); $input.change(); return false; }); }); </script> В консоле при родном коде и все работает - по клику "Купить" происходят два события: index.php?route=checkout/cart/add index.php?route=common/cart/info И с кнопками "+-" только: index.php?route=checkout/cart/add Кто знает способ, подскажите плиз! P.S. в шаблоне корзины все норм таким образом все работает.
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.