Okay
  Public Ticket #3397836
detect b2b user
Closed

Comments

  •  3
    Grzegorz started the conversation

    How do I detect b2b user with a php function so that I can modify checkout fields for them?

  •  2,285
    WebWizards replied

    HI Grzegorz,

    In the latest plugin version, you can simply use:

    if (b2bking()->is_b2b_user()){ // code for b2b users only } 

    This would check if the current user is B2B or not.


    Alternatively, you can specify a user ID to check:

    if (b2bking()->is_b2b_user($user_id)){ // code for b2b users only } 
    

    Let me know if I can help with anything, or if you have any questions,

    Kind regards,

    Stefan


  •  3
    Grzegorz replied

    Yes, that is what what I was asking for. Thank You!