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
  #61  
Old 02-11-2008, 07:20 AM
 
typologist typologist is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 51
 

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

Please, i know this should be easy, but help! I want to show an image ONLY if customer is in SEARCH.PHP

{if $smarty.get.section eq "search.php"}SHOW THIS {/if}

Thanks!!
__________________
4.1.8 Gold (Unix)
Reply With Quote
  #62  
Old 02-11-2008, 07:23 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

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

{if $main eq "search"}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #63  
Old 03-12-2008, 09:21 AM
 
Italian Glassman Italian Glassman is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 92
 

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

What about an if/then function for the welcome page?
I want to have a JS code but only for the main page. Can anyone help me?
__________________
X-Cart version 4.1.8
(given up, for now, on 4.1.9 upgrade)
Reply With Quote
  #64  
Old 03-12-2008, 09:22 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

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

{if $main eq "catalog" and $current_category.category eq ""}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #65  
Old 03-12-2008, 10:03 AM
 
Italian Glassman Italian Glassman is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 92
 

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

Thank you Balinor -- worked great!
__________________
X-Cart version 4.1.8
(given up, for now, on 4.1.9 upgrade)
Reply With Quote
  #66  
Old 03-13-2008, 11:09 PM
 
chrisinoz chrisinoz is offline
 

eXpert
  
Join Date: Aug 2004
Location: Australia
Posts: 248
 

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

Hi

In a 4.017 cart of mine I used this to show content only to a CLUB member

{if $membershiplevel eq 'Seriously Gourmet CLUB'}
Text Here
{/if}



I am working on a 4.19 cart

The above does not work.

I think 4.19 now refers to id numbers so then I tried

{if $membershipid eq '2'}Text Here<br>{/if}

This did not work either.


Any ideas what I could be doing wrong?

Thanks
__________________
Chris G
Humble web designer
Version 4.07 - 4.45
Reply With Quote
  #67  
Old 03-23-2008, 02:30 PM
 
chrisinoz chrisinoz is offline
 

eXpert
  
Join Date: Aug 2004
Location: Australia
Posts: 248
 

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

This works for 4.019 for me - got tech help from xcart

You should use the following part of code for the 4.1.9 version of x-cart:

if ($user_account['membershipid'] == '2') {
<necessary code here>
}

in php scripts, but if you want the variable be accessible in smarty templates please follow the instructions below:

1. add the following part of code to the end of your '<x-cart root directory>/auth.php' file:

$smarty->assign("current_customer_membershipid", $user_account['membershipid']);

after the following strings:

$smarty->assign("printable", $printable);
$smarty->assign("logout_user", $logout_user);

2. then the following part of code can be used in templates:

{if $current_customer_membershipid eq '2'}
Text Here
{/if}

Cheers
Chris
__________________
Chris G
Humble web designer
Version 4.07 - 4.45
Reply With Quote
  #68  
Old 04-03-2008, 11:52 AM
 
Italian Glassman Italian Glassman is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 92
 

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

Would anyone know how to do this in the cart section:

If (subtotal is smaller than $75),
then (code here).

Mario
__________________
X-Cart version 4.1.8
(given up, for now, on 4.1.9 upgrade)
Reply With Quote
  #69  
Old 04-03-2008, 05:40 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

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

{if $cart.subtotal <75}
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #70  
Old 04-04-2008, 06:08 AM
 
Italian Glassman Italian Glassman is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 92
 

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

Thank you carpeperdiem!
__________________
X-Cart version 4.1.8
(given up, for now, on 4.1.9 upgrade)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 02:03 AM.

   

 
X-Cart forums © 2001-2020