Skip to main content

Hiding Price information

More
10 years 10 months ago #222387 by chisstu
-- 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.

More
10 years 10 months ago #222485 by nicolas
Replied by nicolas on topic Hiding Price information
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:
Code:
$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.

More
10 years 10 months ago - 10 years 10 months ago #222659 by chisstu
Replied by chisstu on topic Hiding Price information
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: 10 years 10 months ago by chisstu.

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

More
10 years 10 months ago #222711 by chisstu
Replied by chisstu on topic Hiding Price information
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.

More
10 years 10 months ago #222690 by nicolas
Replied by nicolas on topic Hiding Price information
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.200 seconds
Powered by Kunena Forum