Two prices displayed when logged in

  • Posts: 1056
  • Thank you received: 11
  • Hikashop Business
3 years 11 months ago #326507

Hi. I have two prices I want to display for when a user is logged-in. One is wholesale and the other is retail (but I don't want to use the "retail option" because that caused issues before). Is there a way I can pull both prices in the product display for when the users are logged in?

Below are my prices. The one set to "Πελάτες" is the one displayed for logged-in users.

I'd also like to have every price say "Wholesale" or "Retail" beside it so the user knows which is which (for further clarification).

This message contains confidential information


Thank you.

Last edit: 3 years 11 months ago by verzevoul.

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
3 years 11 months ago #326510

Hi,

The data of the other price won't be available in the view files. So if you want to display the other price, you would have to run your own MySQL query on the hikashop_price table to load it, and then you can calculate the tax on it if any and do the display.
So it's possible, but there is no ready-made function you can call to do these for you.

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

  • Posts: 1056
  • Thank you received: 11
  • Hikashop Business
3 years 11 months ago #326540

Could that be done by copying the already existing price and adjusting it? I'm not MySQL savvy, but I think I could understand the logic behind this...

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
3 years 11 months ago #326549

Hi,

It might.
For example, you could modify show_default.php and have such code:

$copy = hikashop_copy($this->element->prices[0]);
echo $this->currencyHelper->format($copy->price_value_with_tax-10, $copy->price_orig_currency_id);
This would display the price with tax minus 10.
But then, it supposes that the product doesn't have variants. To manage variants, it would be more complex...

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

Time to create page: 0.053 seconds
Powered by Kunena Forum