Jump to content

Minimal Quantity Control On Product List


Recommended Posts

Hi again,

 

To add (input) quantity from product-list I use as follows in the new linked js file:

 

$(document).ready(function(){
 $(".ajax_add_to_cart_button").click(function(){
var f=$(this).attr('href');
var id = f.split('&')[1].split('=')[1];
var p="#quantity_wanted_"+id;
var qty=$(p).attr('value');
g=f+"&qty="+qty;
window.location=''+g;
return false;
 });
})

 

But when I change minimum order quantity for the item from 1 (disabled) to bigger quantity, the part with input box and add to cart button disappears.

 

The question to developers (so I do not have waste hours), how many and which exactly files control this behavior?

 

Or may be somebody already did the "checkMinimalQuantity" on product list?

 

Thanks

Link to comment
Share on other sites

By the way, may be it is not bad idea to have product details page OPTIONAL in the future core versions. And allow to sell products directly from product list with the same (or similar) functionality as on product details page. The less clicks - the better.

Link to comment
Share on other sites

Sorry tomerg3, i do not see minimal quantity on your demo.

 

------------------------------

 

By the way, to make it working on product list

 

just needed to change this part

 

           	 {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}

 

like this

 

           	 {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.customizable != 2 && !$PS_CATALOG_MODE}

 

It does not help to show warning and min. quantity on product list but at least it shows Error page with min. quantity and redirect back. Better than nothing for the moment.

Link to comment
Share on other sites

×
×
  • Create New...