Tell us what you are trying to do?
I am trying to use the same sorting order on the page hidden link on the page hidden link
The sorting doesn't seem to have any effect on this page. i am using 2 different reusable blocks.
Is there any documentation that you are following?
No
Is there a similar example that we can see?
hidden link
What is the link to your site?
hidden link
Hello and thank you for contacting Toolset support.
I don't believe that using Reusable blocks should alter the sorting of a view, especially if the reusable blocks are being used inside the loop. To better assist you with this issue, I'd like to get access to your website and check how both views are built. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
It would be helpful if you start with a compatibility test to make sure nothing else is interfering there. Please check if this sorting issue appears when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty-Twenty. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at a time to track where the incompatibility is produced.
At first sight, I thought that you are sorting the view with the product price. It turns out that you are sorting the view in the first page using the post type. Check this screenshot hidden link
The view on the second page has a sorting on the menu order, which is different from the first one. Check this screenshot hidden link
I am not sure what type of sorting you want to have, so I'll let you choose it by yourself. Let me know if you still need assistance on this.
Thanks for your quick reply. That is correct, changing it to anything doesn't seem to have effect. I tried setting it to post type, but still it doesn't sort like the first page...
Well, the first page is ordered by post type. Maybe it is just a coincidence that it has prices sorted. The second page is now sorted by menu_order, then by post_title.
What sorting do you want to have? By price? By title? Because as of now, I can only guess.
I changed the block of the second page (with problem) to sort by post type as well. Right(first) page is (hidden link) I want to show woocommerce products sorted by category, which are selected by the category filter... Does this mean I should sort by post type?
I changed it to post type as well, but the sorting doesn't show the expected sorted results...
Well, the post type for products is "product". Basically, almost everything in WordPress is actually a post. Pages are posts from the post type "page". Regular posts are from the post type "post". Media files are stored as a post-type "attachment".
Toolset lets you create your own post types. And you can see all the registered post types in Toolset->Dashboard(the default types, the types registered by the theme or other plugins, and the types created using Toolset).
Now, regarding the sorting of products by their categories, that is not possible out of the box from WordPress/Toolset. It may be implemented, but it will need custom code. Check this StackExchange discussion https://wordpress.stackexchange.com/questions/14306/using-wp-query-is-it-possible-to-orderby-taxonomy
And the custom code in this article hidden link
Please note that custom code is beyond the scope of Toolset Support. If you are not comfortable with programming, you may need to hire a developer.
- https://toolset.com/toolset-support-policy/
- https://toolset.com/contractors/
I hope this helps. Let me know if you have any questions.
Thanks for your reply. Why does it work for the sorting work for this page hidden link and not for the other one?
I believe it is just a coincidence that it works for this page:
hidden link
This is the underlying SQL query for that view, check this screenshot hidden link
SELECT wp_posts.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND (
wp_term_relationships.term_taxonomy_id IN (19,21,22,23,24,25,27,30,39,48)
) AND wp_posts.post_type = 'product' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_type ASC
As you can see, at the end of the query, the sorting is done on the post_type:
ORDER BY wp_posts.post_type ASC
Is there a way to manipulate the query to change the taxonomy_id order?
The taxonomy order cannot be changed using the WP_Query class, which Toolset uses for the views' queries. It will require custom code. Check this StackExchange discussion https://wordpress.stackexchange.com/questions/14306/using-wp-query-is-it-possible-to-orderby-taxonomy
And the custom code in this article hidden link
Thank you very much for your (quick) assistance looking for a solution regarding the issue! I have enough knowledge now regarding this issue and possible fixes!
Have a nice day 🙂