Post by vssoft » Sun Sep 24, 2017 3:34 pm

Hi,

I have set decimals places as 0 in currency section bcoz the prices are without decimals for all products.

But I want to show all amounts with 2 decimals in order invoice generated which shows breakup of amounts due to gst calculation. It is only required in order invoice generated at admin & store frontend. (for invoice printout only)

What modifications will be done to achieve this which shows all amounts in 2 decimals which applies only to order invoice whereas remain 0 decimals for whole store.

Thanks

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm

Post by thekrotek » Sun Sep 24, 2017 4:43 pm

It's not that easy. Currency formatting is done in GLOBAL function, which works all across the store, and number formatting is only a part of it. Function takes decimal numbers from currency settings, so if you set it to zero, no decimals will be added. The only way for you here is write a custom number formatting function and pass invoice prices and totals to it instead of the default format() function.

Are you sure you want to go thru all this pain to simply display decimals on one particular page?

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by vssoft » Mon Sep 25, 2017 12:51 pm

Actually, it is required for gst calculations in invoice generated. Can you please guide me more in which files I can do changes so that Invoice shows amounts in 2 decimals?

Thanks

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm

Post by thekrotek » Mon Sep 25, 2017 2:35 pm

Just show decimals everywhere and be happy.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 80 guests