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)
-   -   Display Membership Levels on all Pages (https://forum.x-cart.com/showthread.php?t=9883)

jprintz 10-17-2004 01:46 PM

Display Membership Levels on all Pages
 
I know this has been discussed in the past, however not all of the code worked for me.

I need to display the Membership Level immediately after Login. Even if the user returns to the very first page, the Membership Level needs to be displayed. If they are not a member, I would like it to show - "Membership Level: Not a Member".

I am currently using the following code in the Header.tpl:

{if $userinfo.membership ne ""}
Membership Level:
{$lng.lbl_your_membership}{$userinfo.membership}

{/if}

This only works after clicking the View Cart or Checkout links. If I return to the "Home" page, it disappears.

Any help would be much appreciated.

groovico 10-17-2004 05:23 PM

Open:

checkuseraccount.php


Look for the last closing } at the end of the first if ($login){ routine add

Code:

$usermembership=$user_account[membership];

and before the last ?>

add

Code:

## assign membership to smarty
$smarty->assign("usermembership",$usermembership);



You can now use {$usermembership} in your smarty templates.

jprintz 10-17-2004 06:07 PM

Thank you!

That worked perfectly!

I used the below code to:
1. Keep the Membership Level from showing when nobody is logged in
2. Show what Membership Level the user is when they login
3. Show "Not a Member" if they are not a member when they are login.

{if $usermembership ne ""}
Membership Level:
{$lng.lbl_your_membership}{$usermembership}

{else}
{if $login ne ""}
[b]Membership Level: Not a Member <//b>
{/if}
{/if}

qinwubi 07-19-2006 09:02 AM

implemented this code. works great.
 
Thank you, jprintz and groovico

weckie 07-27-2006 10:48 AM

Does anyone know how to do this in version 4.1.2. ??

SGS 04-13-2008 01:20 AM

Re: Display Membership Levels on all Pages
 
This is old but it is what I need. How can I make this owrk in a 4.1.9 cart?

There is no checkuseraccount.php file in a 4.1.9 cart. I am using pro so maybe it's some place else?

thanks

SGS 04-13-2008 02:52 AM

Re: Display Membership Levels on all Pages
 
ok, I found the solution.

the file is located in the include/check_useraccount.php.

sg

chiactivate 07-29-2008 01:34 AM

Re: Display Membership Levels on all Pages
 
I changed the file /customer/main/cart.tpl

{if $cart.coupon_discount eq 0 and $products ne "" and $membership_levels ne "Wholesale"}
<P>
{if $active_modules.Discount_Coupons ne "" }
{include file="modules/Discount_Coupons/add_coupon.tpl"}
{/if}

Coupon still shows up, no matter who is signed in.

PLEASE HELP!!!

Thanks

justy 08-12-2008 07:50 AM

Re: Display Membership Levels on all Pages
 
I think you're just missing an {else} and a closing {/if}:

{if $cart.coupon_discount eq 0 and $products ne "" and $membership_levels ne "Wholesale"}
{if $active_modules.Discount_Coupons ne "" }
{include file="modules/Discount_Coupons/add_coupon.tpl"}
{/if}
{else} # You need to provide an alternative if the conditions fail.
{/if}

chiactivate 08-17-2008 11:02 AM

Re: Display Membership Levels on all Pages
 
I've found it.

Quote:

In post #4, the question is asked if the coupon box can be hidden based on a membership level, then the poster raises a problem: "What if the customer enters the coupon before they log in?".
You can't hide the coupon box based on a membership level unless the user is logged in.


That's what membership is - the cart recognizes your membership level after it knows who you are.


You can easily hide the coupon box in 4.0.x with this code, so the logged in user can't take advantage of, both, wholesale prices and a discount coupon at the same time:


{if $active_modules.Discount_Coupons ne "" and $userinfo.membership ne "Wholesale"}
{include file="modules/Discount_Coupons/add_coupon.tpl"}
{/if}

thanks for all your advice


All times are GMT -8. The time now is 04:43 PM.

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