![]() |
Help me modify and if/else statement PLEASE
Could someone help me modify this chunk of code from product.tpl Please.
Code:
{if $product.forsale ne "B"} I want to incorporate this some how: Code:
{if $products[product].param00 eq ""} My goal is to replace the buy now button only on certain products with with a separate tpl I made (call.tpl) containing instructions to call and order. I got it to work in my products.tpl but I can't seem to get it right in the product.tpl Thanks for any help! |
Code:
{if $product.forsale ne "B"} |
Thanks for helping. It didn't quite do the trick though. With the change I get nothing on the screen where the product should be.
I'm posting the original full page code below and then I'll post it with the change, if that helps. The section in question starts about 2/3rds the way down. Thanks again Code:
{* $Id: product.tpl,v 1.78.2.4 2004/02/27 13:47:00 mclap Exp $ *} Code:
{* $Id: product.tpl,v 1.78.2.4 2004/02/27 13:47:00 mclap Exp $ *} |
fix...
Chris, I believe what you are trying to do is this:
{if $product.productid == 10 || $product.productid == 12 || $product.productid == 17} {include file="customer/main/NEW_buy_now.tpl" product=$products[product]} {else} {include file="customer/main/buy_now.tpl" product=$products[product]} {/if} Notice that all I'm doing is depending on the productid in the database, showing a different buy_now.tpl - you can create a new one of those calling the correct button. You can either lookup the productid in the database for the products in question, or look in the url string when you are on that product and you will see what the productid is...the code I have above is saying if the productid equals any of those values, show the code below it... I may not have the "inclue" for the buy_now button correct for your version of x-cart - check yours in 3.5.9 - but you get the idea - you just need to surround the button call with the code above. You can also do it with 2 separate {if} statements if the {else} screams at you for some reason... Lemme know if this helps :0) and cheers... |
All times are GMT -8. The time now is 02:04 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.