Hi - I’m building a store with EE1.7 & Cartthrob, and have moved it to enginehosting, but I’m having some serious performance issues and I think it might be down to the way I’m inefficiently handling certain areas of code. The bit I’m most concerned about is this:
The site sells jewellery and has a set of categories for brands, and another set of categories for jewellery types. On a brand page, I need to list the jewellery types relevant to that brand only (and generate the relevant link paths). So only type categories that have entries against them and the brand return a link.
The way I’ve ended up doing it is with an exp:weblog:categories tag, and an embedded weblog:entries tag inside it that will return the jewellery type only if there are entries within it. This seems to be a hideously expensive way of doing it; I’m wondering if I could achieve a more efficient list with the query module, but I can’t figure out how to write the query. here’s my code:
{exp:weblog:categories weblog="jewellery" category_group="8" show_empty="no"}
{embed="_components/.product_nav_list"
brand_cat="{embed:brand_cat}"
type_cat="{category_id}"
weblog="jewellery"
brand_url="{segment_4}"
cat_url_title="{category_url_title}"
cat_name="{category_name}"}
{/exp:weblog:categories}and the embedded template (.product_nav_list) looks like this:
{exp:weblog:entries weblog="{embed:weblog}" category="{embed:brand_cat}&{embed:type_cat}" limit="1" dynamic="off"}
<a href="/jewellery/products/cat/{embed:brand_url}/{embed:cat_url_title}">{embed:cat_name}</a>
{/exp:weblog:entries}This probably doesn’t make sense in abstraction, but if it does make sense to anyone and they have some ideas I’d be so grateful to hear them!