Barn2.co.uk WooCommerce Product Table Plugin Only Sorts Alphabetically Not Numerically - Beware
For a while now I’ve been using the Tablepress Plugin for WordPress on my other websites to build affiliate product comparison tables. After my sites grew, and products multiplied, it became more tedious to make and keep up with the ever-growing product comparison tables. I decided the best way to go about fixing this issue was to enter affiliate products as actual products and have them put into tables dynamically. My choices for this endeavor were the free WooCommerce plugin, obviously, and the premium plugin WooCommerce Product Table by Barn2.
The WooCommerce Product Table Numeric Column Sorting Problem Arises
After some trial and error I finally got my huge excel list of products finished and imported into WooCommerce as products. I then fired up Barn2’s WooCommerce Product Table plugin and started trying out different tables using the documented shortcodes. Not surprisingly, some of my columns of numerical data were being displayed Alphabetically, like this:
(Just pretend these comma separated lists are vertical columns in a table – for simplicity’s sake 😜)
1, 10, 14, 100, 1000, 2, 20, 28, 200, 2000, 3, 30, 39, 300, 3000
rather than
1, 2, 3, 10, 14, 20, 28, 30, 39, 100, 200, 300, 1000, 2000, 3000
Not a problem – I’ll just use something in the shortcode or plugin’s back-end to set certain columns to numeric ordering rather than alphabet ordering, I thought. Tablepress has a place to insert commands to the DataTables Javascript such as "columnDefs": [ "type": "formatted-num", "targets": [ 2, 3 ] ] to make the third and fourth columns of a table be sorted by the formatted-num option with formatted numbers such as “1,495”, but there are also options like num for using unformatted numbers like “1495”.
Surely a Premium plugin from Barn2 will have this feature. Barn2’s WooCommerce Product Table plugin costs $99 a year for one website, $179 a year for 5 websites, and $359 for 20 sites. It’s definitely not on the cheaper side of the scale when it comes to WordPress premium plugins, so surely they use some of that money for plugin development and continually updating with new features and functionality, right?
The WooCommerce Product Table Numeric Column Sorting Problem Worsens
To my horror, the only thing I could find on the Barn2.co.uk website regarding sorting WooCommerce Product Table columns numerically was this page. Barn2’s solution to columns of numerical data not sorting properly is to go back into categories or product attributes and add zeroes to all of the numeric values to fix the problem. That would mean changing
1, 10, 14, 100, 1000, 2, 20, 28, 200, 2000, 3, 30, 39, 300, 3000
to
0001, 0010, 0014, 0100, 1000, 0002, 0020, 0028, 0200, 2000, 0003, 0030, 0039, 0300, 3000
in order to achieve the very ugly result of:
0001, 0002, 0003, 0010, 0014, 0020, 0028, 0030, 0039, 0100, 0200, 0300, 1000, 2000, 3000
Awesome. That sound like it will be fun doing on a thousand products that each each have 5 attributes of pure numerical data not lead with extra zeroes. 😒
You would think such a major drawback like not having the ability to sort columns numerically would be noted on their sales pages rather than being buried in the documentation. I have submitted a feature request to have this limitation fixed and hopefully they will take it into consideration to be fixed sooner rather than later. Otherwise, I probably won’t be keeping my hefty subscription to their plugin for another billing period.
By: John
https://www.jsnowcreations.com/reviews/wordpress-plugin-reviews/barn2-woocommerce-product-table-only-sorts-alphabetically/












