Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Filter Results By, Options

Filter Results By, Options

Locked

Views: 1,531

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
17 Dec 2008, 10:39 PM
#1
stew_dee_oh avatar

stew_dee_oh

New Zenner

Join Date:
Dec 2008
Posts:
4
Plugin Contributions:
0

Filter Results By, Options

Hello,

I was searching the forum with no real answers to my questions.

My ZenCart installation displays Filter Results By (A,B,C,D.. and so on). I want to remove this, or at least add an option to sort by price high to low, low to high.

Now, before you say you can just press "Price" to sort the category, I know.

However, I need something obvious like a sort by drop down.

Thanks for any help.

18 Dec 2008, 1:50 AM
#2
globaltech avatar

globaltech

New Zenner

Join Date:
Aug 2008
Posts:
1
Plugin Contributions:
0

Re: Filter Results By, Options

I am with you on this, I have been looking for something like this for ages now, can somebody possibly shed some light?
I'll go and get a coffee and wait for a suitable answer :mellow:

18 Dec 2008, 7:52 PM
#3
stew_dee_oh avatar

stew_dee_oh

New Zenner

Join Date:
Dec 2008
Posts:
4
Plugin Contributions:
0

Re: Filter Results By, Options

Well, I figured out a ghetto way to do this, and it works fine for me.

Explanation below
In my zencart installation, when I press the word "Price" to sort the items, it just adds the following code to the current URL

&page=1&sort=3a

My installation is in rows, as apposed to column, with my prices being the the 3rd row, so I'm assuming you would change sort="the # of your price row" then a for ascending and d for descending.

Then I edited my template's tpl_modules_product_listing.php file as follows

I add the following code to near the top, just under PHP copyright/ author info.

<?php
function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}
?>

Then I added the following code right after <div id="productsListingTopNumber" class="navSplitPagesResult back">

Sort by Price:
<a href="<?php echo curPageURL();?>&page=1&sort=3a">Low to High</a> | 
 <a href="<?php echo curPageURL();?>&page=1&sort=3d">High to Low</a><br /><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?>

By playing around with the above code, I'm sure you could make a drop down, and just disable the alpha filter to remove the filter by: option.

Anywho, I attached an image of the final results

And now I'm going to go clean up some cat vomit off my carpet! HURRAY!

31 Jan 2009, 12:07 PM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Filter Results By, Options

Stew-Dee-Oh:

Anywho, I attached an image of the final results

And now I'm going to go clean up some cat vomit off my carpet! HURRAY!

I've been trying to do this for ages but can't figure out how you get your image to enlarge in a funky new window like that and then to make the background dark and shaded out. It's brill, how do you do it??

31 Jan 2009, 3:55 PM
#5
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,627
Plugin Contributions:
0

Re: Filter Results By, Options

I've been trying to do this for ages but can't figure out how you get your image to enlarge in a funky new window like that and then to make the background dark and shaded out. It's brill, how do you do it??

Your question is totally off topic for this thread.

A search for lightbox should help.

31 Jan 2009, 5:57 PM
#6
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Filter Results By, Options

My apologies for being off topic, please delete my comments if possible.

Thanks for the pointer though, I've never heard of lightbox but now I know what to look for.

Many thanks.

10 Feb 2009, 1:32 PM
#7
marks99 avatar

marks99

New Zenner

Join Date:
Nov 2007
Posts:
19
Plugin Contributions:
0

Re: Filter Results By, Options

How do you actually turn off the filter by box so it doesnt appear?