product price restriction decimal limit

  • Posts: 3
  • Thank you received: 0
3 years 1 week ago #331672

-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.25
-- PHP version -- : 7.3

Hello, I need help how to set the product price restriction with more then 5 decimal ? Example 0.00001 is work fine, 0.000001 will become 0.
Thank you.

Attachments:

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
3 years 1 week ago #331675

Hi,

Prices indeed only support 5 decimals by default.
To change that, you'll have to edit the table hikashop_price via your PHPMyAdmin and edit the options of the "price_value" column to change the number of decimals:
www.tutorialspoint.com/how-to-specify-de...ase-using-phpmyadmin
Also, note that in the settings of your currency, you can configure the number of decimals which will be applied when displaying prices in that currency. So I also recommend you to check the number of decimals setting of your currency in the menu System>Currencies.

The following user(s) said Thank You: oiiahchai

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

  • Posts: 3
  • Thank you received: 0
2 years 11 months ago #332086

Thank you very much.

Attachments:

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

  • Posts: 3
  • Thank you received: 0
2 years 11 months ago #332435

The order process is working fine with small unit price product. Amount show correctly in cart.
However after some test I found that the display in order detail and order list will show 0.0000000000
I did set the currency decimal to 10.

Attachments:

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
2 years 11 months ago #332442

Hi,

Yes. That comes from the number of decimal setting of your currency.
This defines how many decimals you want to use for the display of the prices. Since you configured 10 in there, you'll get 10 decimals for all the prices.
There is no easy way to make the display of the number of decimals dynamic based on each price. That would require some complex code to be written in the file administrator/components/com_hikashop/classes/currency.php in the format function to dynamically adapt the number of decimals based on the trailing zeros.

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

Time to create page: 0.089 seconds
Powered by Kunena Forum