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' ;) |
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 |
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? |
Quote:
A list i found interesting http://www.php-editors.com/smarty_manual/ |
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] |
bump
|
Re: common if/then modifications I make to x-cart...
I have a quick question in regards to #8
Quote:
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... } is there any way to shorten that {elseif . . .} up to include the whole range? TIA |
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. |
Re: common if/then modifications I make to x-cart...
Quote:
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. |
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.