Okay
  Public Ticket #4571491
Purchase lists, quantity rules, backorders and bulk order form
Open

Comments

  •  1
    Danny Whitehead started the conversation

    Hi.

    I'm working on adding Purchase Lists to our B2B site. On my local dev environment, I've activated the feature, but it seems to have a couple of issues.

    A) It doesn't seem to apply quantity rules like the Bulk Order Form does.

    B) It doesn't seem to respect the back-order status of products, so a user can't add out-of-stock items that are available on back-order to their cart.

    Also, on all our product pages, we've replaced the standard Woo 'Add to Basket' buttons with a Bulk Order Form containing all the product variations (our products tend to have a lot of them). If it's possible, we'd like to add an 'Add to Purchase List' button next the the 'add to basket' button on all Bulk Order Forms.

    Once we've got it functioning correctly, we will be trying to get the Purchase Lists to mimic the extensive custom styling I've made for Bulk Order Forms. This might be for a separate ticket, but if you have any tips on how to target the Purchase List CSS with the CSS I built for Bulk Order Forms, that would be very helpful.

    Thanks.

  •  2,739
    WebWizards replied

    Hi Danny,

    Thanks for reaching out,

     

    A) Quantity Rules
    Purchase lists are not really designed to apply quantity rules. The idea is that these lists act as saved supply lists (e.g. "weekly inventory branch A", "monthly restaurant supply"), and a customer might add one or multiple lists to cart, or mix them with other items. Since the saved quantities are intentional, we don't want to override them automatically. If your use case is different, let me know more about how lists are used on your site - perhaps we can achieve something with some custom code.

     

    B) Backorders
    I looked into this and it does indeed look like this was a bug. Please update to the attached version of B2BKing Pro, which should resolve the problem.

     

    C) Add to Purchase List Button
    Just to clarify, are you using the B2BKing Bulk Variations Table (https://woocommerce-b2b-plugin.com/docs/bulk-variations-table-grid/)? Would the idea be to have a button that adds multiple variations (with different quantities) to a new or existing purchase list in a single click?

     

    D) Custom CSS
    For the styling, you will generally need to use highly specific selectors. However, there is a snippet you can use to change the purchase list theme to "cream", close to the bulk order form design (it might automatically apply your custom CSS):

    add_filter('b2bking_purchase_list_display_theme', function($theme){
    return 'cream';
    }, 10, 1);

    Please note that with this specific display, users cannot add new rows directly to the list; they can only work with the rows that are already there.

     

    Kind regards,
    Stefan

  •   WebWizards replied privately
  •  1
    Danny Whitehead replied

    Hi Stefan.

    Thanks for the response.

    A) Quantity Rules

    That makes sense, but we don't want customers adding quantities to the Purchase Lists that they can't actually purchase once they add them to their basket. It would be great if there were an option in B2BKing to apply Quantity Rules when making and editing Purchase Lists.

    B) Backorders

    Thanks for that. The updated plugin seems to fix it.

    C) Add to Purchase List Button

    We're actually using the Bulk Order Form (not the Bulk Variations Table) on each product page, with the [b2bking_variations_table_any] shortcode. But having thought about, I've decide not to add an 'Add to Purchase List' button, so don't worry about this.

    D) Custom CSS

    This code snippet does indeed apply a lot of the custom Bulk Order Form styling to Purchase Lists, but as you warned, it makes it impossible to edit them. Is there any way to fix that? The specific selectors for the default style Purchase Lists are needles in haystacks!

    If you'd like to check out how our current Bulk Order Forms are styled and used on product pages, you already have an admin account on our live site (no staging for this one). If you need the details, contact me separately to this public ticket.

    Thanks,

    Danny

  •  2,739
    WebWizards replied

    Hi Danny,

    Thanks for the update.

    D) Unfortunately the cream theme doesn't really have the UI to support editing - it lacks buttons for adding/removing items and similar functionality, so making it fully editable would require quite a lot of custom work. It's not something I can solve with a quick snippet at this point, though we are considering it as an official setting in a future update.

    A) I can take a closer look at this one. It may be possible to enable quantity rules on purchase lists via an update + code snippet. Would you like me to look into it for the default theme?

     

    Kind regards,
    Stefan

  •  1
    Danny Whitehead replied

    Hi Stefan.

    Thanks for the reply.

    If you can take a closer look at A) and provide a way to enable quantity rules on purchase lists, that would be appreciated.

    Regarding the styling, it looks like I'll have to revert to the default purchase lists theme, find the styles and apply the styling separately from my bulk order form css.

    Thanks.

  •  2,739
    WebWizards replied

    Hi Danny,

    Thanks for confirming,

     

    I've taken a closer look and was able to add a minimal feature for it.

    To enable it, please follow these steps:
    1. First, deactivate your existing version of B2BKing Pro.
    2. Upload and activate the attached updated version.
    3. Add the following PHP code snippet to your theme's functions.php file or any code snippets plugin:

    add_filter( 'b2bking_purchase_list_quantity_rules', '__return_true' );

     

    Let me know if you run into any issues,

    Kind regards,
    Stefan

  •   WebWizards replied privately