Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #41  
Old 11-30-2005, 12:26 PM
 
instinctual instinctual is offline
 

eXpert
  
Join Date: Nov 2003
Posts: 247
 

Default

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'
__________________
Instinctual
8,000 feet up in the Rocky Mountains of Colorado
X-Cart Versions 3.5.x - 4.0.x

IF you xcart, THEN you prosper, ELSE you fail. ELSEIF xcart fails, THEN you fix it, all the WHILE {loop}\'ing {section}\'s to feed your $smarty mind.
Reply With Quote
  #42  
Old 12-01-2005, 06:48 AM
 
danbass danbass is offline
 

Member
  
Join Date: Mar 2005
Posts: 13
 

Default

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
__________________
Dan
XCart 4.1.6 Pro
XCart 4.1.6 Gold
Redhat 7.2
Perl 5.006001
PHP 4.1.2
Reply With Quote
  #43  
Old 01-11-2006, 09:11 PM
 
Circle3 Circle3 is offline
 

Member
  
Join Date: Aug 2004
Location: Tucson, AZ
Posts: 17
 

Default

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?
__________________
Clients using X-Cart 4.0.14
Reply With Quote
  #44  
Old 07-07-2006, 01:27 AM
 
Anonymous999 Anonymous999 is offline
 

Member
  
Join Date: Jul 2006
Posts: 28
 

Default

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/
__________________
  • PHP 5.04
  • MySql 4.1.18
  • X-Cart 4.1.2
  • X-Cart Special Offers
  • X-Cart AOM
  • Mod - Price Match
  • Mod - FAQ Manager
  • Mod - Tabbed Buttons
  • Mod - Vertical Flyout Menu
Reply With Quote
  #45  
Old 08-12-2006, 01:59 PM
 
ecommerce ecommerce is offline
 

eXpert
  
Join Date: Jul 2006
Posts: 267
 

Default

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]
__________________
X-Cart 4.0.18 DBest
Reply With Quote
  #46  
Old 08-15-2006, 07:17 PM
 
ecommerce ecommerce is offline
 

eXpert
  
Join Date: Jul 2006
Posts: 267
 

Default

bump
__________________
X-Cart 4.0.18 DBest
Reply With Quote
  #47  
Old 04-10-2007, 09:03 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default 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
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #48  
Old 04-11-2007, 05:21 AM
  BizzyB's Avatar 
BizzyB BizzyB is offline
 

Senior Member
  
Join Date: Sep 2006
Location: Australia
Posts: 102
 

Default 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.
__________________
Version = X-Cart 4.1.3 Gold
Status - Closed
Addon: Magnifier
OS = Windows
Western Australia
Reply With Quote
  #49  
Old 04-11-2007, 05:37 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default 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 ) smarty code editor.
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #50  
Old 04-11-2007, 06:30 PM
  BizzyB's Avatar 
BizzyB BizzyB is offline
 

Senior Member
  
Join Date: Sep 2006
Location: Australia
Posts: 102
 

Default 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
__________________
Version = X-Cart 4.1.3 Gold
Status - Closed
Addon: Magnifier
OS = Windows
Western Australia
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:18 PM.

   

 
X-Cart forums © 2001-2020