We’re running B2BKing Pro on a WooCommerce site with just over 10,000 products, and we’re running into a critical error when clicking the “Make Offer” button in the Conversations area of the admin.
Suspected Issue:
From our debugging and log analysis (and confirmed by Object Cache Pro logs and memory traces), it appears that the "Make Offer" action attempts to preload all products or product meta before rendering the offer UI.
This results in an out-of-memory error, even with the PHP limit increased to 2GB:
python
CopyEdit
Fatal error: Allowed memory size of 2122317824 bytes exhausted (tried to allocate 20480 bytes)
Does B2BKing pre-load all products or product meta when opening the “Make Offer” UI in admin?
And if so:
Is there a known way to lazy-load only items mentioned in the conversation (cart/session)?
Can the UI or offer builder be restricted to avoid full catalog indexing?
We’d prefer not to disable plugins like Object Cache Pro or reduce our catalog (as we expect to scale further), and ideally want to keep the “Make Offer” option available for bespoke quoting.
Let me know what’s happening behind the scenes and if there’s a hook/filter/workaround we could apply.
Thanks so much – happy to provide more logs if helpful.
Yes, by default the Make Offer UI loads all products to populate the product selector dropdown.
To solve this, I would suggest the following:
You can disable the product selector dropdown and use a text input instead by going to: B2BKing -> Settings -> Offers and disabling "Show product selector in offers"
This will give you a text box where you can: 1. Enter regular text descriptions 2. Reference specific products using the format "product_1234" (where 1234 is the product ID)
This should resolve the memory issues since it won't need to load the entire catalog upfront.
I am trying to create a 'Save Basket' button in the cart. My idea for this is to automate the create offer process and send an offer straight to offers after clicking the button I created.
So I'm currently trying to automate the process of creating an Offer immediately after a Quote Request is submitted via the B2BKing frontend.
We've reviewed your documentation and tested various hooks including:
b2bking_after_send_quote_cart
save_post_b2bking_message
While we can confirm that a conversation (b2bking_message) is being created successfully (we can see the correct post type and meta fields in the database, including conversation_type = quote), our custom plugin isn't able to reliably trigger the offer creation process via code.
We've tried:
Delaying logic with sleep() to ensure the conversation is saved
Logging all meta fields — everything looks correct, including the product meta (b2bking_quote_products)
Using both add_action( 'b2bking_after_send_quote_cart', ... ) and save_post_b2bking_message (with $update === false)
Running offer creation logic manually via b2bking_create_offer_from_conversation() (but we don’t want admin interaction)
Our goal:
We'd like to automatically convert a newly submitted quote request into an Offer (with catalogue pricing and products intact), without requiring admin to click "Make Offer" in the dashboard.
Can you advise:
What is the recommended hook for detecting that a new conversation has been fully saved and is ready to trigger offer creation?
Are there any known limitations when using save_post or b2bking_after_send_quote_cart this way?
Is there a supported method or internal function for programmatically converting a quote request into an offer?
Any clarification or working code snippets would be hugely appreciated. Happy to share our plugin file or logs if needed.
Hi there,
We’re running B2BKing Pro on a WooCommerce site with just over 10,000 products, and we’re running into a critical error when clicking the “Make Offer” button in the Conversations area of the admin.
Suspected Issue:
From our debugging and log analysis (and confirmed by Object Cache Pro logs and memory traces), it appears that the "Make Offer" action attempts to preload all products or product meta before rendering the offer UI.
This results in an out-of-memory error, even with the PHP limit increased to 2GB:
The error originates inside:
We’ve isolated the issue:
All custom snippets disabled
fails when clicking “Make Offer”
Question:
Does B2BKing pre-load all products or product meta when opening the “Make Offer” UI in admin?
And if so:
Is there a known way to lazy-load only items mentioned in the conversation (cart/session)?
Can the UI or offer builder be restricted to avoid full catalog indexing?
We’d prefer not to disable plugins like Object Cache Pro or reduce our catalog (as we expect to scale further), and ideally want to keep the “Make Offer” option available for bespoke quoting.
Let me know what’s happening behind the scenes and if there’s a hook/filter/workaround we could apply.
Thanks so much – happy to provide more logs if helpful.
Kind regards,
Aaron
Hi Aaron,
Thank you for purchasing B2BKing!
Yes, by default the Make Offer UI loads all products to populate the product selector dropdown.
To solve this, I would suggest the following:
You can disable the product selector dropdown and use a text input instead by going to:
B2BKing -> Settings -> Offers and disabling "Show product selector in offers"
This will give you a text box where you can:
1. Enter regular text descriptions
2. Reference specific products using the format "product_1234" (where 1234 is the product ID)
This should resolve the memory issues since it won't need to load the entire catalog upfront.
Let me know if I can help,
Kind regards,
Stefan
Perfect, thank you!
Hi there,
I am trying to create a 'Save Basket' button in the cart. My idea for this is to automate the create offer process and send an offer straight to offers after clicking the button I created.
So I'm currently trying to automate the process of creating an Offer immediately after a Quote Request is submitted via the B2BKing frontend.
We've reviewed your documentation and tested various hooks including:
b2bking_after_send_quote_cart
save_post_b2bking_message
While we can confirm that a conversation (b2bking_message) is being created successfully (we can see the correct post type and meta fields in the database, including conversation_type = quote), our custom plugin isn't able to reliably trigger the offer creation process via code.
We've tried:
Delaying logic with sleep() to ensure the conversation is saved
Logging all meta fields — everything looks correct, including the product meta (b2bking_quote_products)
Using both add_action( 'b2bking_after_send_quote_cart', ... ) and save_post_b2bking_message (with $update === false)
Running offer creation logic manually via b2bking_create_offer_from_conversation() (but we don’t want admin interaction)
Our goal: We'd like to automatically convert a newly submitted quote request into an Offer (with catalogue pricing and products intact), without requiring admin to click "Make Offer" in the dashboard.
Can you advise:
What is the recommended hook for detecting that a new conversation has been fully saved and is ready to trigger offer creation?
Are there any known limitations when using save_post or b2bking_after_send_quote_cart this way?
Is there a supported method or internal function for programmatically converting a quote request into an offer?
Any clarification or working code snippets would be hugely appreciated. Happy to share our plugin file or logs if needed.
Thanks in advance,
Aaron