Quote:
Originally Posted by darrenkierman
One small bug .... lets say you have one product and 5 subcategories, it will not show the subcategories because it automatically jumps to the one product. To fix it :
Code:
{if $products|@count eq 1}
{if $subcategories}{else}
{assign var="prodURL" value="product.php?productid=`$products.0.productid`&cat=$cat&page=1"}
{php}
header( "Location: " . $GLOBALS[smarty]->_tpl_vars[prodURL] );
{/php}
{/if}
{/if}
|
@darren, good find.
@carpeperdiem, good point.
I think the key here is to realize that different shops are obviously set up to operate and navigate in different manners. Per darren's piont, I can understand having a top-level category with three sub-cats, but wanting the users to see the subcats before being taken to the product page. In this case, I would modify the code so that drilling into the subcat itself would take you to the product page?
Either way, good posts on use of the code. I also enjoy the search result hook.
Keep 'em coming!