• Resolved jaxne

    (@jaxne)


    We have a manufacturer client website that has a dealer network. We set up Dealer roles in WP for them to access a “Dashboard” with links to some special pages. The dealers also can be with their customers (end users of the product) to order from the product and a an optional maintenance contract from this site via a Woocommerce one-page checkout. We’re running into an issue where the dealer is logged in, places an order with the dealer’s customer’s information and all of these orders and subscriptions are being associated with the Dealer’s account and not a separate customer account.

    I saw this plugin and switch_off_user hook in your GitHub repository. Would like to find out if that can be called from a link on the dealer’s “dashboard” where the dealer would click it, it would log them out and redirect them to the one-page checkout where their customer enters their info to buy. This would (I think) then allow the order/subscription be associated with the dealer’s customer vs. showing up under the dealer’s account.

    If you provide any dev services related to this, I’d be happy to discuss outside of this support thread or if you want me to discuss this on GitHub instead, please advise.
    Thank you! ~John

    • This topic was modified 5 years, 8 months ago by jaxne.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Yes this is certainly possible, but you would need to tweak the user permissions. User Switching only allows a user to “switch off” if they can manage users, which by default only applies to Administrators.

    You can use a plugin such as Members by Justin Tadlock to grant the switch_off capability to your Dealer role, then manually place the Switch Off link somewhere with a redirect_to query variable added to it for the redirect.

    Unfortunately I don’t do any contracting work. Codeable.io is a good place to find quality WordPress developers though.

    Thread Starter jaxne

    (@jaxne)

    Thanks John!

    I appreciate the response and extra information. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use Switch Off hook to log a user out and redirect them to a specific page?’ is closed to new replies.