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

Количество в категории


Recommended Posts

вам нужно в категории показывать количество товаров? я правильно поняла? Тогда вот так:

система->настройки->опции

image.png.1247a3fd85b0a97b4611e68910fc8c77.png

 

Link to comment
Share on other sites

Сделал если кому в будущем нужно будет решение - сделал следующим простым образом

<button class="button__cart__but" type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', $(this).parent().parent().find('.quantity_input').val())"><span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
<input type="number" name="quantity" value="1" size="2" min="1" id="input-quantity" class="quantity_input p_q_<?php echo $product_id; ?>" />      

 

  • +1 1
Link to comment
Share on other sites


23 часа назад, prived сказал:

смотрел - версия не моя

ну проще ж адаптировать чем своё писать, нет?

Link to comment
Share on other sites


  • 9 months later...
В 31.03.2018 в 20:32, prived сказал:

ну что могу сказать ) обошелся 1 дополнительной строчкой) 

просто у ломика оч много там всего опции и тд - а тут все просто и понятно ) 

Привет, а сюда можно как то кратно минимуму втулить?

Link to comment
Share on other sites


  • 4 months later...

OPENCART.PRO  Версия 2.3.0.2.5

шаблон Modern 2

 

Код кнопки такой:

<button type="button" class="btn-cartpr" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-cart"></i> <?php echo $button_cart; ?></button>

Как добавить количество?

Link to comment
Share on other sites


4 часа назад, Egor2014 сказал:

OPENCART.PRO  Версия 2.3.0.2.5

шаблон Modern 2

 

Код кнопки такой:


<button type="button" class="btn-cartpr" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-cart"></i> <?php echo $button_cart; ?></button>

Как добавить количество?

Точно также :) 

  • +1 1
Link to comment
Share on other sites

47 минут назад, legioner26 сказал:

Точно также :) 

Кнопка добавляется, накручиваем количество, но в корзине количество не отражается(

Link to comment
Share on other sites


7 минут назад, legioner26 сказал:

А все ли по примеру сделали?

Да, весь код вставил, что был выше

test.трапеза18.рф/holodnie-zakuski-i-salati/

 

<button class="button__cart__but" type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', $(this).parent().parent().find('.quantity_input').val())"><span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
<input type="number" name="quantity" value="1" size="2" min="1" id="input-quantity" class="quantity_input p_q_<?php echo $product_id; ?>" /> 

 

Link to comment
Share on other sites


Проверьте, при копировании слово class скопировалось не правильно, перепишите его в ручную, и все заработает как надо.

http://prntscr.com/nv9rln

  • +1 1
Link to comment
Share on other sites

В итоге код кнопки тоже малость переделал:

 

<input type="number" name="quantity" value="1" size="2" min="1" id="input-quantity" class="quantity_input p_q_<?php echo $product_id; ?>" />      
<button type="button" class="btn-cartpr" onclick="cart.add('<?php echo $product['product_id']; ?>', $(this).parent().parent().find('.quantity_input').val())"><i class="fa fa-shopping-cart"></i> <?php echo $button_cart; ?></button>

 

Сейчас, как-то кнопку стилизовать сделать + и - сделать.

 

Заработал код со стилизацией:

 

<div class="cart-quantity"> 
<i onclick="$(this).next().val($(this).next().val()-1);$(this).parents('form').submit();" class="fa fa-minus"></i> 
<input type="text" name="quantity" value="1" size="2" min="1" id="input-quantity" class="quantity_input p_q_<?php echo $product_id; ?>" />   
<i onclick="$(this).prev().val(~~$(this).prev().val()+1);$(this).parents('form').submit();" class="fa fa-plus"></i>
<input type="hidden" name="product_id" size="2" value="<?php echo $product['product_id']; ?>" />
</div>     
<button type="button" class="btn-cartpr" onclick="cart.add('<?php echo $product['product_id']; ?>', $(this).parent().parent().find('.quantity_input').val())"><i class="fa fa-shopping-cart"></i> <?php echo $button_cart; ?></button>

 

Еще бы как-то всплывающее окно корзины удалить, а то при нажатии "Купить"вылазит это окно.

test.трапеза18.рф/vtorie-bljuda/

Edited by Egor2014
  • +1 2
Link to comment
Share on other sites


38 минут назад, Egor2014 сказал:

В итоге код кнопки тоже малость переделал:

 


<input type="number" name="quantity" value="1" size="2" min="1" id="input-quantity" class="quantity_input p_q_<?php echo $product_id; ?>" />      
<button type="button" class="btn-cartpr" onclick="cart.add('<?php echo $product['product_id']; ?>', $(this).parent().parent().find('.quantity_input').val())"><i class="fa fa-shopping-cart"></i> <?php echo $button_cart; ?></button>

 

Сейчас, как-то кнопку стилизовать сделать + и - сделать.

 

Заработал код со стилизацией:

 


<div class="cart-quantity"> 
<i onclick="$(this).next().val($(this).next().val()-1);$(this).parents('form').submit();" class="fa fa-minus"></i> 
<input type="text" name="quantity" value="1" size="2" min="1" id="input-quantity" class="quantity_input p_q_<?php echo $product_id; ?>" />   
<i onclick="$(this).prev().val(~~$(this).prev().val()+1);$(this).parents('form').submit();" class="fa fa-plus"></i>
<input type="hidden" name="product_id" size="2" value="<?php echo $product['product_id']; ?>" />
</div>     
<button type="button" class="btn-cartpr" onclick="cart.add('<?php echo $product['product_id']; ?>', $(this).parent().parent().find('.quantity_input').val())"><i class="fa fa-shopping-cart"></i> <?php echo $button_cart; ?></button>

 

 

:) 

Link to comment
Share on other sites

  • 3 weeks later...
  • 10 months later...
В 31.03.2018 в 18:14, prived сказал:

Сделал если кому в будущем нужно будет решение - сделал следующим простым образом


<button class="button__cart__but" type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', $(this).parent().parent().find('.quantity_input').val())"><span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
<input type="number" name="quantity" value="1" size="2" min="1" id="input-quantity" class="quantity_input p_q_<?php echo $product_id; ?>" />      

 

Спасибо

Link to comment
Share on other sites


  • 9 months later...
On 3/31/2018 at 6:37 PM, HyperLabTeam said:

ну проще ж адаптировать чем своё писать, нет?

Под 2.3 кто нибудь адаптировал модуль ломика?

Link to comment
Share on other sites


  • 6 months later...
В 01.03.2021 в 17:01, mscbro сказал:

Под 2.3 кто нибудь адаптировал модуль ломика?

гляньте в теме поддержки, я подправил модификатор, правда только для страницы товара

Link to comment
Share on other sites


  • 1 year later...
30.03.2018 в 15:17, alena967 сказал:

вам нужно в категории показывать количество товаров? я правильно поняла? Тогда вот так:

система->настройки->опции

image.png.1247a3fd85b0a97b4611e68910fc8c77.png

 

Спасибо! То, что искал!

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.