It's easy to display categories in ExpressionEngine where entries are assigned using:
{exp:channel:categories channel="products|book_library" category_group="13" style="linear" parent_only="yes" show_empty="no"}
<li><a href="{path='shop'}">{category_name}</a></li>
{/exp:channel:categories}
However we're using Expresso Store and wish to display only the categories for which a store entry exists (i.e. entries with prices set in the Store publish tab).
The reasoning being that we use two channels for products, a specific shop products channel (products) and then another (book_library) where some entries will be available to buy, others will not.
Is there some way to do this without having to resort to some serious hackery?