X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   common if/then modifications I make to x-cart... (https://forum.x-cart.com/showthread.php?t=8881)

instinctual 11-30-2005 12:26 PM

Dan - can't you accomplish that by simply specifying that certain categories are available to only certain membership levels in the backend? In that manner, if you're registered as a membership level, you'll see those categories and products, and if you're not, you'll only see products in categories that are specified for "all".

Lemme know - not exactly clear on what yer doin' ;)

danbass 12-01-2005 06:48 AM

Ideally what I would like is when people first come to the site and are not registered or logged in to see the Retail group items. After they log in then they would see either the retail group or wholesale group depending on their membership level. All I see available right now for unregistered members is the "All" group. Unless I am missing this setting somewhere. The problem with the "All" group is that it appears to the Wholesale group when they are logged in and I don't want the items in that group available when Wholesale group members are shopping. Is this possible?
Thanks

Circle3 01-11-2006 09:11 PM

Ok, this has been a helpful thread and it demonstrates some good examples in using IF statements in smarty.

What I don't understand is how to find out about all of the variables that I have at my disposal with smarty?

Is there a list somewhere?

Anonymous999 07-07-2006 01:27 AM

Quote:

Originally Posted by Circle3
Ok, this has been a helpful thread and it demonstrates some good examples in using IF statements in smarty.

What I don't understand is how to find out about all of the variables that I have at my disposal with smarty?

Is there a list somewhere?


A list i found interesting

http://www.php-editors.com/smarty_manual/

ecommerce 08-12-2006 01:59 PM

In the customer proile page/registration page,


Have the label and field box for COUNTY invisble (not part of the form), but

{IF } billing STATE is CALIFORNIA,

then

show the label and field box. (they appear like magic).

I have tried editing with if statements the register_billing.tpl

county.tpl

and state.tpl


I've been unsuccessful.

I have a feeling it can be done.


[/img]

ecommerce 08-15-2006 07:17 PM

bump

HWT 04-10-2007 09:03 AM

Re: common if/then modifications I make to x-cart...
 
I have a quick question in regards to #8

Quote:

Originally Posted by instinctual
8. Similar to the above - what about if you want to show something specific to the category you're on? Well, similar situation:


Code:
{if $cat eq "9"}show this{/if}



Can this be set to a range of categories instead of one specific category?

example:

I want categories 250 - 290 to use a different subcategories.tpl

in customer/home_main.tpl I have:

Code:

{elseif $cat eq "250" or $cat eq "251" or $cat eq "252" or $cat eq "253" or $cat eq "254" or $cat eq "255" etc...  }
{include file="customer/main/subcategories_2.tpl" cat=$cat}


is there any way to shorten that {elseif . . .} up to include the whole range?

TIA

BizzyB 04-11-2007 05:21 AM

Re: common if/then modifications I make to x-cart...
 
I don't know smarty at all but.....

{elseif $cat > "249" and $cat < "291"}

would may do want you want rather than {elseif $cat eq "250" or $cat eq "251" or $cat eq "252" or $cat eq "253" etc etc etc

Where '>' represents 'gt' (greater than) and '<' represents 'lt' or (less than). Whatever is the correct syntax for smarty.

Just a thought.

HWT 04-11-2007 05:37 AM

Re: common if/then modifications I make to x-cart...
 
Quote:

Originally Posted by BizzyB
{elseif $cat > "249" and $cat < "291"}


Worked perfectly. Thank you for the great explanation. That really helps with my thought process that I can apply in other circumstances. Lack of experience with some of the simpler ideas is the problem with being a self taught (or forum taught :wink: ) smarty code editor.

BizzyB 04-11-2007 06:30 PM

Re: common if/then modifications I make to x-cart...
 
Your very welcome.

As I said I don't know smarty, but if that code worked for you it is is worth bearing in mind that if it is part of a more complex if/then or elseif/then coding it is always a good idea to isolate that type of expression by enclosing it in brackets.

By that I mean your argument would look more like:-
{elseif ($cat > "249" and $cat < "291") [more code here]}

For example :-
{elseif ($cat > "249" and $cat < "291") or ($cat >= "300" and $cat <= "340") }

Cheers


All times are GMT -8. The time now is 11:59 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.