Answer the question
In order to leave comments, you need to log in
js. How to increase the price of a product depending on its quantity?
In general situations, there is a product, they have prices and quantity of goods, therefore 1 product = price of 1 product * per quantity. And so is the total sum of all goods. I'm not able to implement the price cheat, the quantity counter works. Please tell me how to implement, that's what is now available.
$(document).ready(function () {
var quantity = parseInt(<?=$arItem['QUANTITY']?>);
$('.minus').click(function () {
var price = parseInt(<?=$arItem['PRICE']?>);
var sum = price * quantity;
var count = sum - price;
count = count > price ? count : price;
$('#sum_<?= $arItem["ID"] ?>').html(count);
return false;
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question