=== Rearrange Products for WooCommerce === Contributors: aslamdoctor Donate link: https://github.com/sponsors/aslamdoctor Tags: woocommerce, product, reorder, rearrange, sort Requires at least: 6.6 Tested up to: 6.9 Requires PHP: 7.4.0 License: GPL-3.0-or-later License URI: http://www.gnu.org/licenses/gpl-3.0.html Stable Tag: 5.0.11 Boost WooCommerce sales with the Rearrange Products for WooCommerce plugin. Easily reorder products with a simple drag-and-drop tool! == Description == Take Full Control of Your WooCommerce Product Sort-Order Do you want to decide which products appear first in your WooCommerce shop? Rearrange Products for WooCommerce gives you full control over product ordering so you can highlight your best-selling, featured, or new products exactly where you want them. This plugin is built specifically for WooCommerce stores and helps improve both customer experience and store performance. With an easy-to-use drag-and-drop interface, you can: * Reorder/Rearrange products on your main Shop page. * Set custom product order for specific categories and sub-categories. * Manage product display without touching any code. == Why Choose Rearrange Products for WooCommerce? == 1. Better Shopping Experience Help customers find the right products faster by displaying them in a logical and attractive order. 2. More Visibility for Key Products Promote best-selling, featured, or seasonal products by placing them at the top. 3. Higher Conversions Showing the right products first can lead to more clicks and increased sales. == Features == * Fully compatible with WooCommerce. * Simple drag-and-drop product sorting. * Custom sorting for categories and sub-categories. * Lightweight plugin with fast performance. * No coding knowledge required. Download Rearrange Products for WooCommerce Today! Make your WooCommerce store easier to browse and more effective at selling. Start organizing your products the way you want and give your customers a better shopping experience. Note: WooCommerce must be installed and activated before using this plugin. == Important Notes == 1. If you are using a page builder plugin to display your products, this plugin may not work properly with it. We recommend contacting your page builder’s support team to check compatibility and get assistance. 2. If you deactivate this plugin, any product rearrangements you’ve made will be turned off. You can restore them at any time by reactivating the plugin. 3. If you delete or uninstall this plugin, all product rearrangements will be permanently removed and cannot be recovered. == Installation == 1. Go to your WordPress Admin Dashboard. 2. Navigate to Plugins → Add New. 2. Search for “Rearrange Products for WooCommerce.” 4. Click Install, then Activate. If WooCommerce is not installed or activated, this plugin will not activate. 5. Go to Admin → Rearrange Products and reorder products using drag and drop. 6. Use the “Sort by Categories” tab to arrange products by category. == Frequently Asked Questions == = How do I use this plugin? = Go to Admin → Rearrange Products and drag and drop products into your preferred order. To sort by category, open the “Sort by Categories” tab. = Can I recover my product order after deactivating or deleting the plugin? = 1. Deactivating the plugin will temporarily disable your custom product order. 1. Deleting or uninstalling the plugin will permanently remove all product rearrangements, and they cannot be restored. = Does this plugin work with WooCommerce shortcodes? = Yes. You can override the default sorting of products added via shortcodes such as: `[product_category category="my-category-slug"]` To enable this: 1. Go to Admin → Rearrange Products → Settings 2. Enable “All Loops (including shortcodes)” == Troubleshooting == **If your custom product order is not showing on the Shop page:** 1. Go to Admin → Appearance → Customize 2. Select WooCommerce → Product Catalogue 3. Find Default Product Sorting 4. Set it to “Default sorting (custom ordering + name)” **If you have a large number of products and changes are not saving** This may be due to server limits. Ask your hosting provider to increase: * memory_limit * max_execution_time After updating these settings, try saving the product order again. **If category sort orders stopped working after upgrading from v4.x to v5.x** The v5.0.2 update moved sort data from the old storage format to a new custom table. In some cases this migration may have failed silently, causing category-specific sort orders to appear broken. After updating to v5.0.10 or later, your category sorting should work automatically (the plugin now falls back to the old data). To fully fix the issue: 1. Go to **Admin → Rearrange Products → Troubleshooting** 2. Open the **"Re-run Data Migration"** panel 3. Click **"Re-run Migration"** 4. Verify the success message shows your migrated record counts == Plugin Demo == [youtube https://www.youtube.com/watch?v=kcgVe_1QzJc] == Screenshots == 1. The plugin at work reordering all products 2. Ability to select multiple products and sort 3. Products sorted by Categories for reordering 4. Shortcut link under Categories section to sort by categories 5. Settings to Apply sorting on Main loop or All loops == ChangeLog == = Version 5.0.10 = * Fixed: Product sort order resetting to last position when editing/saving a product at the first position in a category * Fixed: `Database::get_sort_order()` now correctly distinguishes between "no entry" (null) and "sort_order = 0" (first position) * Fixed: Category-specific sort orders broken for users who upgraded from v4.x due to silent migration failures * Fixed: Migration error handling in `Database.php` — `create_table()`, `migrate_data()`, and individual migration methods now properly detect and report failures * Added: Postmeta fallback in frontend sorting — category pages now automatically fall back to legacy `rwpp_sortorder_{id}` postmeta data if the custom table is empty * Added: "Re-run Migration" button on Troubleshooting page to manually re-populate the custom table from legacy data = Version 5.0.9 = * Fixed: Product category shortcode sorting issues when "Apply Sorting To" is set to "All Loops" * Added: WPML support - Sync product order across language translations for Global sorting = Version 5.0.8 = * Fixed: Plugin sorting no longer affects secondary product queries (widgets, shortcodes, custom blocks) on category pages * Fixed: Footer product blocks now display correctly with their configured sorting on category archives * Improved: Sorting filters are now properly removed after main query execution = Version 5.0.7 = * Fixed: Products moving to top of list after editing/updating * Improved: Product updates now preserve existing sort order in custom table * Tested with WooCommerce 10.4.3 = Version 5.0.6 = * Fixed: Category sorting page not loading due to URL routing mismatch * Fixed: Critical data loss bug where unloaded products lost sort orders during pagination * Improved: Removed automatic orphan cleanup that was causing data loss in category-specific sorting = Version 5.0.5 = * Improved: Troubleshooting page with more customer-friendly language and clearer explanations * Improved: Updated troubleshooting titles to be more relatable for end users * Improved: Added helpful context and guidance for common issues * Improved: Simplified technical language in server configuration section = Version 5.0.4 = * Fixed: Missing vendor and build files = Version 5.0.2 = * Major Release: Complete architectural refactor with unified database storage * Added: Custom database table `wp_rwpp_product_order` for centralized sort order storage * Added: Support for both global and category-specific product sorting * Added: Automatic data migration from legacy storage systems (menu_order and postmeta) * Added: Confirmation modal for product order changes with undo functionality * Added: Load More button for pagination (replaced infinite scroll with manual control) * Added: AJAX load more functionality to load products in chunks of 100 * Added: CSS variables and design tokens for better maintainability and theming * Added: New SCSS buttons component file for consistent styling * Added: Comprehensive debug logging for troubleshooting load more issues * Improved: Database query optimization with indexed JOINs instead of meta_query * Improved: COALESCE fallback logic for graceful degradation * Improved: Chunked processing for large product datasets * Improved: UI redesign with custom category dropdown * Improved: Removed inline styles from templates (all styles now in SCSS) * Improved: Cleaner HTML markup without redundant success messages * Improved: Better separation of concerns between structure and styling * Improved: Performance by loading initial products in chunks * Enhanced: Performance with production-ready asset optimization * Enhanced: User feedback with loading states on Load More button * Enhanced: Better UX with explicit load more control instead of auto-scroll * Fixed: Category view now includes subcategory products (matching frontend behavior) * Fixed: WP_DEBUG reference error in JavaScript by localizing debug flag * Fixed: WP_Query namespace issue in AJAX handler * Fixed: AJAX action registrations to execute properly * Updated: Build system to @wordpress/scripts with modern Sass implementation * Refactored: Complete SASS file structure with variables for colors, typography, spacing * Tested with WordPress 6.9 and WooCommerce 10.4.2 = Version 4.3.3 = * fixed: Attempt to read property “term_id” on null * tested with wordpress version 6.8.1 * tested with woocommerce version 9.8.3 = Version 4.3.2 = * fixed: is_tax was called incorrectly * fixed: settings for effected loops was not working properly * tested with wordpress version 6.8 * tested with woocommerce version 9.8.2 = Version 4.3.1 = * tested with wordpress version 6.7.1 * tested with woocommerce version 9.5.2 = Version 4.3.0 = * Added settings to enable/disable override main loop or all loops * tested with wordpress version 6.5.3 * tested with woocommerce version 8.9.1 = Version 4.2.0 = * Make plugin compatible with HPOS ( High-Performance Order Storage ) * tested with wordpress version 6.4 * tested with woocommerce version 8.2.1 = Version 4.1.7 = * Fix - under admin, some products not visible while sorting by category * tested with wordpress version 6.3 * tested with woocommerce version 8.0.1 = Version 4.1.6 = * Fix enqueue_assets hook not checking hook name properly when site is using different language. Ref: https://wordpress.org/support/topic/products-are-no-longer-displayed-in-categories/#post-16934448 = Version 4.1.5 = * Fix sort by "Latest" option not working = Version 4.1.4 = * tested with wordpress version 6.2.2 * tested with woocommerce version 7.9.0 * Added fix where products were missing on categories pages * Added fix where is_product_category() was not working * other minor bug fixes & cleanup = Version 4.1.3 = * tested with wordpress version 6.2.0 * tested with woocommerce version 7.7.0 * moved the plugin pages to top level of admin menu * bug fixes = Version 4.1.2 = * tested with wordpress version 6.1.1 * tested with woocommerce version 7.2.0 * added page for troubleshooting guidelines = Version 4.1.1 = * Added translations for: - English (Canada) - English (UK) - French (France) - Spanish (Colombia) - Spanish (Venezuela) - Russian - Hindi - Spanish (Ecuador) - Chinese (China) - Spanish (Spain) = Version 4.0.9 = * added Troubleshooting steps for fix missing products issue * tested with woocommerce version 6.5.1 = Version 4.0.8 = * updated all node/npm packages to latest stable version * tested with wordpress version 5.9.3 * tested with woocommerce version 6.4.1 * added notes for developers for contributing to plugin = Version 4.0.5 = * added global translation support = Version 4.0.4 = * added plugin translation support = Version 4.0.3 = * minor security patch to escape sql query = Version 4.0.2 = * minor security patch * tested with woocommerce version 6.3.1 = Version 4.0.1 = * delete entries from postmeta table when plugin uninstalled/deleted from admin * fixed the issue that was making navigation menus unordered = Version 4.0.0 = * Fixes made for user roles and permissions checking = Version 3.0.9 = * Do not escape post title = Version 3.0.8 = * Updated code to follow WPCS Protocol * Check for plugin authorization properly * Add CSRF security on Ajax requests = Version 3.0.7 = * Security fixes: disable direct code file access from browser = Version 3.0.6 = * Minor security fixes = Version 3.0.5 = * Security Fixes: Removed nonpriv handlers * Security Fixes: Added security to remove all SQL injections added as input * Minor fix for checking product loop inside pre_get_posts hook = Version 3.0.4 = * Fixed: While sorting by categories, some products that are added recently were not visible. * Code re-factoring and cleanup. = Version 3.0.3 = * Fixed: Keep default sort order on frontend if it was not updated for Categories. = Version 3.0.2 = * Fixed: Category orders not showing any products due to meta_query not found. = Version 3.0.1 = * Re-published the files as in v3.0.0, the files were not published properly = Version 3.0.0 = * Ability to sort products by any product category * Ability to select multiple products by single click and sort them at once * Removed feature to sort by Tags as it was not being used and also had unresolvable bug due to WC limitations * Tested for Woocommerce Version 5.7.1 and Wordpress Version 5.8.1 * Code cleanup = Version 2.3.6 = * Tested for Woocommerce Version 4.8.0 and Wordpress Version 5.6 * Code cleanup = Version 2.3.5 = * Tested for Woocommerce Version 4.7.0 and Wordpress Version 5.5.3 * Tested with Storefront Theme Version 2.9.0 * Minor bug fixes with Group by Categories & Tags sorting. * In group by categories parent category was also including products from child categories. So they were repeated to 2 places. This has been updated to show products exactly below their parent categories only. (changed 'include_children' to "false" in tax_query) * Styling issue fixed for long product names * Added button to expand/collapse all categories & tags = Version 2.3.1 = * Tested for Woocommerce Version 4.3.1 and Wordpress Version 5.4.2 * Added important notices for sorting by categories and tags = Version 2.3.0 = * Added feature to group and sort by Product Tags * Added feature to move products up, down, top, bottom of the list using arrow buttons * Added serial numbers(not ID) to each products so it can give us idea on which product's sort order we changed * Added current user check for "manage_woocommerce" capability * Plugin information updated to properly show "tested upto" version of Woocommerce * Added security to disable direct access to the plugin PHP files = Version 2.2.0 = * Added expand/collapse feature on categories to clear the clutter * Fixed a minor bug that was happening while activating the plugin * Tested for Woocommerce Version 4.0.0 and Wordpress Version 5.3.2 = Version 2.1.2 = * Hide Products from list that are set as "private" * Added a fix for bug that was checking the user role * Tested for Woocommerce Version 3.7.1 and Wordpress Version 5.2.4 = Version 2.1.1 = * Added shortcut button to edit products * Tested for Woocommerce Version 3.7.0 and Wordpress Version 5.2.3 = Version 2.0.0 = * Added feature to group products by categories * Added feature to preview product info from same page * Added some minor bug fixes * Tested for latest Woocommerce version 3.6.3 = Version 1.1.1 = * Added fix as the plugin was not working for some people. As it was using static table prefix "wp_". So changed it to dynamic table prefix to work will all kind of WP Databases. * Tested for latest Woocommerce version 3.5.3 = Version 1.1.0 = * Added capability to handle huge amount of products. * Combined multiple sql update queries into one query. = Version 1.0.0 = * Initial release.