1

I have a product with with sizes 40 and 43 each with qty 1 available but when I try to an place order for qty=1 of that product it say please select qty min 1 and max 1000 even though the available qty is 1.

Link to the Product

Note: When I clear the browser history I can add the product to the Cart but when I remove it from the Cart and try to add it again it gives the message please select qty min 1 and max 10000.

enter image description here enter image description here enter image description here

2
  • The link is not working
    – Stefan
    Jan 18, 2017 at 8:01
  • @Phil sorry for that, please check on this problem the is working now. Jan 18, 2017 at 8:44

2 Answers 2

2

If you check your javascript code there is condition like

if(eval(temp - curQty) < 0){
    re = 0;
    if ( manage_stock == 0 ){
     alert('Please, enter quantity  Min:'+minQty+' and  Max:'+maxQty);
     return false;
    }
    alert('Please, enter quantity  Min:'+minQty+' and Max:'+maxQty+' (Inventory:'+qtyStock_1+')');
    return false;
}

condition temp - curQty < 0 is true so that error message display

you have to change this condition from temp - curQty < 0 to temp - curQty < 1

maybe this will work for you or you can set dynamic value for < 1

9
  • Can you please tell me which JS file contains these lines of code? Jan 18, 2017 at 9:39
  • this js code is in template (.phtml file ). i am not sure which phtml file but maybe it's locate in app/design/frontend/base/default/template/catalog/product/view/ addtocart.phtml you can find in directory for this code Please, enter quantity Min: Jan 18, 2017 at 9:44
  • just run "grep -r 'Please, enter quantity Min' . -l " in webroot. It will output the file which contains this string. Good luck :)
    – Stefan
    Jan 18, 2017 at 9:53
  • @vaibhav ahalpara I have changed the value temp - curQty) < 0 to temp - curQty) < 1 but it did not work. Jan 18, 2017 at 9:57
  • @vaibhav ahalpara This problem is only with configurable products. Jan 18, 2017 at 10:01
0
        if ( manage_stock == 0 ){
            qtyStock = maxQty + 1;
        }
        if( minQty==''&&maxQty==''&&qtyStock=='' ){
            alert('Please, select item');
            return false;
        }
        if(eval(maxQty - qtyStock) < 0){
            temp = maxQty;
        }else{
            temp = qtyStock;
        }
        if(eval(temp - curQty) < 0){
            re = 0;
            if ( manage_stock == 0 ){
                alert('Please, enter quantity  Min:'+minQty+' and  Max:'+maxQty);
                return false;
            }
            alert('Please, enter quantity  Min:'+minQty+' and Max:'+maxQty+' (Inventory:'+qtyStock_1+')');
            return false;
        }
        if(eval(curQty - minQty) < 0){
            re = 0;
            if ( manage_stock == 0 ){
                alert('Please, enter quantity Min:'+minQty+' and Max:'+maxQty);
                return false;
            }               
            alert('Please, enter quantity Min:'+minQty+' and Max:'+maxQty+' (Inventory:'+qtyStock_1+')');
            return false;
        }
        if( $.session.get("session"+proId) != null && manage_stock == 1 ){
            cartQty = $.session.get("session"+proId);
            if(eval(maxQty - qtyStock) <= 0){
                temp = eval(maxQty-cartQty);
            }else{
                temp = eval(qtyStock-cartQty);
            }
            temp1 = eval(temp-curQty);
            if(temp1 < 0){
                re = 0;
                alert("Please, enter quantity Min:"+minQty+' and Max:'+maxQty+' (Inventory:'+qtyStock_1+')');
                return false;
            }
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.