Product Price - Display all user group prices

  • Posts: 100
  • Thank you received: 1
10 years 8 months ago #185765

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

Hi,

I have set up two additional Joomla user groups on my website (Silver Membership and Gold Membership). These two user groups will get discounted prices on products.

To promote the memberships I need to show all the prices on the product page, for example:

Regular Price: £34.99
Silver Membership Price: £30.00
Gold Membership Price: £25.00

Please see attached an image to help explain what I require.

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
10 years 8 months ago #185772

Hello,
If you restrict the prices to only a user group, these prices will only be shown by that user group.
Another solution can also be to list the different prices of your product through its description.

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

  • Posts: 100
  • Thank you received: 1
10 years 8 months ago #185837

Hi Mohammed,

Thank you for your reply.

I need to modify the code to show all prices for all user groups.

I cannot use the product description because we will be regularly running discounts on products, and that would mean editing the description of every product each time we run a discount.

Thanks
Alex

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

  • Posts: 100
  • Thank you received: 1
10 years 7 months ago #187340

Hi Mohammed,

Are your able to support me on this?

Thanks
Alex

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 7 months ago #187346

Hi,

Displaying all the prices dynamically on the product page while only using one price is not something that is possible with the options available by default.
So it will require customization of the code.
The simplest code customization is to first edit the line:

hikashop_addACLFilters($filters, 'price_access', '', 2, false, (int)$user_id);
with something like that:
if($_GET['ctrl']!='product' || $_GET['task']!='show') hikashop_addACLFilters($filters, 'price_access', '', 2, false, (int)$user_id);
in the file administrator/components/com_hikashop/classes/currency.php so that all the prices are loaded and displayed on the product page.
Then, you can customize the display of the prices in order to add your different labels to each price by modifying the file "listing_price" of the view "product" via the menu Display>Views.
Note that the modification to the currency.php file will be removed each time you update HikaShop.

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

  • Posts: 100
  • Thank you received: 1
10 years 7 months ago #187531

Hi Nicholas,

Thank you for your reply, I have made the change to the administrator/components/com_hikashop/classes/currency.php file.
After making this change, the price changed to show only the cheapest price, £25.00.

However the view 'listing_price' does not have access to the other prices, the variable $this->row->prices has one price in the array, so I cannot figure out how to display the other prices. (please see screenshot attached)

Do I need to edit the model so all the prices, for all user roles, can be accessed?

The price display method in the configuration is set to 'all'

Thanks
Alex

Attachments:

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 7 months ago #187587

Hi,

You can simply comment the line with "hikashop_addACLFilters" in order to be sure that you can get all prices.
After that, depending your configuration it is possible that $_GET does not contains the Joomla parameters ; at this moment the best is to use

$ctrl = JRequest::getCmd('ctrl', '');
$task = JRequest::getCmd('task', '');
to get the current ctrl and task parameters.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum