To give a little context, we are using the OrganicInternet Simple Configurable Products module to avoid having configurable products in our cart. All simple products on the site are marked as not visible individually. The problem we have is that a simple product remains in the cart even when it's associated configurable is disabled or removed.
The quote_item for the simple product contains the ID of the configurable product that was added, so the obvious solution to this seems to be to hook into an event use the cpid to check if the configurable product is enabled and remove the item from the quote.
The only problem is, I'm not entirely sure where to hook into. I tried _before_save on the quote, this seems to work, but has the issue that if no items are left in the quote, you end up seeing an empty basket (as opposed to the empty basket message). Any suggestions?