Forum

Thread tagged as: Question, Shop

Add a date to Shop Products?

Would like to sort products by date field.

Fred Stidston

Fred Stidston 0 points

  • 8 months ago

Replying to enable e-mail notifications

Drew McLellan

Drew McLellan 2603 points
Perch Support

What problem are you having doing that?

Hussein Al Hammad

Hussein Al Hammad 86 points
Registered Developer

Hello Fred,

If you want to sort the products by date created, I think you can use productCreated:

perch_shop_products([
    'sort' => 'productCreated',
    'sort-order' => 'DESC',
]);

Great! (How might I have known this?)

Drew McLellan

Drew McLellan 2603 points
Perch Support

(<perch:showall /> in your template.)