I want to use SS Shop to sell places at workshops. Its important that we don't oversell the workshops so I need to know how many places have been sold. Thats where I'm having problems.
The table OrderItem has the quantity,
Product_OrderItem extends OrderItem and contains the ProductID which identifies the workshop
Order contains the Status which tells me if the order has been paid
Order has a has-many relation with OrderItem
I'm sitting on the workshop page when I make the query so $this->ID gives me the ProductID.
Given all these elements, how do I construct a query that tells me how many of the current workshop 'products' exist in orders with a status of 'Paid'?
cheers
Bruce