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

Change link based on member type

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-08-2009, 02:57 PM
 
Group Imaging Group Imaging is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 38
 

Default Change link based on member type

Forgive me if someone has asked this already but I wasn't sure what to search for but hopefully someone can help. Here's what I want to do:

I want to post a link (to our catalog pdf) on the shopping cart which is easy, however when the customer logs in with a different membership type (non-profit) I want the link to download the non-profit version of the pdf rather than the retail.

Is this possible?

Thanks for any help in advance.
__________________
Brad Thompson
Group Imaging
X-Cart Gold Version 4.1.8
Reply With Quote
  #2  
Old 04-08-2009, 03:27 PM
  alec.thomas's Avatar 
alec.thomas alec.thomas is offline
 

Advanced Member
  
Join Date: Mar 2009
Location: Minnesota, USA
Posts: 78
 

Default Re: Change link based on member type

couldnt you just do something like this?
Code:
<a href={if $userinfo.membershipid eq "customer"}"/files/catalog.pdf"{else}"/files/non-profit.pdf"{/if}>

depending on what your membership names are, and where you're files are you'll have to edit it how you want it.
__________________
X-Cart Gold v4.2.0 [Linux]
Add-On: X-Magnifier
Altered Cart Add-On: One Page Checkout
Reply With Quote
  #3  
Old 04-13-2009, 07:20 AM
 
Group Imaging Group Imaging is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 38
 

Default Re: Change link based on member type

Thanks for the starting point, here is what I ended up with:

I found an old post by B00MER that mentioned having to add the following line of code into include/check_useraccount.php.

Code:
$smarty->assign("user_membership",$user_account["membership"]);

and then for the actual line that changes directories/files I used:

Code:
<a href={if $user_membership eq "Non-Profit"}"/files/non-profit.pdf"{else}"/files/catalog.pdf"{/if}</a>
__________________
Brad Thompson
Group Imaging
X-Cart Gold Version 4.1.8
Reply With Quote
  #4  
Old 04-13-2009, 09:46 AM
  alec.thomas's Avatar 
alec.thomas alec.thomas is offline
 

Advanced Member
  
Join Date: Mar 2009
Location: Minnesota, USA
Posts: 78
 

Default Re: Change link based on member type

I'm not sure if you had to add a new variable... I think that xcart already has one that checks membership type, but I'm glad to hear that you have it working now.
__________________
X-Cart Gold v4.2.0 [Linux]
Add-On: X-Magnifier
Altered Cart Add-On: One Page Checkout
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 09:23 AM.

   

 
X-Cart forums © 2001-2020