Skip to main content

Retail Price Access Level

More
11 years 2 months ago - 11 years 2 months ago #208350 by verzevoul
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.4

Hello,

I want to have 2 different prices for each product, one price for companies and another one for customers.
I managed to display both retail price and price in listing product page thanks to this link " hikashop.com/forum/product-category-disp...nd-retail-price.html ".

The problem is that i want both prices to be displayed only to logged users, otherwise i dont want anyone to be able to see the prices. Is there a way to set access level to retail price?

And if that's not possible, how can i have two prices displayed in products page AND in products listing page?
I have set the "display method" to "all", but it still shows the cheapest price.

Thank you in advance!
Last edit: 11 years 2 months ago by verzevoul. Reason: forgot something to ask

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #208352 by nicolas
Replied by nicolas on topic Retail Price Access Level
Hi,

If you want both the normal price and the retail price to display only to logged in users, the simplest is to add such code at the beginning of the "listing_price" file of the "product" view via the menu Display>Views:
Code:
<?php $user = JFactory::getUser(); if($user->guest) return; ?>
The following user(s) said Thank You: verzevoul

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #208685 by verzevoul
Replied by verzevoul on topic Retail Price Access Level
Thank you that did work!
May i ask something else, if i login, the products that don't have retail price, have no title.
The products with both retail and simple price are displayed correct.
How can i show the title of the price, to the products with no retail price?

Here a screenshot to see what i mean

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #208687 by Xavier
Replied by Xavier on topic Retail Price Access Level
Hi,

You have to edit the view "product / listing_price" and add the code:
Code:
if(!isset($this->row->product_msrp) || @$this->row->product_msrp == 0){ ?> <span class="hikashop_product_msrp_price_title"> <?php echo JText::_('PRODUCT_MSRP_BEFORE'); ?> </span> <?php }
Right after:
Code:
echo JText::_('PRICE_BEGINNING');

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #209023 by verzevoul
Replied by verzevoul on topic Retail Price Access Level
Hi, yes that's working, it shows the retail price title, what if i want to display the product's price title only?

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #209032 by nicolas
Replied by nicolas on topic Retail Price Access Level
Then, instead of PRODUCT_MSRP_BEFORE, use PRODUCT_MSRP_AFTER in the code provided by Xavier and that should do it.
The following user(s) said Thank You: verzevoul

Please Log in or Create an account to join the conversation.

Time to create page: 0.221 seconds
Powered by Kunena Forum