Jump to content

How to set Default Quantity Wanted to 0


Recommended Posts

Hello,

 

I need to make the default quantity wanted set to 0. In the product list the deafult quantity is set to 1 but i want it 0 to know if a customer selected atributes or not. Thanks in advance, and sorry for my bad english

post-400872-0-39420600-1377166624_thumb.jpg

Link to comment
Share on other sites

Hello okaty!

 

I don't think there is a setting for this anywhere in the BackOffice. But you could accomplish what you want by editing the product.tpl file inside your theme folder:

 

...
		<!-- quantity wanted -->
		<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
			<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}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
		</p>
...

 

Change this line:

<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} />

 

To this:

<input type="text" name="qty" id="quantity_wanted" class="text" value="0" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />

 

 

Disclaimer: I HAVE NOT tested the above myself, but it is a trivial modification and should work...

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

Hello okaty!

 

I don't think there is a setting for this anywhere in the BackOffice. But you could accomplish what you want by editing the product.tpl file inside your theme folder:

 

...
		<!-- quantity wanted -->
		<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
			<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}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
		</p>
...

 

Change this line:

<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} />

 

To this:

<input type="text" name="qty" id="quantity_wanted" class="text" value="0" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />

 

 

Disclaimer: I HAVE NOT tested the above myself, but it is a trivial modification and should work...

 

Thank you, for the reply but sadly it doesn't work. The default quantity reamains 1.

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

×
×
  • Create New...