![]() |
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. |
Re: Change link based on member type
couldnt you just do something like this?
Code:
depending on what your membership names are, and where you're files are you'll have to edit it how you want it. |
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> |
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.
|
All times are GMT -8. The time now is 02:38 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.