| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
help with if then statment for detailed description | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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) |
|||||||
#2
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
Print this to the page to see if it the c.order_by variable holds a value (which I suspect it doesn't):
Code:
|
|||||||||
#3
|
|||||||
|
|||||||
Re: help with if then statment for detailed description
Hi Jon,
Thanks for the reply. I pasted the code you provided above mine ( shown in red above) into the product.tpl. then checked the page. It returned the does not exsist message on the page so I would think that you are correct that the c variable is not being recognized. Is there away to write the statement so that the variable is recognized here and allows for the button to appear only on the pertinent pages? Thanks again I really appreciate the help Best Scott V
__________________
scott v x cart version 4.1.8 (Unix) |
|||||||
#4
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
Can you provide a page url where you want this button to appear?
|
|||||||||
#5
|
|||||||
|
|||||||
Re: help with if then statment for detailed description
HI Jon,
Thanks for the reply. Here is the url for the page where the button should appear. http://1090495.nwinetworks.com/xcart/product.php?productid=33&cat=15&page=1 You can see the does not exist message is there. * This page is on a closed test server. I think you should be ale to get on with the URL I have posted above but if it you get asked to log in let me know and I will private message you the password info Thanks for looking at this Scott
__________________
scott v x cart version 4.1.8 (Unix) |
|||||||
#6
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
It's asking me to login, but by default you can't use category order_by variables on a product details page.
|
|||||||||
#7
|
|||||||
|
|||||||
Re: help with if then statment for detailed description
Hi Jon,
I thought that might be the problem. DO you know If I was to take the button out of the detailed description box and put it up near the breadcrumbs could I call the category pages from there? That button does not necessarily need to be in the detailed description box but I only want the button to come up on pages where sizing information is something the user might need to access. Understand what I am saying. Let me what you think Thanks Scott
__________________
scott v x cart version 4.1.8 (Unix) |
|||||||
#8
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
No where on the page can you access the category variables, you can query them from product.php and assign to smarty.
|
|||||||||
#9
|
|||||||
|
|||||||
Re: help with if then statment for detailed description
Hi Jon,
Thanks again. I think I understand what you are saying but not sure how to write it. would it look like this? $smarty->assign {if $c.order_by gt 4 and $c.order_by lt 41} {include file="buttons/sizing_help.tpl"} {/if};
__________________
scott v x cart version 4.1.8 (Unix) |
|||||||
#10
|
|||||||||
|
|||||||||
Re: help with if then statment for detailed description
Hi scott ,
Can you explain the condition for the button to display in word.I understand that you want to display that button only to products in certain categories .Am i right if not pls give me your explanation as to based on what condition you want the button to be displayed
__________________
MercuryMinds Technologies Development Team, Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com X-Cart Mailchimp Ecommerce 360 Plugin/integration module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) Smasher, a smart search engine for x-cart store (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) One Page Checkout (OPC) - X-Cart module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) |
|||||||||
|
|||
X-Cart forums © 2001-2020
|