Is there any way to sort the Cart?

Posts: 10
Joined: 02/28/2008

Has anyone been able to find a way to sort the Shopping Cart?

I would like to sort by the SKU, but even if it just ordered the products using the weight I could work with that. Right now it seems like they are just in a random order.

Help if you can!

Thanks!

Posts: 10
Joined: 02/28/2008

FYI - I was able to do this on the client side using JS tablesorter. Documentation is here: http://tablesorter.com

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Holy crap. Shocked That's nice.

Bookmarking...

Posts: 10
Joined: 02/28/2008

Yeah, it was a great find and works great with one small issue.

The tablesorter sorts everything in the td section of a table, it ignores the thead and tfoot tags. Since Ubercart puts all of the items and the Subtotal in the td the Subtotal line also gets sorted. (Currently I have it at the top of the table)

If the subtotal were put into a tfoot in the future the tablesorter would work perfectly.

You can see an example running at my site www.aline.com This is a full Drupal site with Ubercart integration.

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I'd love to redesign the cart page, so I'll take your input here into consideration. I don't see a problem w/ putting the info into a tfoot... I didn't even know that element existed. Eye-wink

Any idea on browser compatibility for tfoot?

Posts: 10
Joined: 02/28/2008

Apparently the browser support is poor - See here http://www.w3schools.com/tags/tag_tfoot.asp

Maybe there is a better way but this was a great quick fix solution for me.

Thanks for the great work on this cart!