Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Display Membership Levels on all Pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-17-2004, 01:46 PM
 
jprintz jprintz is offline
 

Newbie
  
Join Date: Oct 2004
Posts: 2
 

Default 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.
Reply With Quote
  #2  
Old 10-17-2004, 05:23 PM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default

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.
__________________
Groovico

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

http://www.firetanksoftware.com

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
  #3  
Old 10-17-2004, 06:07 PM
 
jprintz jprintz is offline
 

Newbie
  
Join Date: Oct 2004
Posts: 2
 

Default

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}
Reply With Quote
  #4  
Old 07-19-2006, 09:02 AM
 
qinwubi qinwubi is offline
 

Member
  
Join Date: Jul 2006
Posts: 16
 

Default implemented this code. works great.

Thank you, jprintz and groovico
__________________
all the best,
Wubi
:::::::::
xcart gold v4.3.2 with lots of customizations
Linux
Php 5.2.4
MySQL: 4.1.22-standard
Reply With Quote
  #5  
Old 07-27-2006, 10:48 AM
 
weckie weckie is offline
 

eXpert
  
Join Date: Feb 2005
Location: Netherlands
Posts: 220
 

Default

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

Using: X-cart 4.5.4
AT: http://www.weckonline.com LIVE
Reply With Quote
  #6  
Old 04-13-2008, 01:20 AM
 
SGS SGS is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 99
 

Default 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
__________________
Currently Using:

For X-cart v5.2.0
1 Business v5.2.6 license <Getting Better>!
1 Banner Mod 5.2.7 license
1 #28 iGoods Template

For X-cart v4.7.0

1 GoldPlus v4 license unused

3 Gold v4 license Unused

A wise man once said it is best to fix the cart instead of trying to use a broken cart. The horse has a very hard time pushing a broken cart!!
Reply With Quote
  #7  
Old 04-13-2008, 02:52 AM
 
SGS SGS is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 99
 

Default Re: Display Membership Levels on all Pages

ok, I found the solution.

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

sg
__________________
Currently Using:

For X-cart v5.2.0
1 Business v5.2.6 license <Getting Better>!
1 Banner Mod 5.2.7 license
1 #28 iGoods Template

For X-cart v4.7.0

1 GoldPlus v4 license unused

3 Gold v4 license Unused

A wise man once said it is best to fix the cart instead of trying to use a broken cart. The horse has a very hard time pushing a broken cart!!
Reply With Quote
  #8  
Old 07-29-2008, 01:34 AM
 
chiactivate chiactivate is offline
 

Senior Member
  
Join Date: Feb 2007
Location: Canada
Posts: 148
 

Default 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
__________________
www.ChiMassager.com
X-cart Version 4.44

www.SEOMarketing30days.com
--> Download FREE SEO marketing Ebook (valued $50)
Attract more visitors and sales with top 5 most powerful SEO marketing strategies. Converting visitors into buyers, not just traffic!
Reply With Quote
  #9  
Old 08-12-2008, 07:50 AM
 
justy justy is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 39
 

Default 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}
__________________
---
x-cart 4.1.9
XC SEO 1.4

x-cart 4.2
Reply With Quote
  #10  
Old 08-17-2008, 11:02 AM
 
chiactivate chiactivate is offline
 

Senior Member
  
Join Date: Feb 2007
Location: Canada
Posts: 148
 

Default 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
__________________
www.ChiMassager.com
X-cart Version 4.44

www.SEOMarketing30days.com
--> Download FREE SEO marketing Ebook (valued $50)
Attract more visitors and sales with top 5 most powerful SEO marketing strategies. Converting visitors into buyers, not just traffic!
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 01:31 AM.

   

 
X-Cart forums © 2001-2020