| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
common if/then modifications I make to x-cart... | ||||
|
|
Thread Tools | Search this Thread |
#71
|
|||||||||
|
|||||||||
Re: common if/then modifications I make to x-cart...
Trying to do something (relatively?) simple, but I'm new to smarty so I need a bit of help.
I want to be able to change things in the category 1 products list (products.tpl) IF the product is also a member of a specific subcategory (3). {if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y" and $products[product].categoryid "3"} *things to change would go here* {/if} Maybe I need to do an extra AND to include category 1, or is there a .subcategoryid variable? Not really sure what to do here Use an array and check the second ID? |
|||||||||
#72
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
@rkdiddy,
From the xcart instructions you quoted: Quote:
|
|||||||
#73
|
|||||||||
|
|||||||||
Re: common if/then modifications I make to x-cart...
Thanks Hooter. You must have posted that right after I removed my post.
Thanks!
__________________
Stealth Cords - Discrete Power Cords for Automotive Enthusiasts www.stealthcords.com X-Cart version: 4.1.9 |
|||||||||
#74
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Quick question...
I know what these equal: {if $main eq "catalog" and $current_category.category eq ""} = home page {if $main eq "catalog" and $current_category.category ne ""} = any catalog page except the home page Does anyone know what the code is for "Any product page?" Thanks
__________________
X-Cart: Version 4.1.9 Apache: Version 1.3.39 (Unix) PHP: Version 5.2.4 |
|||||||
#75
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
{if $main eq "product"}
Have a look at customer/home-main.tpl and common_templates.tpl - they have a lot of the $main values.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#76
|
|||||||||
|
|||||||||
Re: common if/then modifications I make to x-cart...
I have one last task to do for a client and that is have different "Welcome" text depending whether customers are logged in or not.
I created a welcomenl.tpl (nl stands for not logged) and tried to call it in the home_main.tpl with: {if $login ne ' ' } {include file=customer/main/welcomenl.tpl} {/if} Doesn't work so I've tried to call a different text file based on the above {if $login ne ' ' } {inlcude file="$lng_txt_welcomenl} that nada also. Can anyone give me aheads up Thanks
__________________
XCart 4.5.4, 4.6.1, 4.64 stores Many, many mods from Altered Cart XCart Mods Reboot template The XCart Store Templates and Mods WCM CDSEO Pro BCSE Rewards Points and Gallery Mods and a few others |
|||||||||
#77
|
|||||||||
|
|||||||||
Re: common if/then modifications I make to x-cart...
This is how I would handle it:
Code:
so in your case: Code:
I believe it's simply the "" vs. the ' ' after the {if $login ne that's messing you up. HTH
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10 |
|||||||||
#78
|
|||||||||
|
|||||||||
Re: common if/then modifications I make to x-cart...
Thanks HWT,
you're on the money, I'm still not sure what the difference between "" & '' is to be honest. Following your example I added the code to home_main.tpl and it initially made no difference probably due to this being active by default: {elseif $main eq "catalog" and $current_category.category eq ""} {include file="customer/main/welcome.tpl" f_products=$f_products} So I added the code after the above, added the f_products etc to each, deleted {include file="customer/main/welcome.tpl" f_products=$f_products} and wallah it works, thanks for the heads up again HWT. Now can you tell me what the difference is between " " and ' '? Thanks
__________________
XCart 4.5.4, 4.6.1, 4.64 stores Many, many mods from Altered Cart XCart Mods Reboot template The XCart Store Templates and Mods WCM CDSEO Pro BCSE Rewards Points and Gallery Mods and a few others |
|||||||||
#79
|
|||||||||
|
|||||||||
Re: common if/then modifications I make to x-cart...
I forgot that that part was in home_main.tpl. Sorry about that.
Have you tried replacing Code:
with Code:
all I did was add in the condition of and $login ne"" to display one of the welcome messages, and left the condition out to display the other. Might work? For those that might refer to this later, the welcome.tpl should be displayed to logged in users, and the welcomenl.tpl should be displayed to any site visitor who is not logged in.
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10 |
|||||||||
#80
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Hey guys, what if I want to remove the header on ONLY one page? I tried something like {if $cat != 249} {include file="head_customer.tpl" } {/if} but it won't work. Maybe because it's in the customer/home.tpl?
Nevermind...I figured it out. I was able to add: {if $main eq "product" and $cat eq "294"} {else} {include file="head_customer.tpl" } {/if} And now the header loads on all the pages except category 294.
__________________
x-cart 4.2.2 |
|||||||
|
|||
X-Cart forums © 2001-2020
|