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.
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:
1 Attachment(s)
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
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.
Code:
<?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">
Code:
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!
Re: Filter Results By, Options
Quote:
Originally Posted by
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??
Re: Filter Results By, Options
Quote:
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.
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.
Re: Filter Results By, Options
How do you actually turn off the filter by box so it doesnt appear?