Hey, I’ve made a shop with Merx. Now I want to display the corresponding orders for each product. I have a page model for this. But nothing is displayed.
My Code inside the Model:
public function orders(): Pages
{
/* All order pages */
$pages = $kirby->collection('orders');
/* Return filtered order pages */
return $pages
->filter(fn (OrderPage $page) =>
in_array($this->uuid()->toString(), $page->items()->toStructure()->pluck('id')));
}
My Blueprint:
sections:
orderPages:
label: Bestellungen mit diesem Produkt
type: pages
query: page.orders
create: false