I’ve been trying to write some PHP for a little plug-in that will update B2B stock settings for both PRODUCTS and VARIATIONS. I’ve attached here the parameters that I need to update with my code, but I think I have the key phrases wrong. Can you give me the current key phrases for each, please?
I’ve tried updating these via the standard B2BKing UI, but it’s just not working as it should, hence why I’m writing code.
If possible, I would recommend first trying to resolve this through the regular UI interface as normally this would be more reliable. Could you share more details about the specific issues you're experiencing with the UI? This would help me better understand if there might be a conflict or bug that we need to address.
I could also help troubleshoot any issue directly on the site if you can share access.
Alternatively I am also happy to provide you with documentation regarding the exact meta keys if needed. However, please note that this can be somewhat complex as the implementation differs between simple products and variable products/variations and there are 6-7 keys used.
So I am happy to share that if you prefer it, but it might be simpler to try and solve it via the regular UI if that's an option.
Sorry, when rereading my message I can see that I’m wasn’t being completely clear.
I can indeed use the UI to update stock for both products (though this isn’t working exactly as I expected) and variations, it’s just that it will take me about 20 hours to do so!
I was hoping to change the stock values using PHP as it might save me a day or two. :)
Hello,
I’ve been trying to write some PHP for a little plug-in that will update B2B stock settings for both PRODUCTS and VARIATIONS. I’ve attached here the parameters that I need to update with my code, but I think I have the key phrases wrong. Can you give me the current key phrases for each, please?
I’ve tried updating these via the standard B2BKing UI, but it’s just not working as it should, hence why I’m writing code.
Many thanks!
James
Attached files: Screenshot 2025-06-23 at 5.27.36 pm.png
Screenshot 2025-06-23 at 5.26.25 pm.png
Hi James,
If possible, I would recommend first trying to resolve this through the regular UI interface as normally this would be more reliable. Could you share more details about the specific issues you're experiencing with the UI? This would help me better understand if there might be a conflict or bug that we need to address.
I could also help troubleshoot any issue directly on the site if you can share access.
Alternatively I am also happy to provide you with documentation regarding the exact meta keys if needed. However, please note that this can be somewhat complex as the implementation differs between simple products and variable products/variations and there are 6-7 keys used.
So I am happy to share that if you prefer it, but it might be simpler to try and solve it via the regular UI if that's an option.
Kind regards,
Stefan
Hi Stefan,
Many thanks for getting back to me.
Sorry, when rereading my message I can see that I’m wasn’t being completely clear.
I can indeed use the UI to update stock for both products (though this isn’t working exactly as I expected) and variations, it’s just that it will take me about 20 hours to do so!
I was hoping to change the stock values using PHP as it might save me a day or two. :)
All the best,
James
Perhaps we start with just the keys and go from there? It will only be a one-off thing, anyway.
If you can send me the keys, please?
All the best,
James
Any chance of getting these keys today? :)
Sorry to ask,
James
Hi James,
Thanks for your patience on this,
I prepared a PDF with the keys used for both simple and variable products / individual variations. Please find it attached,
Let me know if you need any clarifications,
Stefan
Attached files: B2BKing Keys.pdf