![]() |
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. |
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 You can now use {$usermembership} in your smarty templates. |
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} |
implemented this code. works great.
Thank you, jprintz and groovico
|
Does anyone know how to do this in version 4.1.2. ??
|
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 |
Re: Display Membership Levels on all Pages
ok, I found the solution.
the file is located in the include/check_useraccount.php. sg |
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 |
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} |
Re: Display Membership Levels on all Pages
I've found it.
Quote:
{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.