clif Posted June 29, 2014 Share Posted June 29, 2014 Hi I was wondering if anyone knows how to remove the quantity option for the product on the product page. I only sell downloadable video clips so the quantity is totally irrelevant and I would like to remove it. thanks for any help. Clif Link to comment Share on other sites More sharing options...
Whispar1 Posted June 29, 2014 Share Posted June 29, 2014 Yes. preferences > products > display available quantities switch to no Link to comment Share on other sites More sharing options...
clif Posted June 29, 2014 Author Share Posted June 29, 2014 Thanks but for some reason it is a grey color and will not let me change it. Link to comment Share on other sites More sharing options...
vekia Posted June 30, 2014 Share Posted June 30, 2014 it's because (i suppose so) you probably run shop under multistore and you probably forget to select shop. Link to comment Share on other sites More sharing options...
clif Posted June 30, 2014 Author Share Posted June 30, 2014 Thanks for the reply but no the multistore is not enabled and download is selected as main activity. Any other way to remove quantity? Thanks Link to comment Share on other sites More sharing options...
vekia Posted June 30, 2014 Share Posted June 30, 2014 i think that i missed something important. you just want to hide quantity filed on product page, that's right? Link to comment Share on other sites More sharing options...
clif Posted June 30, 2014 Author Share Posted June 30, 2014 Yes that is correct. Thanks Link to comment Share on other sites More sharing options...
vekia Posted July 1, 2014 Share Posted July 1, 2014 okay so the problem is easy to solve. in fact, we can't remove this filed (quantity field is necessary) but we can disable it with html features open product.tpl file located in your theme directory there is a code: <label>{l s='Quantity:'}</label> <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}" /> replace it with: <input type="hidden" 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}" /> Link to comment Share on other sites More sharing options...
clif Posted July 1, 2014 Author Share Posted July 1, 2014 That did partially work it removed the box but not the word quantity and the plus and minus sign attached is a screenshot. Thanks Link to comment Share on other sites More sharing options...
vekia Posted July 2, 2014 Share Posted July 2, 2014 i suggested to replace also <label>{l s='Quantity:'}</label> then label will disappear and regarding to [+][-] buttons, remove also code: <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-plus product_quantity_up "> <span><i class="icon-plus"></i></span> </a> <span class="clearfix"></span> 1 Link to comment Share on other sites More sharing options...
clif Posted July 2, 2014 Author Share Posted July 2, 2014 Yes that worked!! Thank you! Link to comment Share on other sites More sharing options...
vekia Posted July 3, 2014 Share Posted July 3, 2014 you're welcome :-) i can confirm, i also tested it on my own demo installation of prestashop 1.6.0.8 it works like a charm :-) i marked topic title as solved with regards, Milos Link to comment Share on other sites More sharing options...
sinaus Posted August 4, 2014 Share Posted August 4, 2014 (edited) Hi Vekia, thanks very much for the solution but there is still a problem that I discovered. Even though the - and + quantity been removed from the product page but once customer goes to their cart, the ability to - and + still around. Any help will be greatly appreciated. Thanks in advance. Edited August 4, 2014 by sinaus (see edit history) Link to comment Share on other sites More sharing options...
Naldinho Posted August 4, 2014 Share Posted August 4, 2014 To get the + - to not appear there you need to edit a different .tpl file. I plan to do this to a store but haven't reached that stage yet. A quick look makes me think it is order-detail.tpl around line 209-213 but I haven't tried this yet so don't quote me. Link to comment Share on other sites More sharing options...
sinaus Posted August 8, 2014 Share Posted August 8, 2014 Thanks for your help Naldinho. I tried to comment out those lines but didn't work. Anyway I am no programmer so I better see anyone can help me where I am suppose to comment out and plus. Thanks very much though. Link to comment Share on other sites More sharing options...
vekia Posted August 8, 2014 Share Posted August 8, 2014 cart page is totally not related to product page so it's necessary to alter other file, in this case - shopping-cart-product-line.tpl there is a code like: <div class="cart_quantity_button clearfix"> {if $product.minimal_quantity < ($product.cart_quantity-$quantityDisplayed) OR $product.minimal_quantity <= 1} <a rel="nofollow" class="cart_quantity_down btn btn-default button-minus" id="cart_quantity_down_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&op=down&token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Subtract'}"> <span><i class="icon-minus"></i></span> </a> {else} <a class="cart_quantity_down btn btn-default button-minus disabled" href="#" id="cart_quantity_down_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" title="{l s='You must purchase a minimum of %d of this product.' sprintf=$product.minimal_quantity}"> <span><i class="icon-minus"></i></span> </a> {/if} <a rel="nofollow" class="cart_quantity_up btn btn-default button-plus" id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Add'}"><span><i class="icon-plus"></i></span></a> </div> Link to comment Share on other sites More sharing options...
sinaus Posted August 8, 2014 Share Posted August 8, 2014 Vekia, thanks very very much. It worked. I am so thankful we have guys lilke you in this fourm. Cheers and have a great day mate. Link to comment Share on other sites More sharing options...
CarriedAwayCrafts Posted September 3, 2014 Share Posted September 3, 2014 Thank you for these solutions, very helpful. But how do you remove the box that the quantity field was in on product page? See attached image. Link to comment Share on other sites More sharing options...
kingdompaul Posted December 4, 2014 Share Posted December 4, 2014 Hello Vekia, I followed everything you said. The + and _ buttons still not going off. Any other thing i can do? please help Thanks Link to comment Share on other sites More sharing options...
Recommended Posts