How display product price with 4 decimal?

  • Posts: 3
  • Thank you received: 0
9 years 10 months ago #188233

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 2.5.28

Hi.
i want display the product price with 4 decimal only in the product page and at unit price in the cart page.
Wich i source file i must change?

BR

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

  • Posts: 12953
  • Thank you received: 1778
9 years 10 months ago #188236

Hello,
The files that is displaying the price :
- on the cart module / product page is the "listing_price" file of the "product" view of your front-end template.
- on the checkout cart is the "listing_price" file of the "checkout" view of your front-end template.
Note that you'll be able to edit these files via "Hikashop->Display->Views".
But note that you can control the way price is displayed by editing the currency via "Hikashop->System->Currencies" but you won't be able to display differently your currency regarding where you are.

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

  • Posts: 3
  • Thank you received: 0
9 years 10 months ago #188526

Thanks to your help Mohamed!
I found the files and tried to change them, but I can not get what I want.
I want what you can see in the attached image.

How should I edit the file correctly?

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
9 years 9 months ago #188527

Hi,

Please check your settings under System > Currencies for the Euro currency as Mohamed said in the second part of his answer.

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

  • Posts: 3
  • Thank you received: 0
9 years 9 months ago #188666

Dear Xavier,
Perhaps I did not explain well.

I know how I can act in System> Currencies to set 2 or 4 decimal.
But I want to show 4 decimal places on the product pages, but 2 decimals in prices of the truck.

How i do it?

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

  • Posts: 13201
  • Thank you received: 2322
9 years 9 months ago #188672

Hi,

So on the views "checkout / cart" you can replace the occurrences of:

$this->currencyHelper->getRounding($this->full_total->prices[0]->price_currency_id)
By:
round($this->currencyHelper->getRounding($this->full_total->prices[0]->price_currency_id),2)

And in the view "checkout / listing_price" and "product / listing_price" add too this php round() function on the desired elements. It require some PHP knowledges.

The round needs to be added around the occurrences of:
$this->currencyHelper->format(...)

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

Time to create page: 0.084 seconds
Powered by Kunena Forum