Jump to content

Commerce/Nexus Product Date Added Display


Insydius

Recommended Posts

Posted

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!

Posted

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!

Posted

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...