Jump to content

[SOLVED] Remove Quantity Option On Product Page


clif

Recommended Posts

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

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

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>
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

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.

 

post-370865-0-69312300-1407176664_thumb.png

Edited by sinaus (see edit history)
Link to comment
Share on other sites

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

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

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

  • 4 weeks later...
  • 3 months later...
×
×
  • Create New...