Hi, I am using the shortcode [b2bking_bulkorder theme=cream], and I want to know how can control the sort by product posting time, and how to control the product quantity to show on one page. Such as I just want to show 20 items on one page, too many products will make the page loading slow.
(1) To set the number of results per page, you can add the following code snippet to your site:
add_filter('b2bking_search_results_number_order_form_cream', function($results){
return 20; // number of results
}, 10, 1);
(this sets it to 20 results but you can choose any number). Please note the number is not 100% exact, because this number is pre-queries, so the final number of results could be something like 18, or 22, it is approximate.
(2) Regarding a sort by product post time, I'm afraid that currently there is no built-in option for this. What you could do if you'd like is to manually sort items. To do that, set it to the "Automatic" sort:
Hi Stefan, thank you for your reply. about sort, it's really hard to use "automatic". The reason I want to sort by post time is to keep being identical with the shop page, the newly posted items in the front, I think it's better for customer browsing. Now in quick order form, it seems very strange to see those old items listed in the front.
Hi, thank you, it's working, I found the latest sort by now, so can I set it as default by the shortcode? like [b2bking_bulkorder theme=cream sortby=latest] ?
Hi, I am using the shortcode [b2bking_bulkorder theme=cream], and I want to know how can control the sort by product posting time, and how to control the product quantity to show on one page. Such as I just want to show 20 items on one page, too many products will make the page loading slow.
Hello Aben,
(1) To set the number of results per page, you can add the following code snippet to your site:
(this sets it to 20 results but you can choose any number). Please note the number is not 100% exact, because this number is pre-queries, so the final number of results could be something like 18, or 22, it is approximate.
(2) Regarding a sort by product post time, I'm afraid that currently there is no built-in option for this. What you could do if you'd like is to manually sort items. To do that, set it to the "Automatic" sort:
Then, on the Products page, in the Sorting tab, you can drag & drop items to set their sort order: https://www.loom.com/share/721bc7b2e1f54f58a7b70cd5e9dbd116?sid=43851dd8-3b58-402d-8256-ce0aa4887507
Kind regards,
Stefan
Hi Stefan, thank you for your reply. about sort, it's really hard to use "automatic". The reason I want to sort by post time is to keep being identical with the shop page, the newly posted items in the front, I think it's better for customer browsing. Now in quick order form, it seems very strange to see those old items listed in the front.
Hi, thank you, it's working, I found the latest sort by now, so can I set it as default by the shortcode? like [b2bking_bulkorder theme=cream sortby=latest] ?
I have a suggestion about the filters. I think it can be the float style so that the title or category in long text can't be
compressed overline, how do you think that?
Attached files: Dingtalk_20240730170209.jpg
Dingtalk_20240730170608.jpg
Thank you, perfect now.