![]() |
Custom If Then statement?
Can anyone write a " If then " statement that will do the following:
If category=candles then price=not shown The reason for this is, I only want the price shown in the product options drop down menu beside of the different attributes. This way the customer doesn't see a price until they view the different attributes in the drop down. For example: Warm Apple Pie Candle Choose Size: [Dropdown] 26 oz Jar $20.99 16 oz Jar 16.99 Votive $1.50 Tart $100 Tea Lights $8.99 Quantity [Dropdown] Add to cart [GO] Please help, thanks. Jay :wink: |
Go to your product.tpl and look for the code that reads
Code:
{if $product.price ne 0} Comment out the else part (like this) Code:
{if $product.price ne 0} Then just set the price of that item to $0.00 |
You are right, I can just comment out the price. However, I have more than just those candles on my site. There are addtional individual products like candle accessories, gift baskets and more. Thats why I need the if then statement for I only what the candles category's prices to not show up.
Jay |
Maybe something like this?
Code:
I didn't look at the xcart code too closely, but IIRC, category is in the product array. Walt |
The way I have the code will cause two differnet messages to show up if the
Code:
{if $product.price ne 0 } Code:
{if $product.price ne 1 } So can anyone fix the following code so that the two differnet messages will show if one price=0 and the other price=1? Code:
{if $product.price ne 0 } Thanks |
I solved it
Thanks to everyone who has viewed this post, I took it to the next step and now have solved by problem.
The code should be: Code:
{if $product.price ne 0} Once I get the site up and going you will have to see this cool mod. Keep an eye out for it. Jay |
All times are GMT -8. The time now is 01:50 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.