Jump to content

(solved) DATE and CURRENCIE customisation


Recommended Posts

1. where to set/change CURRENCIE format to 0.000,00 XX?
(Back Office >> Payment >> Currencies - dont have this desired format 0.000,00 XX)

2. where to change DATE Format: YYYY-MM-DD HH:MM:SS to DD. MM. YYYY HH:MM:SS

Thanx!

Link to comment
Share on other sites

For your first question, have you tried selecting the third currency option (X0.000,00) and then changing the code in Tools.php from:

case 3:
   $ret = $c_char.$blank.number_format($price, $c_decimals, ',', '.');



to:

case 3:
   $ret = number_format($price, $c_decimals, ',', '.').$blank.$c_char;



For your second question, have you tried changing the displayDate function in Tools.php?

if ($language AND strtolower($language['iso_code']) == 'fr')
   return ($tmpTab[2].'-'.$tmpTab[1].'-'.$tmpTab[0].($full ? $hour : ''));
else
   return ($tmpTab[0].'-'.$tmpTab[1].'-'.$tmpTab[2].($full ? $hour : ''));



You can change all '-' to '. ' and reverse the order of the $tmpTab indexes.

Link to comment
Share on other sites

Which dates are still appearing in the old format? Is it all of them or just some? I think the date format is hardcoded in some places like price reductions, but most dates use the displayDate function. Did you modify the right line in the code above? If you only changed the first one and not the second one, it will only work when the language is set to French.

Link to comment
Share on other sites

excellent iw found it!

        if ($language AND strtolower($language['iso_code']) == 'uk')
            return ($tmpTab[2].'-'.$tmpTab[1].'-'.$tmpTab[0].($full ? $hour : ''));
        else
            return ($tmpTab[2].'-'.$tmpTab[1].'-'.$tmpTab[0].($full ? $hour : '')); 



it shud look like this!!!

tnx mate!

Link to comment
Share on other sites

  • 3 months later...
  • 4 weeks later...

It's not working for me. I get the following error:

Warning: Cannot modify header information - headers already sent by (output started at \shop\httpdocs\rc123\classes\Tools.php:1) in \shop\httpdocs\rc123\adminrc\header.inc.php on line 15

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...
It's not working for me. I get the following error:

Warning: Cannot modify header information - headers already sent by (output started at \shop\httpdocs\rc123\classes\Tools.php:1) in \shop\httpdocs\rc123\adminrc\header.inc.php on line 15

Hi all, peace from Brasil !!!
This error occurs when you edit the file and save it with BOM signature, it is fixed removing BOM (Dreamweaver Control+J then T).

About the date format, I believe it could be included at the Backend.
This link explain too how edit the code:
http://dapurpixel.com/how-to/change-date-format-in-prestashop/
Link to comment
Share on other sites

×
×
  • Create New...