Hiding Price information

  • Posts: 7
  • Thank you received: 0
8 years 4 months ago #222387

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.5.29
-- Browser(s) name and version -- : Chrome Version 46.0.2490.86 m

I've just upgraded to business edition. I am only permitted to show price information to registered users. Retail price and selling price must be hidden from public view.

The issue I have is that I can limit the selling price easily enough, but need to be able to hide the Retail Price as well. I have seen a number of similar posts, but none that I am able to follow and execute with success.

Thanks.

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
8 years 4 months ago #222485

Hi,

There is no setting to hide the retail price based on the user group of the user.

You would have to add such code at the beginning of the file "listing_price" of the "product" view via the menu Display>Views:

$my = JFactory::getUser();
$userGroups = JAccess::getGroupsByUser($my->id);
if(in_array(XXX,$userGroups))
$this->row->product_msrp = null;
where XXX is the user group id for which you don't want to show the retail price.

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

  • Posts: 7
  • Thank you received: 0
8 years 4 months ago #222659

Hi Nicolas,

Thanks for this, however, it didn't bring me any success - I ended up with the code appearing in the front end where the retail price was (no price shown though!).

After this, the Retail price disappeared from my product listing, but it appears to be permanently missing. It continued to show in the product page.

Since this first attempt I have reverted back to a back up of my database and a backup of the com_hikashop folder and the listing_price file from my template folder.

Last edit: 8 years 4 months ago by chisstu.

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

  • Posts: 7
  • Thank you received: 0
8 years 4 months ago #222711

Using this - seems to do the trick!

<?php $user = JFactory::getUser();
if($user->guest) $this->row->product_msrp = null; ?>

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
8 years 4 months ago #222690

Hi,

1. The code modification I provided doesn't have the capability to remove the display of the retail price from the listing.
By default, there is no display of the retail price on the listing.
But when you removed the customization of the listing_price view file, you must have also lost the other modification that you had done to display the retail price on the listing. So you'll have to add this one back in.

2. Regarding the code I gave, you need to put it inside <?php and ?> tags
If you put that code outside such tags, it won't do anything and will just be seen as text to be displayed on the page.
So make sure that you have the <?php and ?> tags around the code.

The following user(s) said Thank You: chisstu

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

Time to create page: 0.053 seconds
Powered by Kunena Forum