i would like to check if user will add to cart less that current stock which i did by editing file catalog/view/theme/journal3/template/product/product.twig
Code: Select all
......
$('#button-cart, [data-quick-buy]').on('click', function () {
var $btn = $(this);
var maximum_quantity = jQuery("#product-quantity").attr("data-maximum");
var current_quantity = jQuery("#product-quantity").val();
//console.log(maximum_quantity);
if (current_quantity > maximum_quantity) {
if (maximum_quantity > 200) {
alert("Δεν υπάρχει αρκετό απόθεμα.");
} else {
alert("Δεν υπάρχει αρκετό απόθεμα. Παρακαλώ εισάγετε "+maximum_quantity+" ή λιγότερο.");
}
return;
}
$.ajax({
url: 'index.php?route=checkout/cart/add',
......
however i can't figure out how to achieve the same result on the category page.
Please point me to the right direction as i've been randomly searching for files and i have already spent many hours.
thank you in advance,
Menelaos