Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Sort by price with column display....

Sort by price with column display....

Views: 46,932

Results 41 to 60 of 101
15 Oct 2007, 3:32 PM
#41
fjavier avatar

fjavier

New Zenner

Join Date:
Jun 2006
Posts:
20
Plugin Contributions:
0

Sort by price with column display....

I'm not using linked products, but all of them in each category are numbered in ascending order from 1 to x from the very first product added to the newest, assuming I want to use this order this will position the oldest first but if I want to inverse this order my question is the only solution to invert the number order?

16 Oct 2007, 3:25 AM
#42
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sort by price with column display....

Check the listing when accessed by Manufacturer and by a search ...

To change the order you would need to reverse the sort order ... again getting into tricky issues here ...

You could also try backing up your database and set the products_sort_order to the products_id as in theory biggest value is last one in ...

16 Apr 2008, 7:39 PM
#43
zep avatar

zep

New Zenner

Join Date:
Feb 2008
Posts:
29
Plugin Contributions:
0

Re: Sort by price with column display....

Hi great response on this post. I am having one issue though. My products sort by price fine on the category pages (product listings), but I have custom fields in my product table that I would like to sort by. I have it working on my all products, new products, but since the sort is different for the product listing Im stuck.

I added my new sorting options in the tpl_additional_listing _order template and made the option values 8 -11. I then changed the product_prev_next to include the new case statements.

When the sort box option is selected (other then price), the correct sort='x' is included in the url string, but the sort box defaults back to -reset-, and nothing is sorted.

Where do I have to include the new fields in a select statement? I have added them in a few places that seem like they might be going there, but no luck. could it be something else?

I really appreciate any help you guys can lend, as Ive been at this for almost 4 days now.:cry:

Thanks in advance!

17 Apr 2008, 3:59 AM
#44
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Sort by price with column display....

wish i could help you on that one zep. but i think i'm in a somewhat similar predicament.

i have a new site that i used this on. then my client noticed, if they use the manufacturer dropdown to select a group of products, the dropdown sorter no longer works. it only takes them back to the main page.

weird.

does anyone have any idea, either how to get it to also work after it has been filtered by manufacturer.

or just to remove it after it you filter by manufacturer.

any advice would be really appreciated. thanks!

17 Apr 2008, 3:02 PM
#45
zep avatar

zep

New Zenner

Join Date:
Feb 2008
Posts:
29
Plugin Contributions:
0

Re: Sort by price with column display....

Your problem seems a little easier to solve then mine, if you see the url string when you search for a manufacturer :

https://www.XXX.com/index.php?manufacturers_id=63&main_page=index

then add the &sort to the end:

.com/index.php?manufacturers_id=63&main_page=index&sort=3d

it now properly sorts the manufacturer search listing. at least thats a place to start.
look in the Tpl ... additional_sort ...php at the

echo zen_draw_form('sorter_form', zen_href_link($_GET['main_page']), 'get');
echo zen_draw_hidden_field('main_page', $_GET['main_page']);

it looks for the main_page = XXX I think it is then saving that, maybe change the main_page to include an if statement to look for the manufacturers= the fact that it is before the main_page= is whats messing it up.

please keep in mind this is a quick rambling, and may not be exactly how it works..Im a little preoccupied with my issue:(

With my issue, if I put the &sort= or &disp_order= after the url for the product listings I get the default search order.

I might think this has something to do with the fact Im using the the 'all products' listing as a template for the rest of my site (include tpl_all_products .... instead of the original listing template.

17 Apr 2008, 4:06 PM
#46
zep avatar

zep

New Zenner

Join Date:
Feb 2008
Posts:
29
Plugin Contributions:
0

Re: Sort by price with column display....

also, in my previous post, AI forgot to mention the custom vars are being pulled from the DB, I need to alter the 'order by' not the 'select' ...sorry:oops:

17 Apr 2008, 4:18 PM
#47
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Sort by price with column display....

If you want to sort by custom fields, you will have to incorporate that into the sort module. I seriously dont remember where it is, but 1 thing for sure: all the logic codes are more than likely located in includes/modules, and then check for the file that has name lile sort by, order by something.

18 Apr 2008, 7:49 AM
#48
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Sort by price with column display....

thank you for advice, Zep. makes perfect sense. that's the first direction I'm going to try.

Take care.

24 Jun 2008, 2:02 AM
#49
cochlear avatar

cochlear

Zen Follower

Join Date:
Apr 2007
Location:
Sydney
Posts:
110
Plugin Contributions:
0

Re: Sort by price with column display....

Ajeh:

products_date_added from the products table is not built into the products listing ...

It can be added but you would need to include this field in the select statements, built in the title and then the sort order for it ...

The other listings, Featured, All and New Product listings each have this built in as a selection on them and might be of help to you in customizing this information ...
The modification is too advanced for me....

Ajeh is there any plan to get products_date_added built in in the future? I think the drop-down menu sorter used in the other listing pages is excellent from an usability point of view. Would be nice if the category listing pages have it too. :smile:

11 Jul 2008, 1:34 AM
#50
dcsstrategy avatar

dcsstrategy

New Zenner

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

Re: Sort by price with column display....

Hi Yellow, can you help me with my website?

yellow1912:

If you want to sort by custom fields, you will have to incorporate that into the sort module. I seriously dont remember where it is, but 1 thing for sure: all the logic codes are more than likely located in includes/modules, and then check for the file that has name lile sort by, order by something.

5 Sep 2008, 11:55 PM
#51
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: Sort by price with column display....

pensive612:

Yellow,

Thanks so much for this. I seem to be having a problem that others do too. The sorts seem to be random. I've tried it with columns and rows. both the same.

ie. prices low > high - doesn't actually sort them in order. just seems to mix them up.

same with all others except product names

any ideas?

thanks again...

Did you ever get this "sorted" out? I am having the same issue. It works fine on one of my sites, but not on another...go figure!

6 Sep 2008, 3:41 AM
#52
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Sort by price with column display....

Hi Amy,

My problem at the time was really grasping what the code that Yellow so kindly donated, was doing.

Make sure you follow the ID's that you are setting in Configuration > Product Listing. Those are going to be the ID's you want to sort by.

For instance, if the price sort order is '2' than adding 2a to the sort will sort by price - ascending.

I was not correctly matching the ID's to the code.

I hope that makes some sense. If not, let me know...

Good luck.

25 Oct 2008, 3:21 AM
#53
fightthefourwalls avatar

fightthefourwalls

New Zenner

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

Re: Sort by price with column display....

Thanks for this little helper!

Any chance of a revision to the mod that would make it show only when there are 2 or more products in a category & all its subcategories (I am using the all_sub_cats_products mod).

Cheers,
Nick.

13 Nov 2008, 11:20 PM
#54
furuide avatar

furuide

New Zenner

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

Re: Sort by price with column display....

Marvellous, just what I needed.. Thanks Yellow

Took the code from page 3 on this thread..

instead of putting the newly created file into:
includes/templates/YOUR_CURRENT_TEMPLATE

Put it in to:
includes/templates/YOUR_CURRENT_TEMPLATE/template

Also had to find the product listing php file in:

In includes/templates/template_default/templates/tpl_index_product_list.php

As it wasn't already in the old override directory.

Soopa Doopa, cheers.:bigups:

7 Jan 2009, 2:13 AM
#55
movefearlessly avatar

movefearlessly

New Zenner

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

Re: Sort by price with column display....

LOVE this thread, the info has been very helpful.

i'm still looking for a way to sort my column grid pages by date added - can anyone give me a nudge in the right direction?

8 Aug 2009, 5:49 PM
#56
plsony avatar

plsony

New Zenner

Join Date:
Jul 2009
Posts:
54
Plugin Contributions:
0

Re: Sort by price with column display....

Thanks guys!

I used the code on Page 3 to add sort by price, works great!

However on the main page it no longer shows my define_main_page.

How do I get it back without loosing the added search functionality?

http://www.midwestnotebooks.com/index.php

8 Aug 2009, 6:04 PM
#57
plsony avatar

plsony

New Zenner

Join Date:
Jul 2009
Posts:
54
Plugin Contributions:
0

Re: Sort by price with column display....

The missing define_main_page looks like this:

http://midwestnotebooks.com/index.php?main_page=page_2

This logo and such used to be on the main page but it does not show up. I have left the code in the define main page editor and added it to page two to make it easier to understanf what I am trying to do.

Thanks in advance for your help

9 Oct 2009, 9:09 AM
#58
hedron avatar

hedron

Zen Follower

Join Date:
Feb 2009
Posts:
138
Plugin Contributions:
0

Re: Sort by price with column display....

Yellow's mod above on page 3 works.

Can that be implemented also with Specials?

Thanks. :smile:

26 Oct 2009, 7:49 PM
#59
neboztik avatar

neboztik

New Zenner

Join Date:
Jan 2009
Location:
Czech Republic
Posts:
59
Plugin Contributions:
0

Re: Sort by price with column display....

hedron:

Yellow's mod above on page 3 works.

Can that be implemented also with Specials?

Thanks. :smile:
Yellows´s mod is based on tpl_modules_listing_display_order.php so if you want to edit sorting you can delete some lines of the code in this file. I have another problem - this doesn´t work with manufacturies listing.

2 Nov 2009, 2:54 PM
#60
t258jgn avatar

t258jgn

New Zenner

Join Date:
Oct 2009
Posts:
4
Plugin Contributions:
0

Re: Sort by price with column display....

I've followed what yellow1912's mod from page 3.

But I'm still getting the same problem as pensive612 below.

pensive612:

Yellow,

Thanks so much for this. I seem to be having a problem that others do too. The sorts seem to be random. I've tried it with columns and rows. both the same.

ie. prices low > high - doesn't actually sort them in order. just seems to mix them up.

same with all others except product names

any ideas?

thanks again...

Can anyone help???

Thx