Home › Forums › WoodMart support forum › Ajax Products Tabs – Unable to Sort by Sales Count in Gutenberg
Ajax Products Tabs – Unable to Sort by Sales Count in Gutenberg
- This topic has 12 replies, 2 voices, and was last updated 4 hours, 56 minutes ago by
Artem Temos.
-
AuthorPosts
-
September 17, 2025 at 1:28 pm #686798
StravinMarvinParticipantHello WoodMart Support Team,
I’m trying to configure the Ajax Products Tabs block in Gutenberg to display products sorted by their sales count (best sellers), but I’m unable to get this working properly.
What I’m trying to achieve:
Display products in the Ajax Products Tabs sorted by popularity (highest to lowest).
I’ve already tried Setting the “Order by” option to “Meta value” or “Meta value number” while setting the “Meta key” field that appears when you do that to “total_sales”.
This approach doesn’t seem to be working – the products are not sorting by the total_sales field.My setup:
Latest WoodMart Theme Version:
Lastest WordPress Version
Latest WooCommerce Version
Page Builder: Gutenberg (block editor)
Block being used: Ajax Products TabsQuestion:
What is the correct method to sort products by sales/popularity in the Ajax Products Tabs block when using Gutenberg? Is there a specific meta key or setting I should be using, or does this require a different approach?Any guidance would be greatly appreciated.
Thank you for your assistance.September 17, 2025 at 1:41 pm #686800
StravinMarvinParticipantI’ve discovered a critical issue that may help diagnose the problem:
After saving a page with “total_sales” entered in the meta key field and then re-opening the post in the Gutenberg editor, I encounter the following behavior:The block shows an error: “This block contains unexpected or invalid content”
When I click “Attempt Block Recovery”, the recovery process automatically removes/deletes the “total_sales” value from the meta key field
This suggests the block’s validation schema may not be accepting “total_sales” as a valid meta key valueThis appears to be a block validation issue where the Ajax Products Tabs block is rejecting “total_sales” during the editor’s block validation process.
Could this be a bug in the block’s allowed attributes, or is there a specific format/syntax required for custom meta keys in this block?
The fact that the block recovery removes this value suggests it’s being flagged as invalid content by the block’s validation rules.September 17, 2025 at 4:48 pm #686852
Artem TemosKeymasterHello,
Please provide us with your admin access so we can log in and check this on your end.
Thank you in advance.
September 17, 2025 at 4:58 pm #686859
StravinMarvinParticipantHi Artem,
Thanks for the quick response. Rather than providing access to my production site, I’ve reproduced this issue on a clean WordPress installation with only WoodMart theme and default content – the same block validation error occurs there too.
I’ve set up a temporary test site specifically for you to investigate this issue. I’ll provide the login credentials in the private content section below. Please note this is a free testing environment that will automatically delete in 48 hours, so I’d appreciate if you could check it soon.
Once logged in, please navigate to the page titled “Test If Sort By total_sales Is working” where you can see the Ajax Products Tabs block with the issue. You’ll be able to:
See the current setup attempting to sort by total_sales
Try editing the block and witness the “This block contains unexpected or invalid content” error
Note that the block recovery doesn’t work on this test installation (though on my main site it removes the “total_sales” meta key value)This clean test environment confirms it’s not a conflict with other plugins or customizations on my site.
log-in details are in the private content.
Thank you in advance, looking forward to your findings.September 17, 2025 at 5:44 pm #686867
Artem TemosKeymasterHello,
You can fix it by applying patch #
686865
. To do this, go to Dashboard -> WoodMart -> Patcher, find the corresponding patch and click on the “Apply” button. Let us know if it works for you.Kind Regards
September 17, 2025 at 6:52 pm #686887
StravinMarvinParticipantHi Artem,
Thank you for providing the patch. Unfortunately, after applying it, the same issue persists on both my production site and the test site I provided.
I’ve cleared all caches and even tried creating a new page with a fresh Ajax Products Tabs block after applying the patch, but the problem remains exactly the same.
Perhaps there’s something else that needs to be fixed, or maybe I’m missing a step in the implementation?
The test site credentials are still active if you need to investigate further.Thanks for your continued assistance with this issue.
September 18, 2025 at 2:11 pm #687022
Artem TemosKeymasterHello,
It looks like a cache problem. Once we clear the cache, it starts working on your testing website as well.
Kind Regards
September 18, 2025 at 2:28 pm #687025
StravinMarvinParticipantHi Artem,
You’re absolutely right – it’s working perfectly now! Thank you for catching that.
I’m curious though – which specific cache did you clear? I thought I had cleared all caches on my end but obviously missed something. Would be helpful to know for future reference so I can properly test patches.
Thanks again for your help and patience with this issue!
September 18, 2025 at 4:05 pm #687043
Artem TemosKeymasterHello,
We meant that we cleared our browser cache. Most likely, you had cache in your browser as well.
Kind Regards
September 19, 2025 at 7:58 pm #687280
StravinMarvinParticipantHi Artem,
Thanks again for the patch – the sorting by total_sales is working perfectly now.
However, I’ve discovered another issue while testing the Ajax Products Tabs block:
The “Exclude products” functionality doesn’t work when the data source is set to “Sale products”.Steps to reproduce:
Create an Ajax Products Tabs block
Set Data Source to “Sale products”
Add product IDs to the “Exclude products” field
The excluded products still appear in the resultsThis works correctly with other data source options that i tried, but specifically fails when “Sale products” is selected.
I’ve set up another test site to demonstrate this issue. You can find the problematic setup on the page titled “Ajax Tabs – Exclude From Sale Products” – its in the second tab. Login details are in the private content section below.
Could you please investigate this as well?Thanks!
September 22, 2025 at 12:19 pm #687505
Artem TemosKeymasterHello,
You can fix it by applying patch #
687468
. To do this, go to Dashboard -> WoodMart -> Patcher, find the corresponding patch and click on the “Apply” button. Let us know if it works for you.Kind Regards
September 22, 2025 at 3:26 pm #687567
StravinMarvinParticipantPatch #687468 fixed it perfectly. Exclude parameter now works in all tabs with all sources.
Thank you for the quick fix and professional support
September 23, 2025 at 8:40 am #687627
Artem TemosKeymasterGreat, we are glad that you sorted it out. Feel free to contact us if you have any further questions.
-
AuthorPosts
The topic ‘Ajax Products Tabs – Unable to Sort by Sales Count in Gutenberg’ is closed to new replies.
- You must be logged in to create new topics. Login / Register