You are here:  » Show all products


Show all products

Submitted by shaunmac on Mon, 2012-12-03 18:06 in

Is there a way I can have a page or group of pages that show all the products in the database in alphabetical order?

Submitted by support on Mon, 2012-12-03 18:21

Hi Shaun,

The easiest way is simply to create a link that goes straight to search results page for the query "bw:" (which returns all products) e.g.

<a href='/shopping?q=bw:'>All Products</a>

Alphabetical sort isn't included by default but can be added easily. In pto_search.php look for the following code at line 96:

  $orderByFullText["priceDesc"] = "minPrice DESC";

...and REPLACE with:

  $orderByFullText["priceDesc"] = "minPrice DESC";
  // additional custom SORT orders
  $orderByDefault["name"] = "name";
  $orderByFullText["name"] = "name";

And then add &pto_sort to your link e.g.

<a href='/shopping?q=bw:&sort=name'>All Products</a>

Cheers,
David.
--
PriceTapestry.com

Submitted by shaunmac on Mon, 2012-12-03 18:35

Yes thank you it works great. And seems to already be in alphabetical order already without editing the search file. Thank Again.