david the developer Posted May 25, 2014 Share Posted May 25, 2014 prestashop 1.5.4 Problem When you change minimum quantity to anything above 1, the add to cart icon in the home page disappear. I want to keep it any help please Link to comment Share on other sites More sharing options...
vekia Posted May 25, 2014 Share Posted May 25, 2014 , the add to cart icon in the home page disappear about what feature you're talking about? some module? everywhere? Link to comment Share on other sites More sharing options...
david the developer Posted May 25, 2014 Author Share Posted May 25, 2014 in home page you have a list of products and there is add to cart button below each product. Now when you go to the product backoffice and change the minimum quantity required to any value above 1. you will have two changes first the follwog message will appear in the product page. careful in the product page 'This product is not sold individually. You must select at least' but then the add to cart button in the home page will disappear! how to make it stay regardless of the minimum quantity? Sincerely, Link to comment Share on other sites More sharing options...
david the developer Posted May 26, 2014 Author Share Posted May 26, 2014 this is very important for my business any help. the add to cart button disappear from the home page and category page once i change the minimum quantity? any suggestion? Link to comment Share on other sites More sharing options...
NemoPS Posted May 26, 2014 Share Posted May 26, 2014 Of course, it disappears because by default you can only add 1 item to the cart from the homepage (I assume you mean the featured products block). If you want it anyway, you have to amend homefeatured.tpl (/modules/homefeatured), look for and remove AND $product.minimal_quantity == 1 Link to comment Share on other sites More sharing options...
david the developer Posted May 26, 2014 Author Share Posted May 26, 2014 (edited) thanks now it appears back but now it gave a message "you must add ** quantity of this product" which mean that customer will have to go to the product page and press the add to cart button from there any suggestions to bypass this and push to the cart right away?? Edited May 26, 2014 by david the developer (see edit history) Link to comment Share on other sites More sharing options...
david the developer Posted May 28, 2014 Author Share Posted May 28, 2014 So I sell things by the Kilo (weight). but the items may be 15 or 16 Kilos each for example Banana $0.49/kilo but the case is 7 Kilos so i had this problem in home page and in the category pages you have a list of products and there is add to cart button below each product. Now when you go to the product backoffice and change the minimum quantity required to any value above 1. in the case of banana it is 7 kilos you will have two changes first the following message will appear in the product page. careful in the product page 'This product is not sold individually. You must select at least 7 items' but then the add to cart button in the home page and in the category page will disappear! I followed Nemo1 advice in the homefeatured.tpl (/modules/homefeatured), I removed AND $product.minimal_quantity == 1 the add to cart buttom appeared but is not functioning if you push it it will give a messege "you must add 7 items of this product" then customer will have to go to product page where the minimum quanitity is already set to 7 any idea to make the add to cart button works from the home page and the category page Link to comment Share on other sites More sharing options...
csschopper.com Posted May 28, 2014 Share Posted May 28, 2014 HI David, Did you tried this http://mypresta.eu/en/art/developer/prestashop-quantity-field-featured-products-module.html? You can make input box hidden by setting minimum quantity in this. Thanks Alok Link to comment Share on other sites More sharing options...
csschopper.com Posted May 28, 2014 Share Posted May 28, 2014 Hi David, You can use above link tutorial, using this Qty textbox will apprar on home page. Now you can set value = {$product.minimal_quantity} in textbox & make it's imput type = hidden. This will resolve your problem. If you are still facing any issue let me know. Thanks Alok Link to comment Share on other sites More sharing options...
NemoPS Posted May 28, 2014 Share Posted May 28, 2014 If it's mandatory to add at least 7 items, quite obviously you won't be able to add one You can use the hidden input trick for that Link to comment Share on other sites More sharing options...
david the developer Posted May 28, 2014 Author Share Posted May 28, 2014 If it's mandatory to add at least 7 items, quite obviously you won't be able to add one You can use the hidden input trick for that No. because you can do this no problem from the product page. I will try the hidden input trick Link to comment Share on other sites More sharing options...
NemoPS Posted May 29, 2014 Share Posted May 29, 2014 Yes, what I mean is that, by default, 1 product (quantity = 1) is added from the product list. As you cannot do it, because you need at least 7, you need to specify 7 as quantity to purchase in the product list too Link to comment Share on other sites More sharing options...
csschopper.com Posted May 29, 2014 Share Posted May 29, 2014 Hi David, Did your problem get resolved. Please suggest so that other people can use this trick. Thanks Alok Link to comment Share on other sites More sharing options...
david the developer Posted May 30, 2014 Author Share Posted May 30, 2014 Hi David, Did your problem get resolved. Please suggest so that other people can use this trick. Thanks Alok Thanks Alok No the code that I have is the following AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE} {if ($product.quantity > 0 OR $product.allow_oosp)} <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add"><i class="icon-shopping-cart"></i></a> {else} <span class="exclusive"><i class="icon-shopping-cart"></i>{l s='Add to cart' mod='addhomefeatured'}</span> {/if} </div> any change distort the whole thing. I am not sure how to proceed Link to comment Share on other sites More sharing options...
NemoPS Posted May 30, 2014 Share Posted May 30, 2014 try this <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=7&id_product={$product.id_product}&token={$static_token}&add"> Qty says 7, as you can see, but I can't recall if this works with ajax cart as well Link to comment Share on other sites More sharing options...
david the developer Posted May 30, 2014 Author Share Posted May 30, 2014 (edited) did not work either. i think the best way is to add a quantity box but then make it invisible. howver, using the link of the tutorial did not work i wonder how to mix this code {if ($product.quantity > 0 OR $product.allow_oosp)} <div style="display:block; clear:both; margin-top:10px; position:relative; padding:5px; background:#eee; overflow:hidden;"> <input style="position:absolute; top:7px; left:7px; padding: 0 3px; text-align:center; height: 20px; border: 1px solid #ccc; display:inline-block; float:left; width:22px;" type="text" name="quantity_to_cart_{$product.id_product|intval}" id="quantity_to_cart_{$product.id_product|intval}" value="1"/> <a style="width:60px; display:inline-block; float:right" class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a> </div> {else} with my code AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE} {if ($product.quantity > 0 OR $product.allow_oosp)} <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add"><i class="icon-shopping-cart"></i></a> {else} <span class="exclusive"><i class="icon-shopping-cart"></i>{l s='Add to cart' mod='addhomefeatured'}</span> {/if} </div> and make the quanitity box invisible Edited May 30, 2014 by david the developer (see edit history) Link to comment Share on other sites More sharing options...
david the developer Posted May 30, 2014 Author Share Posted May 30, 2014 Hi David, Did your problem get resolved. Please suggest so that other people can use this trick. Thanks Alok i put this code and followed all other modifications in the link still no help <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> any suggestions friends Link to comment Share on other sites More sharing options...
david the developer Posted May 30, 2014 Author Share Posted May 30, 2014 do i need to assign any smarty in the php file? any help! Link to comment Share on other sites More sharing options...
NemoPS Posted May 31, 2014 Share Posted May 31, 2014 A quantityu box would not work without some js, because the button you use to add to cart is a link. Again, my question: do you want to use ajax search? Try this one as well http://blog.arvixe.com/adding-multiple-products-and-quantities-to-prestashops-cart/ Link to comment Share on other sites More sharing options...
david the developer Posted May 31, 2014 Author Share Posted May 31, 2014 What i meant is the following. If you go to back office and specified a quantity of lets say 12 or 6 or whatever value for a product. when you go to the product page you will find this quantity in the box all what you need is to push the add to cart button. That’s all Now why I can not have this feature in the home page and in the category page. I can then leave the qty box or have it hidden. The links provided did not work. Any suggestions? Link to comment Share on other sites More sharing options...
david the developer Posted June 2, 2014 Author Share Posted June 2, 2014 (edited) Hi David, Did your problem get resolved. Please suggest so that other people can use this trick. Thanks Alok I looked over 800 prestashop templates not a single one of them had a quantity box in the home page or the product page. They all have that box in the product page. Any help with a code to work that out. I tried every single thing including copying the codes from the product tpl and css and php files nothing worked! any help please my business is all selling by weight! Edited June 2, 2014 by david the developer (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts