How to override date formate for invoices generate by invoice plugin?

  • Posts: 202
  • Thank you received: 7
  • Hikaserial Subscription Hikashop Business
2 weeks 1 day ago #308218

Hello,
I want to override date format from 2019-04-29 to 29-04-2019 ( www.screencast.com/t/cG2fpq6aaIL )
in all invoices generated

I have already overridden all the other texts for the english language file so that when I update the component the overrides are still there

but I don't understand how to do this for the date format

I am using the hikashop_attachinvoice plugin to generate the invoices, not sure if this is related...

all I see in the invoice.php file is (I have overriden the original file already to apply other changes)

<?php
					if(!empty($this->element->order_invoice_created)) {
						echo JText::_('DATE').': '.hikashop_getDate($this->element->order_invoice_created,'%d %B %Y');
					}else{
						echo JText::_('DATE').': '.hikashop_getDate($this->element->order_created,'%d %B %Y');
					}
				?>

I think the invoice date format 2019-04-29 may be coming from elsewhere, but I can't find any language strings with a date format in Hikashop language file

Thank you

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

  • Posts: 66270
  • Thank you received: 9720
  • MODERATOR
2 weeks 1 day ago #308219

Hi,

You can just use a translation override to change the format of the dates:
HIKASHOP_DATE_FORMAT="%Y-%m-%d"
This translation key is on line 2213 of the translation file.
www.hikashop.com/download/languages.html#modify
That way, you won't have any issue with updates.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum