BrockleyJohn Posted March 6, 2018 Share Posted March 6, 2018 This addon has three simple unavoidable changes to core code and an optional simple change to admin categories. Amended code and instructions are provided for 2.3.4BS Edge but with comparable edits it would work on any 2.3+ store. It provides the means to change the default order of products with a category on index.php and supports the same product having different values in different categories. A separate admin page allows you to set all the sort orders within a category at once, and also lets you change the sort order of categories. Upload link coming when available. Dan Cole 1 Quote Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
BrockleyJohn Posted March 6, 2018 Author Share Posted March 6, 2018 Download from apps: https://apps.oscommerce.com/ZQoI0&product-sort-within-category-bs beerbee 1 Quote Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
cDGo IT Consultancy Posted March 10, 2018 Share Posted March 10, 2018 Not sure why I can't add this to the Original addon, but just a little adaption for PHP 7.2 and Dutch language files oscom-product-sort-within-category-bs-php72.zip Quote Link to comment Share on other sites More sharing options...
BrockleyJohn Posted March 10, 2018 Author Share Posted March 10, 2018 Thanks for the Dutch language files - they'll be incorporated into the next release which is in line with the Edge changes for 7.2 compatibility. I'm looking at an enhancement for the manager page too. Quote Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
Dan Cole Posted March 11, 2018 Share Posted March 11, 2018 On 3/6/2018 at 1:25 PM, BrockleyJohn said: It provides the means to change the default order of products with a category on index.php and supports the same product having different values in different categories. A separate admin page allows you to set all the sort orders within a category at once, and also lets you change the sort order of categories. Very nice John...I just installed it on a site running on the GOLD version. It was a pretty easy install and does exactly what you described above. It will certainly bring some organization to those category pages where the products seemed to be listed randomly. It is definitely a must have add-on and one that I'll be using on an ongoing basis. Well done! Dan Quote Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Link to comment Share on other sites More sharing options...
BrockleyJohn Posted March 11, 2018 Author Share Posted March 11, 2018 I've just uploaded Version 1.1 to the Apps area. This version incorporates the Dutch language files prepared by Domé. It adds (by request) the option to view the list of products in a category one page at a time instead of all at once. This option is available on the page itself. Quote Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
♥14steve14 Posted October 2, 2019 Share Posted October 2, 2019 @BrockleyJohn Is there any possibility that this will be updated for Phoenix as its the only product sort order that I can find. I have tried to install it but the difference in code changes is too much for my pay grade to sort. I found similar code in a few files so don't really know what to change. I got all the admin ones changed. Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
burt Posted October 2, 2019 Share Posted October 2, 2019 I added a couple of sort orders in recently, if you search on PRODUCT_LIST_ORDERED that will give you everywhere you need to change to add a new sort; https://github.com/gburton/CE-Phoenix/search?q=PRODUCT_LIST_ORDERED Quote Link to comment Share on other sites More sharing options...
♥14steve14 Posted October 2, 2019 Share Posted October 2, 2019 Thanks for that Gary, I will take a look later. I am really after a custom sort order as over the years I have added more and more products which are the same or similar to other products already stocked and listed and its nice to get them all grouped together in order within the category. Or am I missing something obvious. Its been a long day. Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
burt Posted October 2, 2019 Share Posted October 2, 2019 IIRC (I haven't played in the admin side for a long time) there is a category sort order feature (where you can input numbers). I think you just need similar for products; add in another input on the admin/categories.php page for products "sort_order" get that working first so you can insert numbers to sort things Once that is working; do the changes as above for "PRODUCT_LIST_ORDERED" but call it "PRODUCT_SORT_ORDERED" in any SQL change sort by sort_order DESC|ASC as appropriate It should be `fairly` straightforward, and should not take you more than an hour I'd guess if you break it down into small chunks. Quote Link to comment Share on other sites More sharing options...
♥Moxamint Posted October 2, 2019 Share Posted October 2, 2019 @burt Hi Gary, I have integrated this Product Sort Within Category successfully with the core sorting functionality. I even added the "Product Drag and Sort" you coded many years ago to make custom sorting of the products very easy. However, in <<general.php>> the function tep_create_sort_heading where the sorting table heading is built, it has the following piece of code: $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? LISTING_SORT_DOWN : LISTING_SORT_UP) : LISTING_SORT_UNSELECTED) . '</a>'; If the number of sort filters >9, substr($sortby, 0, 1) will not return the correct $colnum. Instead substr($sortby, 0, -1) will work. This is just for your information - I guess 99.99% of shopowners will not have this issue. Thanks, Eddy Quote Link to comment Share on other sites More sharing options...
burt Posted October 2, 2019 Share Posted October 2, 2019 3 minutes ago, Moxamint said: I even added the "Product Drag and Sort" you coded many years ago Totally forgot about that. Well remembered! Omar_one 1 Quote Link to comment Share on other sites More sharing options...
♥Moxamint Posted October 2, 2019 Share Posted October 2, 2019 2 minutes ago, burt said: Totally forgot about that. Well remembered! I actually think it should go into the core... Eddy ArtcoInc 1 Quote Link to comment Share on other sites More sharing options...
♥Moxamint Posted October 2, 2019 Share Posted October 2, 2019 (edited) 1 hour ago, 14steve14 said: Is there any possibility that this will be updated for Phoenix as its the only product sort order that I can find. I have tried to install it but the difference in code changes is too much for my pay grade to sort. I found similar code in a few files so don't really know what to change. I got all the admin ones changed. Hi Steve, move the required code changes from index.php to includes\modules\content\index_products\cm_ip_product_listing.php and I think that's it. Eddy Edited October 2, 2019 by Moxamint Quote Link to comment Share on other sites More sharing options...
ArtcoInc Posted October 2, 2019 Share Posted October 2, 2019 @Moxamint @burt Does the 'Product Drag and Sort' code allow the shop owner to also sort the categories (or sub-categories)? Or, only products? In addition to includes/modules/content/index_products, does the code changes also have to be applied to includes/modules/content/index_nested ? M PS: I too think this should be added to the core. Quote Link to comment Share on other sites More sharing options...
♥14steve14 Posted October 2, 2019 Share Posted October 2, 2019 33 minutes ago, Moxamint said: Hi Steve, move the required code changes from index.php to includes\modules\content\index_products\cm_ip_product_listing.php and I think that's it. Eddy Sort of tried that but bits have changed and I was unsure on how to modify the old code to match the new. Now I have said that I hope I was looking in the right place. Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
burt Posted October 2, 2019 Share Posted October 2, 2019 10 minutes ago, ArtcoInc said: Does the 'Product Drag and Sort' code allow the shop owner to also sort the categories (or sub-categories)? Or, only products? Products I think. Quote Link to comment Share on other sites More sharing options...
BrockleyJohn Posted October 2, 2019 Author Share Posted October 2, 2019 2 hours ago, 14steve14 said: @BrockleyJohn Is there any possibility that this will be updated for Phoenix as its the only product sort order that I can find. There is every possibility It's one of the things on the list... ArtcoInc 1 Quote Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
♥14steve14 Posted October 2, 2019 Share Posted October 2, 2019 1 hour ago, burt said: Products I think. There is already sort order on the categories as standard unless I am mistaken. Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
BrockleyJohn Posted October 2, 2019 Author Share Posted October 2, 2019 1 hour ago, 14steve14 said: There is already sort order on the categories as standard unless I am mistaken. Yes, that's core (but not very user-friendly!) The sort order manager makes changing it a little easier Quote Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
♥Moxamint Posted October 2, 2019 Share Posted October 2, 2019 1 6 hours ago, ArtcoInc said: @Moxamint @burt Does the 'Product Drag and Sort' code allow the shop owner to also sort the categories (or sub-categories)? Or, only products? In addition to includes/modules/content/index_products, does the code changes also have to be applied to includes/modules/content/index_nested ? M PS: I too think this should be added to the core. The Drag n Sort works for the categories, too. It takes a few code changes for Gary's mod to use the same database fields that Product Sort Within Category uses, but after that, they work harmoniously together. Eddy ArtcoInc 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.