Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Product Sort Within Category


Recommended Posts

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.

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

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

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.

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

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!  :thumbsup:

Dan

Link to comment
Share on other sites

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.

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

  • 1 year later...

@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.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

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.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

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;

  1. 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;

  1. do the changes as above for "PRODUCT_LIST_ORDERED" but call it "PRODUCT_SORT_ORDERED"
  2. 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.

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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 by Moxamint
Link to comment
Share on other sites

@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.

 

Link to comment
Share on other sites

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.

 

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

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...

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

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

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

 
 
 
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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...