Public Ticket #4581745

b2bking_account_approved metakey not working on custom form

Closed
Comments
1 Ticket
Kaley started the conversation 1 month ago on August 31, 2026 at 7:25pm

We are using a custom form to register our B2B customers. We have set the metakeys as recommended in the B2BKing guide to customer forms: 

b2bking_account_approved  no
b2bking_b2buser yes
b2bking_customergroup 27822 (number of user group)

The accounts are successfully being treated a B2B accounts and moving into the correct customer group. Once they appear on our website, we can see on our B2B King dashboard the user is in the “New Registrations - Approval Needed” portion of the page. But, when we go to the user’s account page they are already set as Active and the only option we are given is to deactivate/unapprove user.  I checked the meta key in the backend and b2bking_account_approved is set as no, so that shouldn’t be happening. Because the account is never actually in the “pending approval” phase, the email that should be sent once the user is “approved” is not sending. The user also has access to the special pricing immediately, if they were to enter their account. 

I did to test if the “pending approval” option was just generally working on our site. Using the built-in B2B King registration form shortcode for a sample user it was able to enter properly as “pending approval” and trigger expected emails. Checking the user’s metadata they were both set to b2bking_account_approved “no”. So I’m not sure what is different between the two. 

I checked the common culprits, our account page only has the [woocommerce_my_account] shortcode and Separate My Account Page for B2B is set to disabled. 

2,762
KingsPlugins replied 1 month ago on September 1, 2026 at 6:36pm

Hi Kaley,

Thank you for purchasing our plugin! Sorry to hear about that issue,

 

I double-checked our documentation and code, but I cannot find a clear explanation or bug here.

One possibility is that the user may have duplicate values in the wp_usermeta table (e.g. the user may actually have 2 or more b2bking_account_approved database entries, with conflicting value). I'd recommend checking the database table to confirm.

Another possibility could be something like a stale object-cache value, if you use an object cache like Redis or Memcached. Try clearing caches to see if anything changes.

 

If you’d like, we can troubleshoot this directly on the site. For that, we would need a backend login to the site, or a staging clone. Please also let me know where I can find that custom form.

Kind regards,
Stefan

2,762
KingsPlugins replied 1 month ago on September 2, 2026 at 10:08pm

Hi Kaley,

Thanks for getting back to me,

I tried to reproduce this locally by creating a user with only those 3 meta keys (b2bking_account_approved, b2bking_b2buser, b2bking_customergroup), but everything worked as expected on my end - the user correctly showed as pending approval, with the green "Approve User" button on the profile page. I also tested creating a user with no metadata at all, to check whether B2BKing inserts anything on its own that could interfere depending on the order of operations, but it does not - the user simply has no B2BKing data at all.

To answer your question, there is no separate internal "pending state" beyond these meta keys. Approval is controlled purely by the b2bking_account_approved value in the database, so setting that meta key should be sufficient on its own.

 

Looking back at your first message, normally you should see the green "Approve User" button on the profile (https://prnt.sc/00vUKh1v-_GL) rather than "Deactivate / Unapprove". Seeing the deactivate option does suggest the plugin is reading the user as already approved. Could you clarify what exactly you mean by the user being "set as Active"? A screenshot of that section would be helpful, as I wonder whether this might be a different setting or a non-B2BKing feature altogether.

No problem at all if you're not able to share access - we can keep troubleshooting here together. If you are able to share a staging login though, it would help us get to the bottom of this faster.

Kind regards,
Stefan

2,762
KingsPlugins replied 1 month ago on September 4, 2026 at 5:32pm

Hi Kaley,

Thanks for the screenshots, I looked them over and something doesn't quite add up there.

My best guess at this point is that either another plugin or some custom code is changing the approval value on the fly, or possibly an object cache is returning a stale result, etc.. Either way, I think it would be best for us to investigate this directly on the staging site at this point.

 

You can share the credentials here directly in a private message, or alternatively send them to [email protected]

Kind regards,
Stefan

2,762
KingsPlugins replied 3 weeks ago on September 13, 2026 at 11:50pm

Hi Kaley,

My pleasure, glad we got to the bottom of it!

If you run into any further issues or anything else we can help with, just let me know.

By the way, if you have a moment, we'd really appreciate it if you considered leaving a quick rating for the plugin - it's a big help.

Kind regards,
Stefan

Sign In