Can anyone tell me if there's a way to just display one retail price to retail customers and website vistors.
Can anyone tell me if there's a way to just display one retail price to retail customers and website vistors.
Hi Weezee,
I am new to Zen Cart and not an expert but I checked your code and wherever you are calling the code to show pricing you need an if statement to determine if a wholesale customer is logged in.
Sorry I can't tell you where that is off the top of my head, but the resultant code looks like this in HTML:
As you can see it is showing the price twice, From your previous posts it looks like this file may be your key, and it looks like the IF statement already exists, did you modify the logic some how? The IF statement seems to be missing:Code:<h2 id="productPrices" class="productGeneral"> <span id="retailwhole"> Retail Price: $49.95</span> <br/> <span id="retail">Retail Price: $49.95</span> </h2>
What did you change in this file?Code://*********************************************************************** //***DISPLAY NET RETAIL PRICE IF WHOLESALE CUSTOMER IS LOGGED ON //*********************************************************************** echo '<span id="retailwhole">' . ' Retail Price: '.$one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == '1') ? TEXT_BASE_PRICE : '') . zen_get_products_display_retail_net_price((int)$_GET['products_id']).'</span><br /> '; //********************************************************************
Gary777
This is the part I changed. (taken from tpl_product_info_display.php, line 67-75) The post is located here:
http://www.zen-cart.com/forum/showth...ICE#post574582
//***********************************************************************
//***DISPLAY NET RETAIL PRICE IF WHOLESALE CUSTOMER IS LOGGED ON
//***********************************************************************
if ($_SESSION['customer_id']) {
$customers_id = $_SESSION['customer_id'];
$customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
if ($customer_check->fields['customers_whole'] != "0") {
echo '<span id="retailwhole">' . ' Retail Price: '.$one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == '1') ? TEXT_BASE_PRICE : '') . zen_get_products_display_retail_net_price((int)$_GET['products_id']).'</span><br /> ';
}
}
//***********************************************************************
//***END DISPLAY NET RETAIL PRICE IF WHOLESALE CUSTOMER IS LOGGED ON
//***********************************************************************
This is the way the module works. You shouldn't need to change anything. The post you linked to was for somebody who wanted to show both prices to all visitors regardless of their status. The module without modifications will show:
(Retail and non logged in) will view:
Retail: XXX
(Logged in WS customers) will view:
Retail XXX
Whole Sale: YYY
I'm sorry if I don't understand the question properly and failed to explain what you were asking. Please just ask again if this is the case
Hi Madfastride and weezee,
This explains what weezee did, he/she changed the actual text of the line to read "Retail" where it should have read "Whole Sale:"
This is part of what confused me too... The module should have worked as is...Code:echo '<span id="retailwhole">' . ' Retail Price:
Nice module by the way!
Gary777
Okay I understand that... What I was trying to get across with the naming of the id was that it was going to be the Retail price displayed to a whole sale customer... I tried to keep it separate in case one wants to display and style the retail price for retail customer different that retail price for whole sale customer. Say...
(Retail customer)
Your Price: XXXX (id="retail")
(Whole Sale customer)
MSRP: XXX (id="retailwhole")
Whole Sale Price: YYY (id="whole")
Sorry for any confusion. I tried to explain it in the read me.
I just picked up on this where some others who had done some hard work left off. But thanks for the little bit I did.
Last edited by madfastride; 9 Oct 2008 at 05:33 AM.
True Ryan, sorry I should have been more specific. The tpl_product_display.php file will not change any functionality in the Dual Pricing module. It will not display the way it was intended without the change. The module is supposed to display a retail price to retail customers and a retail and whole sale price to whole sale customers. But if you are happy with the functionality by all means keep the module as it is. Cheers,
Hi Madfastride,
I must not have been very clear in my post, I understood exactly why you did what you did, it was weezee's post and the double "retail price" listing in her code that threw me off, it should have worked.
I hadn't taken a good look at the code at that point (as I mentioned) but was working on a similar task (that's how I found weezee's post) and saw that she hadn't received a response so tried to help as best I could. Your reply cleared everything up for me and hopefully weezee too.
Thanks again,
Gary777
Hi Everyone,
This mod is just what we're looking for and is working like a dream.
Could anyone tell me or help point me in the right direction so it will show the percentage diffrence in the two displayed prices?
So it would display like:
Retail Price: £xx.xx
Wholesale Price: £xx.xx
You Save: xx%
Many many thanks in advance.
Setter,
I'm glad you like the module. I'd like to add this to a release I'm working on. Along with a few other features, and customizations. But it keeps getting pushed back. You could rename a few variables and do the calculations in the tpl_display_product.php file. If you don't want to mess with it or nobody else has the code <wink>a little donation is going a long way with progressing this release and getting an early copy of the feature you donated for. </wink> PM me if you'd like.