![]() |
if/then for wholesale customers...
I'd like to make it so that the products list (products.tpl I think, right?) shows the price for regular customers but DOES NOT show the price on that page for signed-in wholesale customers.
It seems like a simple enough if/then but I am having trouble with it. Any help? (my reasoning: for wholesale customers, there's a minimum quantity to get the wholesale price, so the products list shows the retail price instead of the price per piece if buying the minimum. so a product that retails at $4 and sells wholesale for $2 with a minimum order of 10 items looks on the products list like it costs $4, which is confusing for my wholesale customers. so i'd rather avoid that. alternately, I could add something that says "retail price per piece" if i can't make it go away completely.) Thank you, Julie |
Re: if/then for wholesale customers...
Add
Code:
$smarty->assign('user_account', @$user_account); Code:
func_display('customer/home.tpl', $smarty); After surround the price code in products.tpl template with e.g.: Code:
{if $user_account.membershipid eq 0} this will show the price only for customers without any membership level. |
Re: if/then for wholesale customers...
Hi Alex,
I've tried adding this piece of code to home.php, but the smarty variable is only available on the homepage and not any of the other pages. Is there a way to get around this? I have a catalog page only available to users with a membership level which is linked from one of the main menus, so it needs to be available at all times once they are logged in. Many Thanks *UPDATE* Think I got around this by adding the code to auth.php. Not sure if that's the best place, but it seems to work ok. |
Re: if/then for wholesale customers...
You can also add to include/common.php (categories.php before 4.4.x), I thing is better then messing up with auth.php
|
Re: if/then for wholesale customers...
Got it ... Cheers Steve!
|
Re: if/then for wholesale customers...
Is there a way to get the {$user_account.membershipid} to show a specific welcome text on the welcome.tpl template?
|
Re: if/then for wholesale customers...
You should use conditions in the welcome.tpl template.
Code:
{if $user_account.membershipid eq ID1} |
Re: if/then for wholesale customers...
Thank you for the reply. I tried the code similar to your with ids of 9 but it seems it still would not work. :(
HTML Code:
{if $user_account.membershipid eq 9} I noticed in the menu.tpl it iterated over them do I have to do this for the ids here? HTML Code:
{* $Id: menu_manufacturers.tpl,v 1.5 2005/11/17 06:55:47 max Exp $ *} |
Re: if/then for wholesale customers...
Not sure what exactly you mean. Since I've used memberships in the sample and you refer the manufacturers in yours.
These are completely different entities in X-Cart. |
Re: if/then for wholesale customers...
Sorry for the confusion. The goal is to get the "membershipid" on the welcome.tpl also note that I am running X-cart version 4.1.9
|
Re: if/then for wholesale customers...
In this case you should use the instructions from my post -> http://forum.x-cart.com/showpost.php?p=315987&postcount=2
In the welcome.tpl you can use something like: Code:
{if $user_account.membershipid eq 0} |
Re: if/then for wholesale customers...
Quote:
Thanks this worked! :D/ |
Re: if/then for wholesale customers...
this is great stuff...and
{if $user_account.membershipid eq 0} ... no membership ... {elseif $user_account.membershipid eq 9} ... specific membership ... {/if} works on product pages but when on homepage the $user_account.membershipid doesnt exist when looking at the variables in webmaster mode. I've spent hours on this already...can't seem to get a module to ONLY SHOW if a user is logged in with a membership level. Please help, i'm using 4.4.3 |
Re: if/then for wholesale customers...
it doesn't work on the welcome page either.
I tried to change this file: /2-columns/customer/main/welcome.tpl Quote:
Please help! Using 4.4 |
Re: if/then for wholesale customers...
can anybody whether this condition is correct?
{if $user_account.membershipid eq 0} It doesn't recognize the condition. I even tried: {if $user_account.membershipid eq '0'} and {if $user_account.membershipid eq "0"} They all don't work. If want to show welcome message A to pending user with: Sign up for membership ; Wholesale Membership : Not member and show welcome message B to activated user : Sign up for membership ; Wholesale Membership : Wholesale |
All times are GMT -8. The time now is 03:21 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.