Quote:
Originally Posted by Steele
I'd like to do something like this, but only for certain products. Is there a way to limit this to particular produtcs only? To show the quantity for some and for others to set it to default of 1?
Thanks.
|
QUANTITY ONLY FOR CERTAIN PRODUCTS IN PRODUCT DESCRIPTION ONLY!
If the product ID is 666 or 667 the quanity dropdown menu will not apear! Customize at will!
You got to put 2x {if} tags in the "product.tpl".
But watch out - i worked on version 3.5.2!
The 1st one:
Code:
{if $product.productid eq 666 or $product.productid eq 667}
{else}<td height=25 width=30%>{$lng.lbl_quantity}{if $product.min_amount gt 1}
<FONT class=ProductDetailsTitle>{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</td>
{/if}
And the 2nd one (with the default amount variable = 1 before the {if} tag):
Code:
<input type=hidden name=amount value=1>
{if $product.productid eq 83 or $product.productid eq 84}
{else}
<select name=amount>
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
{section name=quantity loop=$mq start=$start_quantity}
<option value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</option>
{/section}
</select>
{/if}
Quote:
Originally Posted by tron
anybody know how to remove quantity from product detailes.
Tron
|
To remove quantity from product details just comment out (HTML comment) or delete all the lines between the two {if} tags.
Hope i helped you guys out a bit!
Don't blame me for bad code - I'm a newbie to X-Cart.