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

have promo banner image hidden from wholesale members

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-30-2016, 12:08 PM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default have promo banner image hidden from wholesale members

x-cart version 4.4.6.

I am setting up a shipping promo. Flat $5.00 shipping on orders over $100. I am creating a banner image that will be displayed across the top of the pages. I want to set a conditional statement that will hid the banner when a wholesale member logs in.

I was trying something like this...

Code:
{if $login eq "" or $membershipid ne 2} <div class="flat_shipping_promo"> <img src="images/flat-5-shipping.gif" /> </div> {/if}

It isn't working so I'm not sure what I need to use instead. Is this possible to do?

Thanks.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #2  
Old 10-03-2016, 06:35 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: have promo banner image hidden from wholesale members

You should only need the membershipid test, but try displaying it to see if it is present.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #3  
Old 10-03-2016, 06:44 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: have promo banner image hidden from wholesale members

Hi Cherie,
How do I display it to check? I tried looking in webmaster mode (variables) and don't see a membershipid listed. Is there a different/better way to check?
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #4  
Old 10-03-2016, 07:07 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: have promo banner image hidden from wholesale members

membership is part of user account info. So there is no direct membershipid variable, it will be userinfo.membershipid or user_account.membershipid or similar. Also this will apply to logged in customers only. All non-logged in customers will still see the banner which means your wholesale customers will see it until logged in - doesn't make much sense
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 10-03-2016, 07:09 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: have promo banner image hidden from wholesale members

{$membershipid}
http://www.smarty.net/docs/en/language.syntax.variables.tpl

If membershpid is not in an existing array like $userinfo then you may have to go get it, like this: https://forum.x-cart.com/showthread.php?p=353774
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #6  
Old 10-03-2016, 07:56 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: have promo banner image hidden from wholesale members

Thanks Steve and Cherie,
I added
Code:
$smarty->assign("user_membershipid",$user_account['membershipid']);
to the bottom of include/check_useraccount.php

Then I tried using both
Code:
{if $userinfo.membershipid ne 2} <div class="flat_shipping_promo"> <img src="images/flat-5-shipping.gif" /> </div> {/if}
and
Code:
{if $user_account.membershipid ne 2} <div class="flat_shipping_promo"> <img src="images/flat-5-shipping.gif" /> </div> {/if}

logged in with my wholesale account and the banner still is showing up. Any idea what I am missing?

As far as the wholesale accounts seeing it before they log in, I'm not too worried about it. I do have the qualifier $5 shipping on "RETAIL" orders but I thought it would be nice to hide it once they log in so it isn't sticking out like a sore thumb as they are placing their orders.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #7  
Old 10-03-2016, 08:07 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: have promo banner image hidden from wholesale members

You assigned to user_membershipid which should make the following work:

{$user_membershipid}
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #8  
Old 10-03-2016, 08:43 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: have promo banner image hidden from wholesale members

ah, and so it does. Thanks so much.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
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 08:56 AM.

   

 
X-Cart forums © 2001-2020