| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Smarty Syntax {elseif} - help needed | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Smarty Syntax {elseif} - help needed
Hi guys
Hows it going? I am having some problems getting some smarty syntax to work and was wondering if anyone has used something similar. Here is what I have Code:
When I use this code - CONTENT 'A' and 'C' work fine - but content 'B' is ignored. I pulled this of the smarty template site and the only difference I can see is that they use the $name throughout whereas I use $cat and $productid. If this is the problem, has anyone got any ideas on how to get around this? Code:
Cheers Tye
__________________
Today is a beautiful day, grab it while you can and live it to the full Version 4.2.3 UNIX |
|||||||
#2
|
|||||||||
|
|||||||||
Where's your
{/if} in your code? Also, have you tried printing out $productid to see that a value exists for it? I find doing a simple variable print out in smarty and/or php can sometimes be the quickest way to debug something that's not working as you expect it to. HTH! Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002! We support X-cart versions 3.x through 5.x! Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more! Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com Please E-Mail us for questions/support! |
|||||||||
#3
|
|||||||
|
|||||||
Hi Carrie
thanks for taking time to reply. My {/if} is there - I just forgot to post it My product is also there, I think... I am not sure what you mean when you say Print the variable... is that like Code:
This product is displaying in the store if this helps.
__________________
Today is a beautiful day, grab it while you can and live it to the full Version 4.2.3 UNIX |
|||||||
#4
|
|||||||||
|
|||||||||
Quote:
thats php not smarty to show a variable use {$productid} etc also make sure that {$productid} is a valid variable first
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#5
|
|||||||
|
|||||||
Thanks Shan
Its late here, I'm tired - I'll have another look tomorrow. Cheers
__________________
Today is a beautiful day, grab it while you can and live it to the full Version 4.2.3 UNIX |
|||||||
#6
|
|||||||||
|
|||||||||
I'm guessing it may be more like
{$product.productid} to print the variable out (and to use it) unless you've changed something in the php code assuming you're doing this in skin1/customer/main/product.tpl So if {$productid} doesn't print anything to the screen, then try {$product.productid} If that doesn't work, let us know what tpl this code is for and maybe that will help. Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002! We support X-cart versions 3.x through 5.x! Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more! Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com Please E-Mail us for questions/support! |
|||||||||
#7
|
|||||||
|
|||||||
I love you, I love you all
Thanks Carrie and Shan. It was late last night and I was getting mixed up with smarty and php My correct code should have been Code:
Thanks again Tye
__________________
Today is a beautiful day, grab it while you can and live it to the full Version 4.2.3 UNIX |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|