Forum

Thread tagged as: Runway, Shop

Perch shop stock level search results

Is it possible to filter product results based on stock_level? showall doesn't display a stock_level.

Lexi McGee

Lexi McGee 3 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you mean search or a listing? If it's a listing then that should be possible, yes.

For a search. So am guessing the answer is nope.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Right, you can't filter with a search.

Hey Drew. What's stock_status? perch:showall shows that in every product with the results. Can we use that to filter by stock?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's the flag that sets the state of the stock level, e.g. unlimited, on backorder etc

So we could use that to filter by stock level right? and what does each number or stock status mean or where can we read about that?

Drew McLellan

Drew McLellan 2638 points
Perch Support

There's nowhere to read about it - those are internal references. Ideally it should be returning a slug of the status, but I guess no one has used it before.

        '0' => 'Unlimited',
        '1' => 'In Stock',
        '2' => 'Low Stock',
        '3' => 'Out of Stock',
        '4' => 'More Stock Ordered',
        '5' => 'Discontinued'