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)
-   -   have promo banner image hidden from wholesale members (https://forum.x-cart.com/showthread.php?t=74487)

keystone 09-30-2016 12:08 PM

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.

cherie 10-03-2016 06:35 AM

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.

keystone 10-03-2016 06:44 AM

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?

cflsystems 10-03-2016 07:07 AM

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

cherie 10-03-2016 07:09 AM

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

keystone 10-03-2016 07:56 AM

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.

cherie 10-03-2016 08:07 AM

Re: have promo banner image hidden from wholesale members
 
You assigned to user_membershipid which should make the following work:

{$user_membershipid}

keystone 10-03-2016 08:43 AM

Re: have promo banner image hidden from wholesale members
 
ah, and so it does. Thanks so much.


All times are GMT -8. The time now is 08:46 PM.

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