Jump to content

Change quantity based on current product category


Recommended Posts

Hello!

 

I need to change the quantity from 1, to 2 in some of our categories.

 

We have a huge amount of attributes (over 500 combination on each product) so we can't use the built in function.

 

This is what I am trying to do:

 

{if $smarty.get.id_category == 5 OR $product->id_category_default == 5}

<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}2{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />

{else}

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

{/if}

 

 

But Smarty does not seem to recognize the following string values?!

 

{if $smarty.get.id_category == 5 OR $product->id_category_default == 5}

 

(Nothing happens)

 

When adding {php} {/php} around the line {if $smarty.get.id_category == 5 OR $product->id_category_default == 5}, I do not know how to echo the original form input html code?

 

Anyone have a solution to this?

It would have been extremly much appriciated =)

Huge thanks in advance...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...