You are here:  » using images/icons for price sort ascending and descending.

Support Forum



using images/icons for price sort ascending and descending.

Submitted by johnmcg on Wed, 2011-08-03 15:28 in

Hi David,
I'm trying to get the sort by price to be done by 2 icons in a user_searchresults_before.php

I can't get it to work. I'm using a simple ul list to display the icons.
Please help.

Here is the user_searchresults_before.php (you can see it at {link saved)

<div class="user_search">
<ul class="gallery">
<li><img src="/images/icons/order-online.png" alt="order online icon" />
<br />Order Online
</li>
<li><img src="/images/icons/deliver-national.png" alt="Deliver National icon" />
<br />Deliver National
</li>
<li><img src="/images/icons/price.png" alt="price icon" />
<br />Low to High
</li>
<li><img src="/images/icons/price.png" alt="price icon" />
<br />High to Low
</li>
<li><img src="/images/icons/location.png" alt="Location icon" />
<br />Location
</li>
<li><img src="/images/icons/certified-organic.png" alt="Certified Organic icon" />
<br />Certified Organic
</li>
<li id="lastitem"><img src="/images/icons/fair-trade.jpg" alt="Fair Trade icon" />
<br />Fair Trade
</li>
</ul><br style="clear:left;" />
<ul class="gallery">
<li><a href="/house/merchants.php"><img src="/images/icons/companies.png" alt="Companies icons icon" />
<br />Companies</a>
</li>
<li><img src="/images/icons/products-services.png" alt="products and services icon" />
<br />Products and Services
</li>
<li><img src="/images/icons/info.png" alt="Info icon" />
<br />Info
</li>
</ul>
</div>
<br style="clear:both;" />

I'd appreciate if you could give me the code to make a search for fair trade and for certified organic within the category search result, ie display the fair trade products from this category search. The words are in the product description.

Thanks,
John McGuinness

Submitted by support on Wed, 2011-08-03 16:04

Hi John,

No problem - taking the section of your code that generates the price order links:

<li><img src="/images/icons/price.png" alt="price icon" />
<br />Low to High
</li>
<li><img src="/images/icons/price.png" alt="price icon" />
<br />High to Low
</li>

...REPLACE with:

<li><a href='<?php print $config_baseHREF."search.php?q=".urlencode($q)."&sort=priceAsc"?>'>
<img border='0' src="/images/icons/price.png" alt="price icon" />
</a>
<br />Low to High
</li>
<li><a href='<?php print $config_baseHREF."search.php?q=".urlencode($q)."&sort=priceDesc"?>'>
<img border='0' src="/images/icons/price.png" alt="price icon" />
</a>
<br />High to Low
</li>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by johnmcg on Wed, 2011-08-03 16:56

Worked perfectly!
Thanks,
John