Public Ticket #3693254

How to control the sort of bulk order form

Closed
Comments
15 Tickets 9
Aben started the conversation 2 years ago on July 25, 2024 at 3:07pm

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.

2,762
KingsPlugins replied 2 years ago on July 26, 2024 at 9:56am

Hello Aben,

(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:

5895374577.png

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

15 Tickets 9
Aben replied 2 years ago on July 26, 2024 at 10:28am

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.

15 Tickets 9
Aben replied 2 years ago on July 30, 2024 at 6:25am

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] ?

Sign In