marolini Posted December 15, 2022 Share Posted December 15, 2022 Hey there! Thank you in advance for the support! So, currently the "Availability date" format is: YYYY/MM/DD - I've already been to International > Localization > Languages but it doesn't seem to be there where you change the "Availability date" format. As the date format currently is MM/DD/YYYY. Any thoughts where to change this? Preferably in settings rather than editing the code. Thanks a million! Link to comment Share on other sites More sharing options...
juanrojas Posted December 15, 2022 Share Posted December 15, 2022 hello, but did you enter the language? Link to comment Share on other sites More sharing options...
marolini Posted December 15, 2022 Author Share Posted December 15, 2022 Hi there thanks for the reply. Yes, I only have ONE language. And still nothing :( Link to comment Share on other sites More sharing options...
juanrojas Posted December 15, 2022 Share Posted December 15, 2022 please add screenshots, of the format you have in the language and where the problem is Link to comment Share on other sites More sharing options...
marolini Posted December 15, 2022 Author Share Posted December 15, 2022 Hey Juan! The problem is basically located on the product page. This is enabled via Catalog > Products > *Select your product* > Virtual Product > Availability date - Once you set the availability data, the date will show in Product Details. Here's the screenshot from the backend: Link to comment Share on other sites More sharing options...
ps8modules Posted December 16, 2022 Share Posted December 16, 2022 Hi, in the list of languages, you need to click on the pencil icon. Link to comment Share on other sites More sharing options...
marolini Posted December 16, 2022 Author Share Posted December 16, 2022 Hey guys. Thank you for the help. Unfortunately neither of the solutions helped... Link to comment Share on other sites More sharing options...
juanrojas Posted December 16, 2022 Share Posted December 16, 2022 hace 10 horas, marolini dijo: Hey Juan! The problem is basically located on the product page. This is enabled via Catalog > Products > *Select your product* > Virtual Product > Availability date - Once you set the availability data, the date will show in Product Details. Here's the screenshot from the backend: Can you attach a screenshot of the error? Link to comment Share on other sites More sharing options...
marolini Posted December 16, 2022 Author Share Posted December 16, 2022 There's no error buy I assume this is what you're asking? Link to comment Share on other sites More sharing options...
ps8modules Posted December 16, 2022 Share Posted December 16, 2022 You may also discover the Prestashop function: Tools::displayDate(... you can also use such a function in TPL, for example: {Tools:.displayDate(strtotime($mydate), Context::getContext()->language->id, false, '-')} Link to comment Share on other sites More sharing options...
marolini Posted December 16, 2022 Author Share Posted December 16, 2022 Hi 4you.software - That is a function to display the date. The actual date format must come from elsewhere. That's what I'm having trouble with, not knowing where it's fetching the date format from. Thank you for the effort though Link to comment Share on other sites More sharing options...
ps8modules Posted December 16, 2022 Share Posted December 16, 2022 But this function will change the format as you need. Link to comment Share on other sites More sharing options...
ps8modules Posted December 16, 2022 Share Posted December 16, 2022 public static function displayDate($date, $id_lang = null, $full = false, $separator = null) Link to comment Share on other sites More sharing options...
ps8modules Posted December 16, 2022 Share Posted December 16, 2022 TPL: {if Context::getContext()->language->id == '1'}{DateTime::createFromFormat('m-d-Y', $dateValue)->format('Y-m-d')}{/if} {if Context::getContext()->language->id == '2'}{DateTime::createFromFormat('m/d/Y', $dateValue)->format('Y-m-d')}{/if} Link to comment Share on other sites More sharing options...
marolini Posted December 16, 2022 Author Share Posted December 16, 2022 I genuinely appreciate for your efforts. I'm going to give it a go. Do you know which TPL that might be please? Link to comment Share on other sites More sharing options...
ventura Posted December 16, 2022 Share Posted December 16, 2022 You can try using in /themes/your_theme/templates/catalog/_partials/product-details.tpl replacing {$product.availability_date} by {dateFormat date=$product.availability_date} 1 Link to comment Share on other sites More sharing options...
marolini Posted December 16, 2022 Author Share Posted December 16, 2022 Ventura, this worked like a charm!!! Thank you do much! 🤩 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now