Hi All,
I've created a set of "price range links" that use static search URL's to display all products between 0-$200, $201-$500, etc.
The links function perfectly, but I'm trying to get them to have an 'active' class applied to them when you are on the appropriate page. I've attempted to access the 'price_min' and 'price_max' elements of the 'search_prefilled' array, but with no luck.
Here's my code:
HTML Code:
{foreach from=$search_prefilled item=s}
{assign var='minimum_price' value=$s.price_min}
{assign var='maximum_price' value=$s.price_max}
{/foreach}
<!-- Search by Price -->
<ul id="norm">
<li {if $main eq 'search' && $maximum_price eq 199.99}class="active"{/if}>
<a href="search.php?mode=search&including=all&by_title=off&by_descr=off&by_sku=off&search_in_subcategories=on&price_min=0.00&price_max=199.99"><$200</a>
</li>
<li {if $main eq 'search' && $maximum_price eq 500.99}class="active"{/if}>
<a href="search.php?mode=search&including=all&by_title=off&by_descr=off&by_sku=off&search_in_subcategories=on&price_min=200.00&price_max=500.99">$200-$500</a>
</li>
<li {if $main eq 'search' && $maximum_price eq 1000.99}class="active"{/if}>
<a href="search.php?mode=search&including=all&by_title=off&by_descr=off&by_sku=off&search_in_subcategories=on&price_min=501.00&price_max=1000.99">$501-$1000</a>
</li>
<li {if $main eq 'search' && $maximum_price eq 1000000.00}class="active"{/if}>
<a href="search.php?mode=search&including=all&by_title=off&by_descr=off&by_sku=off&search_in_subcategories=on&price_min=1001.00&price_max=1000000.00">>$1000</a>
</li>
</ul>
If anyone has any ideas on how to get active classes to correctly appear for this type of link let me know. Thanks!