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)
-   -   Speed Bar Modification tabs (https://forum.x-cart.com/showthread.php?t=70294)

banberry 10-21-2014 09:59 AM

Speed Bar Modification tabs
 
I cannot get this to work. I am trying to conditionally show a link in the speedbar tab. However, even if a user is registered but does not have a membership applied yet, the link will still appear. I want only registered users with a membership of "Wholesale" be able to see this link. All other times it is hidden. See code I used below. Any help appreciated.

PHP Code:

{if $speed_bar}
  <
div class="tabs{if $all_languages_cnt gt 1} with_languages{/if}">
    <
ul>
{if 
$user_membership eq "Wholesale" && $login ne ""}
<
li{interline name=tabs}><a href="http://www.domain.com/2014catalog/2014catalog.pdf">Download Catalog</a></li>
{/if}
      {foreach 
from=$speed_bar item=sb name=tabs}
        <
li{interline name=tabs}><a href="{$sb.link|amp}">{$sb.title}</a></li>
      {/foreach}
    </
ul>
  </
div>
{/if} 


cherie 10-29-2014 03:16 PM

Re: Speed Bar Modification tabs
 
Try looking for $userinfo.membershipid eq 2 or whatever the correct id is. If it's not present in $userinfo you might need to do something like add the following to include/check_useraccount.php:

PHP Code:

$smarty->assign('user_membershipid',$user_account['membershipid']); 


Then use:

Code:

{if $user_membershipid eq 2}
...



All times are GMT -8. The time now is 11:11 AM.

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