Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 17, 20186 yr 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!
March 18, 20186 yr 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!
March 18, 20186 yr Or simply: {expression="\IPS\DateTime::ts( $package->date_added )->format( 'm/d/Y' )"}
March 18, 20186 yr The best way is: {datetime="$package->date_added"} Will ensure format consistency with the rest of thw suite, outputted as <time> tags
Archived
This topic is now archived and is closed to further replies.