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

Как умножить а не добавить количество товара при клике +?


annnn
 Share

Recommended Posts

Подскажите
установлено минимальное количество товара для заказа допустим 500шт
если нажать +, то прибавит.  будет 501
а нужно множить на 2
что бы при нажатии на + добавилось еще 500 = 1000
где это вообще правится?
 

Edited by annnn
Link to comment
Share on other sites


18.01.2023 в 19:58, annnn сказал:

Подскажите
установлено минимальное количество товара для заказа допустим 500шт
если прибавить +, то будет 501
а нужно множить
что бы при нажатии на + добавилось еще 500
 

 

Если правильно понял, то можно так сделать?

Screenshot_25.png

Link to comment
Share on other sites


потому что если поставить умножение, то будет назначено ко всем товарам, а если есть товар который не продает 500 штук а по 10

Link to comment
Share on other sites


18.01.2023 в 21:10, foggy сказал:

потому что если поставить умножение, то будет назначено ко всем товарам, а если есть товар который не продает 500 штук а по 10

так всем и нужно
функционал сделан под упаковки

Link to comment
Share on other sites


  • annnn changed the title to Как умножить а не добавить количество товара при клике +?

Смотря как у Вас реализован функционал +-

можно сделать скриптом примерно вот так

$(document).ready(function() {
  $('.minus').click(function () {
  var $input = $(this).parent().find('input');
  var count = parseInt($input.val()) / 2;
  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()) * 2);
  $input.change();
  return false;
  });
  });
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.