Price format in notification emails

  • Posts: 12
  • Thank you received: 1
1 year 4 months ago #352879

-- HikaShop version -- : 4.7.1
-- Joomla version -- : 4.3.2
-- PHP version -- : 7.4

Dear support,
I correctly see price values in the frontend and in the Orders table in the backend. One euro is for example: 1,00

However, in the notification email, three more zeros are added. In the email template, I just use: {VAR:order.order_full_price}

Can someone advise me?
Kind regards
Lorenzo

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 4 months ago #352885

Hi,

That's normal. The dynamic tag you're using uses the data coming directly from the database and in the database the order_full_price column of the hikashop_order table has a type with 5 decimals.
Then, HikaShop rounds the price when displaying it to 2 decimals as per your currency settings.
Here, that second part isn't done.
So either:
- edit the structure of the hikashop_order table via your PHPMyAdmin access and change the number of decimals from 5 to 2 for that column.
- instead of using this tag, you could add PHP code like this:

<?php echo round($data->cart->order_full_price, 2); ?>

The following user(s) said Thank You: LorenzoC

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

  • Posts: 12
  • Thank you received: 1
1 year 4 months ago #352950

Awesome quick reply. SOLVED

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

Time to create page: 0.055 seconds
Powered by Kunena Forum