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)
-   -   How to change welcome message based on membership? (https://forum.x-cart.com/showthread.php?t=66131)

chiactivate 02-14-2013 05:42 PM

[WORKING] Change welcome message based on membership
 
I like to change the welcome message.

If membership is still pending show the welcome message A:

" your account is not activated it, please call 888-xxxx to activate your account"

If member is active show the welcome message B:

"Welcome back"

I assume that I should change this file:

File: /2-columns/customer/main/welcome.tpl

But how can I make the if else statement?

cherie 02-15-2013 04:35 PM

Re: How to change welcome message based on membership?
 
Look for $userinfo.membershipid or $userinfo.pending_membershipid. It's possible membership info is still not visible without adding it to include/check_useraccount.php:

http://forum.x-cart.com/showthread.php?t=12511&page=2

chiactivate 02-15-2013 06:21 PM

Re: How to change welcome message based on membership?
 
so I have to add the following code in file

include/check_useraccount.php

$smarty->assign("user_membership",$user_account['membership']);

But where? before or after which code

cherie 02-16-2013 12:50 AM

Re: How to change welcome message based on membership?
 
You are actually looking for $user_account['membershipid'] and you can add it anywhere at the end with the other similar lines.

chiactivate 02-18-2013 03:58 PM

Re: How to change welcome message based on membership?
 
Hi Cherie, thanks for your help, but looks like I'm doing something wrong.

Step 1:. In file include/check_useraccount.php

I added at the the end of the source code

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

Step 2:

In file 2-columns/customer/main/welcome.tpl

I added the code

{if $user_account.membershipid eq 6}

<p> MESSAGE A </p>
{else}
<p>MESSAGE B </p>
{/if}


Still not working, it's always showing message A, no matter the it's pending membership or not.

Sorry to bother you, but I'm struggling with the smarty codes.

Thanks a lot for your help

cherie 02-18-2013 10:46 PM

Re: How to change welcome message based on membership?
 
You've assigned it to user_membershipid so you'll need to check for that:

PHP Code:

{if $user_membershipid eq 6}
... 


chiactivate 02-19-2013 09:52 AM

Re: How to change welcome message based on membership?
 
it's working!!! Thanks a lot Cherie.

So here is the complete solution.
Show message A if user member is still pending
Show message B or nothing if membership is activated


Step 1:. In file include/check_useraccount.php

I added at the the end of the source code:

Quote:

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


Step 2:

In file 2-columns/customer/main/welcome.tpl

Add the code

Quote:


{if $user_membershipid eq 6} eq 0}

<p> MESSAGE A </p>
{else}
<p>MESSAGE B </p>
{/if}


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

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