Humm will this get messed up on next update?

  • Posts: 108
  • Thank you received: 0
14 years 2 months ago #504

Hi there,

So being that I mostly develop websites for US customers, I have made quite a few modifications [some of which have been with your considerable help as you know]...

FOR THOSE READING THIS FORUM BEFORE PURCHASING, please know that the support is AWESOME!

Anyways back to the topic at hand, in the SUMMARY OF ORDER email that is sent the customer I managed to customize the
time and date formatting so that it reads:

We are pleased to confirm the creation of your order No. B3J1 at [Store Name] on October 22 2010 at 03:26.

The problem is to do that, I had to edit administrator/components/com_hikashop/helpers/helper.php

line 15 or 27 [depending on the editor used] from:

function getDate($time = 0,$format = '%d %B %Y %H:%M'){

to

function getDate($time = 0,$format = '%B %d, %Y at %H:%M.'){

BUT, I'm figuring that when the new version of Hikashop comes out, I'm going to get stuck having to re-introduce
these changes into this file, is that correct?

and IF so, couldn't there be a way to have this "%B %d, %Y at %H:%M." be a constant that gets defined in the Hikashop configuration somehow and introduced in this line as a constant or variable?

This would make the software more international for sure.

Cheers,

Emmanuel.

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
14 years 2 months ago #505

Hi,
That's a good point you're making. However, that's not how we need to solve it I think.

What we will do is change the translation string ORDER_CREATION_SUCCESS_ON_WEBSITE_AT_DATE to "We are pleased to confirm the creation of your order No. %s at %s on the %s at %s" and then change the code in the email to:

echo JText::sprintf('ORDER_CREATION_SUCCESS_ON_WEBSITE_AT_DATE',$url,HIKASHOP_LIVE, hikashop::getDate(time(),'%d %B %Y'), hikashop::getDate(time(),'%H:%M'));
That way, the french version will have "à" instead of "at" as it would happen in your solution. You can already do that change on your website and you won't loose your modification after updating as you don't need to change the function getDate with the solution I propose.

Last edit: 14 years 2 months ago by nicolas.

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

  • Posts: 108
  • Thank you received: 0
14 years 2 months ago #507

well that works almost as needed ;) god How I wish I had your brain combined with mine ;)

Anyways, so the only thing that is an issue is that here we forgot the date differently:

We are pleased to confirm you the creation of your order No. B2A3 on STORENAMEorURL on October 22, 2010 - 02:16.

instead of:

We are pleased to confirm you the creation of your order No. B2A3 on www.acewasabisf.com/ on the 22 October 2010 02:16

also how is changing it to:

"We are pleased to confirm the creation of your order No. %s at %s on the %s at %s."
going to yield à instead of at - not sure I follow that part but anyways...

Cheers,

Emmanuel.

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
14 years 2 months ago #508

For the order of the month and the day, there is nothing we can do in hikashop by default. even if we use the Joomla date format DATE_FORMAT_LC3 which is defined in the translation file of joomla, you will still have to modify it because the en-GB translation file of joomla uses the exact same order as we are doing currently. Plus, if we use the joomla format and that you modify it in the translation file, next time you update joomla, you will loose your modification. Here, if you modify the format in the email file, you don't loose anything at update.


Anyway, you can just change %d %B %Y by %B %d %Y in the email code file and you will get the date the way you want.

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

Time to create page: 0.051 seconds
Powered by Kunena Forum