This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

mwindey

  • *****
  • 383 posts
email_warn_expiration change expire date to dd/mm/yy
« on: September 20, 2022, 04:37:40 PM »
I was looking on the forum but couldn't find anything that matches the question so here i go.
When user receives mail to inform them there item expires then expire date is pronounced as yy/mm/dd 00:00:00
It uses ITEM_EXPIRATION_DATE from dt_expiration in oc_includes/osclass/emails.php. Is there a way to change date to dd/mm/yy ?
Normally strtotime but i don't know where to change it....

Thanks
 

*

MB Themes

Re: email_warn_expiration change expire date to dd/mm/yy
« Reply #1 on: September 21, 2022, 03:48:03 PM »
@mwindey
Put it into date function:
Code: [Select]
date('Y-m-d', strtotime(...some time string ...));
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mwindey

  • *****
  • 383 posts
Re: email_warn_expiration change expire date to dd/mm/yy
« Reply #2 on: September 24, 2022, 02:00:37 PM »
@MB Themes,

Thanks but looks like i am doing something wrong (again)  :-\
Original code is:
Code: [Select]
  $words[] = array (
    $aItem['s_contact_name'],
    $aItem['s_title'],
    $itemId,
    $aItem['dt_expiration'],
    osc_item_url(),
    $itemURL,
    $aItem['s_contact_name'],
    $aItem['s_contact_email'],
    $aItem['s_contact_name'],
    $aItem['s_contact_email']
  );
Changed it to:
Code: [Select]
  $words[] = array (
    $aItem['s_contact_name'],
    $aItem['s_title'],
    $itemId,
    osc_item_url(),
    $itemURL,
    $aItem['s_contact_name'],
    $aItem['s_contact_email'],
    $aItem['s_contact_name'],
    $aItem['s_contact_email'],
    date('d-m-Y', strtotime($aItem['dt_expiration']))
  );
ALSO to:
Code: [Select]
  $words[] = array (
    $aItem['s_contact_name'],
    $aItem['s_title'],
    $itemId,
    $aItem (date('d-m-Y', strtotime(['dt_expiration']))),
    osc_item_url(),
    $itemURL,
    $aItem['s_contact_name'],
    $aItem['s_contact_email'],
    $aItem['s_contact_name'],
    $aItem['s_contact_email']
  );
But seems like mail is not sended anymore...
 
« Last Edit: September 24, 2022, 03:51:53 PM by mwindey »

Marked as best answer by frosticek on September 25, 2022, 01:22:06 PM
*

MB Themes

Re: email_warn_expiration change expire date to dd/mm/yy
« Reply #3 on: September 24, 2022, 09:45:12 PM »
Code: [Select]
date('Y-m-d', strtotime($aItem['dt_expiration']))
« Last Edit: September 25, 2022, 01:21:48 PM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mwindey

  • *****
  • 383 posts
Re: email_warn_expiration change expire date to dd/mm/yy
« Reply #4 on: September 25, 2022, 11:27:27 AM »
Thanks ;)
The ; is too much in that place because it throws error 500 then. There is already a closing tag  ); at the end of the array. For now i have to wait till the first email comes in...  ;D

*

MB Themes

Re: email_warn_expiration change expire date to dd/mm/yy
« Reply #5 on: September 25, 2022, 01:21:56 PM »
Yes correct
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots