Osclass Support Forums

General osclass questions => General discussion => Topic started by: mwindey on September 20, 2022, 04:37:40 PM

Title: email_warn_expiration change expire date to dd/mm/yy
Post by: mwindey 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
 
Title: Re: email_warn_expiration change expire date to dd/mm/yy
Post by: MB Themes on September 21, 2022, 03:48:03 PM
@mwindey
Put it into date function:
Code: [Select]
date('Y-m-d', strtotime(...some time string ...));
Title: Re: email_warn_expiration change expire date to dd/mm/yy
Post by: mwindey 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...
 
Title: Re: email_warn_expiration change expire date to dd/mm/yy
Post by: MB Themes on September 24, 2022, 09:45:12 PM
Code: [Select]
date('Y-m-d', strtotime($aItem['dt_expiration']))
Title: Re: email_warn_expiration change expire date to dd/mm/yy
Post by: mwindey 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
Title: Re: email_warn_expiration change expire date to dd/mm/yy
Post by: MB Themes on September 25, 2022, 01:21:56 PM
Yes correct