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)

typologist 02-11-2008 07:20 AM

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!!

balinor 02-11-2008 07:23 AM

Re: common if/then modifications I make to x-cart...
 
{if $main eq "search"}

Italian Glassman 03-12-2008 09:21 AM

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?

balinor 03-12-2008 09:22 AM

Re: common if/then modifications I make to x-cart...
 
{if $main eq "catalog" and $current_category.category eq ""}

Italian Glassman 03-12-2008 10:03 AM

Re: common if/then modifications I make to x-cart...
 
Thank you Balinor -- worked great!

chrisinoz 03-13-2008 11:09 PM

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

chrisinoz 03-23-2008 02:30 PM

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

Italian Glassman 04-03-2008 11:52 AM

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

carpeperdiem 04-03-2008 05:40 PM

Re: common if/then modifications I make to x-cart...
 
{if $cart.subtotal <75}

Italian Glassman 04-04-2008 06:08 AM

Re: common if/then modifications I make to x-cart...
 
Thank you carpeperdiem!


All times are GMT -8. The time now is 05:04 AM.

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