Author |
Message |
brignola
Newbie
Joined: 06 Feb 2004
Posts: 4
|
 Sorting the items before displaying
Is they a way to sort the items by the description before they get displayed?
|
Wed Jun 06, 07 3:58 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Products are sorted according to the product ID.
What version of the cart are ou using?
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Thu Jun 07, 07 3:38 am |
 |
 |
brignola
Newbie
Joined: 06 Feb 2004
Posts: 4
|
 Sorting the items before displaying
I'm using version 4.0K-4b. I have made many modifications so I do not want to update. If you give me the module and/or line number that does the sort I can make the modification myself. It seems to be whatever the cart is loaded in the database?
|
Thu Jun 07, 07 5:26 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
There is a "Sort your way" hack available for v4.0k-4b, but it is only available to pro members.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Thu Jun 07, 07 5:37 am |
 |
 |
brignola
Newbie
Joined: 06 Feb 2004
Posts: 4
|
I don't need the hack but if you tell me where in what module it should go, I'll write it.
|
Thu Jun 07, 07 5:41 am |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Sorry, since there is a hack to do this and it is for pro members, I can't discuss it.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Thu Jun 07, 07 6:10 am |
 |
 |
daryl
Newbie - Two Blades
Joined: 25 Oct 2007
Posts: 33
|
scottcrew wrote:There is a "Sort your way" hack available for v4.0k-4b, but it is only available to pro members.
how about version 5?
|
Wed Oct 31, 07 8:51 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
Nope no such sorting available... The best way to sort would be to plan your product Id's accordingly.
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Thu Nov 01, 07 5:18 am |
 |
 |
daryl
Newbie - Two Blades
Joined: 25 Oct 2007
Posts: 33
|
what id love to do is have my products displayed in reverse order (most recent product ids shown first) - thanx tho
|
Thu Nov 01, 07 5:05 pm |
|
 |
Dan
Guest
|
i think i remember seeing someplace that perl has a reverse sort. not sure but the store/library/agora_db_lib.pl file is what you need. what i would do is refer to this file and submit_a_query sub and either use the freeform logic for the hack or add a library file in the custom folder. but then again hacking core files with appropriate comments is ok too.
d
|
Thu Nov 01, 07 11:55 pm |
|
 |
daryl
Newbie - Two Blades
Joined: 25 Oct 2007
Posts: 33
|
Dan wrote:...the store/library/agora_db_lib.pl file is what you need. what i would do is refer to this file and submit_a_query sub and either use the freeform logic for the hack or add a library file in the custom folder. but then again hacking core files with appropriate comments is ok too.
d
thanx, i'd love to try this out - and i apologize for this - but 'step by step instructions' would probably be MOST helpful for me since i'm really new to how this all works.
i can somewhat understand lines of code - but lets just assume i dont. if you can help, itd be GREATLY APPRECIATED!
|
Fri Nov 02, 07 11:05 am |
|
 |
Dan
Guest
|
not sure if it will work. backup your agora_db_lib.pl file!!!!!!
for agora 4.0k-4b
line 396 should be...
@database_rows = sort(@database_rows);
pound out that line and add the following...
@database_rows = reverse sort(@database_rows);
so the two lines will look like...
# @database_rows = sort(@database_rows);
@database_rows = reverse sort(@database_rows);
upload and download in ascii only. edit in a plain text editor only. if the change breaks the store or displays stuff in an unexpected manner then remove the new line and take out the "#" for the commented original line and upload.
this is untested so it may or may not work. assuming it works the only thing this will do is reverse the order of products displayed and will be global meaning viewcart and other instances will be reversed as well.
you must download the original file and place it in a safe place. then make a copy to another folder and use the copy as the working file. if you need to restore to original then you can try undoing what you did and uploading. if that fails then upload the backup file in ascii only to overwrite the live file.
let me know how it goes. you must test every aspect of the store... options, pricing quantities more than one and any other thingies you have to manipulate a products such as discounts.
it's possible that sorting will have to be changed elsewhere as well so this may not be a complete solution.
d
|
Fri Nov 02, 07 12:02 pm |
|
 |
daryl
Newbie - Two Blades
Joined: 25 Oct 2007
Posts: 33
|
i have version 5 - does this still apply?
|
Fri Nov 02, 07 12:32 pm |
|
 |
scottcrew
Moderator
Joined: 13 Feb 2004
Posts: 7516
Location: The West Side of MI USA
|
It should... Make sure that you make comments in the file and just after the file version number so that if there is an upgrade to the file at a later date, you will know that you had edited the file and would need to reapply your edit after the update.
HTH!
_________________ God Bless!
Bonnie - AgoraCart Moderator
Get a Gold Membership
|
Fri Nov 02, 07 12:36 pm |
 |
 |
daryl
Newbie - Two Blades
Joined: 25 Oct 2007
Posts: 33
|
worked perfectly - testing out my site, but seems ok so far! thanx!!!!
|
Thu Nov 08, 07 1:17 am |
|
 |
Dan
Guest
|
cool beans. you're welcome.
d
|
Thu Nov 08, 07 1:49 am |
|
 |
|