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

  • 5 months ago

Replying to enable e-mail notifications

Drew McLellan

Drew McLellan 2564 points
Perch Support

What problem are you having doing that?

Hussein Al Hammad

Hussein Al Hammad 67 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 2564 points
Perch Support

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