Okay
  Public Ticket #4511272
Logg innn Meta/Google
Open

Comments

  • Aleksander started the conversation

    Hi team,

    We want to let both customers and sellers log in only through Google or Facebook.

    Here’s what we’re trying to do:

    1. Use a custom /login page with only Google/Facebook buttons (no password form).
    2. When users log in:

      • If they are vendors, redirect them to /vendor-dashboard/.
      • If they are not vendors, redirect them to /become-a-seller/ or My Account.
    3. Right now, MarketKing seems to override the My Account page, so our login page doesn’t show up correctly.

    Can you please tell us:

    • How to disable or bypass MarketKing’s My Account override, so we can use our own /login page?
    • What is the official way to detect vendor users (function or hook)?
    • Is there a way to prefill the vendor application form with data from WordPress user meta (name, email, phone)?
    • And what’s the recommended hook to redirect vendors vs. customers after login?

    We just want to make the login and seller onboarding as smooth as possible.

  •  2,568
    WebWizards replied

    Hi Aleksander,

    Thanks for reaching out, glad to assist.

     

    To check if a user is a vendor, you can use:

    marketking()->is_vendor(get_current_user_id())

    Regarding the My Account page override - MarketKing doesn't normally override My Account, so I'm not entirely sure what you're seeing there. Could you explain a bit more about what's happening? That would help me understand the issue better.

     

    For the login redirect you're trying to achieve (vendors → /vendor-dashboard/, non-vendors → /become-a-seller/ or My Account), you can use this code snippet:

    https://pastecode.io/s/drfszd40

    This applies to the woocommerce_login_redirect hook. However, whether this works will depend on whether your Google/Facebook login plugin uses this same hook.

     

    Regarding prefilling the vendor application form with user meta data (name, email, phone) - MarketKing should actually do this automatically on the vendor registration form, IF that data already exists. This is based on the "billing connection" setting of each registration field. For example, if the billing connection is set to "company name" and the user already has company name saved under their billing info, that field should be prefilled in the become a vendor form.

     

    Let me know if you run into any issues,

    Kind regards,
    Stefan