Public Ticket #3832056

separate b2b stock

Closed
Comments
3 Tickets 1
Matt Carswell started the conversation 2 years ago on March 4, 2025 at 9:23pm

We are using separate b2b stock to enable b2b only backorders, but want separate stock set to "no" on all items and "variations." Is there a code snippet to make that the default on new items/variations? Right now new items we create have separate b2b stock set to "yes" by default. 

2,762
KingsPlugins replied 2 years ago on March 9, 2025 at 9:52pm

Hello Matt,

I wrote a code snippet that I believe should do that: https://pastecode.io/s/36bxqu3e

This can be added to functions.php or any code snippets plugin.

 

When the "new product" page loads, it should set by default:

  • Separate B2B Stock? No
  • B2B Allow Backorders? Allow

 

Let me know if that works for you or if you need any adjustments,

Kind regards,

Stefan

Sign In