Insydius Posted March 17, 2018 Share Posted March 17, 2018 Hello, By default IP.Nexus (Commerce) stores the timestamp when a product is added to the database in the table nexus_package as p_date_added in epoch time format. I was hoping to have this displayed above the pricing and below the product title on the product page in human format MM/DD/YYYY. Thanks! Link to comment
IPCommerceFan Posted March 18, 2018 Share Posted March 18, 2018 Edit the Nexus --> Front --> Package template, then Find: <h1 class='ipsType_pageTitle ipsType_largeTitle'>{$item->mapped('title')}</h1> and add this below it (or wherever you see fit): {expression="\IPS\DateTime::ts( $package->date_added )->strFormat('%m/%d/%Y')"} Thats it! Link to comment
Adriano Faria Posted March 18, 2018 Share Posted March 18, 2018 Or simply: {expression="\IPS\DateTime::ts( $package->date_added )->format( 'm/d/Y' )"} Link to comment
Insydius Posted March 18, 2018 Author Share Posted March 18, 2018 Perfect! Thank you! Link to comment
Mark Posted March 18, 2018 Share Posted March 18, 2018 The best way is: {datetime="$package->date_added"} Will ensure format consistency with the rest of thw suite, outputted as <time> tags Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.