View Single Post
  #1  
Old 01-06-2009, 02:07 PM
 
fotodog13 fotodog13 is offline
 

Senior Member
  
Join Date: Sep 2007
Posts: 126
 

Default help with if then statment for detailed description

HI All,

I am trying to add an if then statement to a button I created that I have placed in the detailed description box.
I have the button working but I want to limit the pages that this button appears on.

This is what I have done.
I created a new .tpl called sizing_help.tpl that looks like this.

{if $c.order_by gt 4 and $c.order_by lt 41}
{/if}

<table cellspacing="0" cellpadding="0" onclick="javascript: self.location='http://1090495.nwinetworks.com/xcart/pages.php?pageid=1';" class="ButtonTable">
<tr><td><input type="image" src="{$ImagesDir}/but1.gif" class="ButtonSide_menu" alt="" /></td><td class="Button"><font class="Button">
Click Here For Help With Product Sizing</font>
</td><td><img src="{$ImagesDir}/but2.gif" class="ButtonSide_menu" alt="" /></td></tr></table>

I placed this in the buttons directory. The button works fine but I want to limit the pages that the button appears on so I thought the way to di that would be with a conditional statement -shown above in red- calling only the pages from 4 to 41

This did not work. The button still worked but it still appears on all the pages.

I have also tried

{if $c.order_by gt 4 and $c.order_by lt 41}
{include file="buttons/sizing_help.tpl"}
{/if}


and placed this in the customer/main/product.tpl thinking perhaps that the conditional statment needed to be there, but with no luck. I removed the conditional statement from the buttons/sizing_help.tpl when I did this.

In theory I would think that this idea should work but now not sure if I am approaching the problem the right way. I am hoping that the conditional statment just needs to be corrected and that someone can look at it and tell me what I need to do to get the button just to appear on the select pages.

If there is a better way to do this I am not wed to this idea it just seemed like a good solution so I am open to other suggestions.

As always any help here is greatly appreciated from any and all that can reply.


Thanks in advance
Best

Scott V
fotodog13
4.1.2 gold
4.1.8 pro
Apache
__________________
scott v
x cart version 4.1.8 (Unix)
Reply With Quote