• Resolved islp

    (@islp)


    Hi, one question.

    I have a WP-based website at www.mydomain.com.
    Then I have WP-based Woo-commerce powered website at mysubdomain.mydomain.com.

    Their databases live on two completely different hosts.

    Users are registered only through the main website (not the subdomain) but I want them to login with the same credentials in the Woocommerce-powered subdomain.

    I thought to do the following: using a cronjob, any night I dump the wp_users table of the main website, I drop the wp_users table in the subdomain and I replace it with the wp_users table of the main website.

    Is this wrong? Is this enough? Are there any side effects? Should I consider other things (eg. other tables)?

    P.S.: multisite is not an option

Viewing 3 replies - 1 through 3 (of 3 total)
  • braehler

    (@braehler)

    @islp

    Yes, you can do so by sharing the logins and users between the sites. You have to share the users and their metas. So that Site B is using the log ins etc. from Site And then you have to share the login cookies as well.
    Here is a good step by stept tutorial
    https://trickspanda.com/wordpress-share-users-login/

    Thread Starter islp

    (@islp)

    @braehler :

    Hi, I’ve red that post before posting, but I did not understand one thing about cookies: does this work only with multisite? I ask because I found very similar posts and they specifically mentioned the cookie thing only working for a multisite network sharing the same database, that’s very different from my current case.

    Anyway, I must confess I don’t really care too much about cookies: my users don’t have to visit the ecommerce every day, so if they login two times it not that important. The important thing is they use the same credentials for both sites.

    That said, I found I can’t really copy the wp_usermeta table from one site to another on a regular basis because WC stores data about users carts, etc. in that table. Moreover, WP-powered website has no Customer role, for example.

    So, dropping and replacing the wp_users table is apparently an easy trick, while wp_usermeta needs much more attention.

    braehler

    (@braehler)

    @islp
    Thats one thing we are facing as well. Sharing the users and their meta works the above way. But as soon its getting close to sharing their carts and orders its getting hard to get things together.
    We would also like this feature, but for now, we are splitting our services. Right now we can do it, because at the moment this feature is for free.
    The only thing I heard about was this WC Adon here, but we did not try it out yet.
    https://wooglobalcart.com/
    As far as I know, this is a common enhancemet request in the WC forum, but unfortunatly there is no timeline or anything, so we can get this running inside the WC Core.
    I realy think it′s time to et this inside the main function of WC. LEt′s hope the devs will do their job including this ??
    Because, split shops means more accounting, and you do not have ongoing invoeces etc

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Same users for domain and Woocommerce-powered subdomain’ is closed to new replies.