John Davidson

php - Sync base site login and Wordpress login for account management

0 comments
Message:


Please bear with me as I am new to Wordpress.


I have a base site that allows the purchase of products using unique platform currency.
Users can register on the website, but if they want to purchase any of the content, they first need to purchase credits.
I have a Wordpress site that utilises a WooCommerce store (StoreFront), where these credits can be purchased. Once the user purchases credits on the Wordpress site, the amount of credits purchased is written to the base site database.


On the Wordpress site, there is an account management page that allows users to track orders, information, and more. They can also add cards to checkout quickly.


Is there a way to link the account registration on the base site and the Wordpress site. I want the users to be able to have the benefit of both modules, without having to register twice.


Any help would be highly appreciated.



My Answer:
To sync the base site login and Wordpress login for account management, you can use a plugin like WP OAuth Server which allows you to authenticate users against an external database.

Here's a general outline of how you can achieve this:

1. Install and configure WP OAuth Server on your Wordpress site.
2. Set up the base site database as an external database in WP OAuth Server settings.
3. Modify the registration process on both the base site and Wordpress site to use the same credentials (e.g. email and password).
4. When a user registers on either site, use WP OAuth Server to authenticate the user against the external database to ensure they have a single account across both sites.
5. Use hooks and filters in Wordpress to sync user data between the two sites, such as updating the user's credit balance in the base site database when they purchase credits on the Wordpress site.

This is a high-level overview and may require some custom development to fully integrate the two systems. It's recommended to consult with a developer experienced in Wordpress and PHP to help you implement this solution effectively.

Rate this post

3 of 5 based on 9435 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us