Retail Price Access Level

  • Posts: 1115
  • Thank you received: 12
  • Hikashop Business
10 years 2 months ago #208350

-- 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: 10 years 2 months ago by verzevoul. Reason: forgot something to ask

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

  • Posts: 84305
  • Thank you received: 13700
  • MODERATOR
10 years 2 months ago #208352

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:

<?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.

  • Posts: 1115
  • Thank you received: 12
  • Hikashop Business
10 years 1 month ago #208685

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

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 1 month ago #208687

Hi,

You have to edit the view "product / listing_price" and add the 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:
echo JText::_('PRICE_BEGINNING');

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

  • Posts: 1115
  • Thank you received: 12
  • Hikashop Business
10 years 1 month ago #209023

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.

  • Posts: 84305
  • Thank you received: 13700
  • MODERATOR
10 years 1 month ago #209032

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.083 seconds
Powered by Kunena Forum