You are here:  » $sort problem on brand pages only.

Support Forum



$sort problem on brand pages only.

Submitted by GemViper on Tue, 2010-05-04 03:32 in

Hi David, this is another problem I'm sure I introduced myself since your test site doesn't have the same problem.

When using the sorting feature (ie: relevance, highest, lowest etc) on search result pages the links work great and sort the results properly, the url for those links is fine.

When using the sorting feature on brand pages with .htaccess set to TRUE the links are broken. The proper path after "search.php?..." is maintained but the base url reads "www.example.com/brand/brandname/search.php?...". Obviously the /brand/brandname/ shouldn't be there.

The bit of code that is controling this in search.php seems to be this...

$sortHREF = "search.php?q=".urlencode($q)."&page=1&";
      if ($minPrice || $maxPrice)
      {
        $sortHREF .= "minPrice=".$minPrice."&maxPrice=".$maxPrice."&";
      }
      $sortHREF .= "sort=";
      $sortRelevance = ($sort=="relevance"?"<strong>Relevance</strong>":"<a href='".$sortHREF."relevance' rel='nofollow'>Relevance</a>");
      if ($config_useInteraction)
      {
        $sortRating = ", ".($sort=="rating"?"<strong>Rating</strong>":"<a href='".$sortHREF."rating' rel='nofollow'>Rating</a>");
      }
      else
      {
        $sortRating = "";
      }
      $sortPriceAsc = ($sort=="priceAsc"?"<strong>Lowest Prices</strong>":"<a href='".$sortHREF."priceAsc' rel='nofollow'>Lowest Prices</a>");
      $sortPriceDesc = ($sort=="priceDesc"?"<strong>Highest Prices</strong>":"<a href='".$sortHREF."priceDesc' rel='nofollow'>Highest Prices</a>");

Any idea how I can remove the extra /brand/brandname/ from the sort links on brand pages ?

Thanks

Submitted by support on Tue, 2010-05-04 08:38

Hi,

If you add $config_baseHREF to the first line of the block of code you posted, giving you:

$sortHREF = $config_baseHREF."search.php?q=".urlencode($q)."&amp;page=1&amp;";

...that should do the trick!

Cheers,
David.