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

  • 2 months ago

Replying to enable e-mail notifications

Drew McLellan

Drew McLellan 2517 points
Perch Support

What problem are you having doing that?

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 2517 points
Perch Support

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