This topic contains 17 replies, has 3 voices, and was last updated by thesdhotel 7 years, 5 months ago.
The topic ‘Customize "Date Format" of a Date Custom Field in product-item layout’ is closed to new replies.
test
Hi in the case of your site.
You can edit the file :
plugins/jamegafilter/content/helper.php
Find the code:
case 'calendar' :
$this->attr['ct'.$field->id]['value'][] = strtotime($field->value);
$this->attr['ct'.$field->id]['frontend_value'][] =strtotime($field->value);
You can edit the line:
$this->attr['ct'.$field->id]['frontend_value'][] =strtotime($field->value);
To something like this.
$this->attr['ct'.$field->id]['frontend_value'][] = ($field->value);
Or
$this->attr['ct'.$field->id]['frontend_value'][] = date("Ymd", strtotime($field->value));
And
You can use the code in the file product-item.php
{attr.ct1.frontend_value}
Hello, Ok, finally! I don’t understand why it took one month for a simple edit like this, but this finally worked lol. Thanks.
A few general notes:
So at the end of the day, there was no need for dust-intl, since you can customize the calendar field date format in the helper.php, right? I will deleted all the dust-intl files and edits that we made to use the library, since it wasn’t needed.
Not sure why you asked me for my ftp login of my site, if at the end, it was a simple customization of the helper.php that had nothing to do with my site…
Anyways, we finally did it! Now I got the custom field date to show up with my desired format. Thanks!
This topic contains 17 replies, has 3 voices, and was last updated by thesdhotel 7 years, 5 months ago.
The topic ‘Customize "Date Format" of a Date Custom Field in product-item layout’ is closed to new replies.