Search Results :

×

WordPress Firestore Integration | Connect Cloud Firestore to WooCommerce


The WordPress Firestore Integrator Plugin connects your Cloud Firestore to your WordPress site. Using Firestore Integrator, you can easily Integrate the Firebase cloud database with a WordPress site. There are different events on your WooCommerce site such as creating products, and orders placed by any customer. These details can be synced easily to the Firebase database and you can also display the data from Firebase cloud database on the WordPress site. Additionally, you can also check our WP Firebase Authentication plugin to enable WooCommerce Firebase Integrations and Firebase social login. Click here to learn more about the WordPress Firebase Authentication plugin.


A) Connect your Cloud Firestore database with your WordPress Site

1. Steps to Download Configuration File

Note: Before downloading the configuration file, you must set up cloud firestore into your firebase project.


  • Go to Firebase Project Console => Project Settings => Service Accounts and Download the Configuration File by clicking on the Generate New Private Key button.
  • wordpress-firestore-integrator-setup
  • After clicking on the Generate new private key button one JSON file is downloaded.

2. Upload the configuration file into the Firestore integrator plugin

  • To upload the configuration file Go to the Firestore Integrator plugin => Firestore Configuration tab. Choose the configuration file you have downloaded in the last step and click on the upload button.
  • wordpress-firestore-integrator-setup
  • You will receive a success message when the JSON file is successfully uploaded.
  • wordpress-firestore-integrator-setup

B) Setup WooCommerce product sync with Cloud Firestore

  • To sync all your WooCommerce products into your cloud firestore database. Go to the Firestore Integrator plugin ⇒ WooCommerce Product Sync tab.
  • You have to give the correct cloud firestore collection path, where you want to sync all your data..
    e.g., WooCommerce/Products/Data or WooCommerce are valid collection paths because here Woocommerce is considered collection, and products/data is considered subcollection.
    If you give WooCommerce/Products as a path, then this is the wrong path because it will consider the product as the document name and not a collection name.
  • wordpress-firestore-integrator-setup
  • If you want to sync Products automatically whenever a new product is published or updated, enable the toggle button Auto Update products whenever a new product is released.
  • Once you've completed the above steps, click on the Save Settings button.
  • After giving a valid firestore collection path, click on the Sync All WooCommerce Product button, which will sync all product data into cloud firestore.

C) Setup WooCommerce Order sync with Cloud Firestore

  • Go to the Firestore Integrator plugin ⇒ WooCommerce order Sync tab to sync the order into your Cloud Firestore database whenever your WooCommerce store receives an order.
  • Enter the correct Cloud Firestore collection path where you want to sync your order data.
  • If you want to sync orders automatically whenever a new order is created or updated, enable the toggle button sync whenever new WooCommerce order is created or updated.
  • Once you've completed the above steps, click on the Save Path button.
  • wordpress-firestore-integrator-setup

D) Set up WooCommerce Subscription sync with Cloud Firestore

  • To sync all your WordPress user's meta into your cloud firestore database. Go to the Firestore Integrator plugin ⇒ WooCommerce Subscriptions tab.
  • There are two sections, one for subscription products and one for subscription orders.

1. Subscription products:

  • Enter the correct Cloud Firestore collection path where you want to sync your subscription product data.
  • If you want to sync Products automatically whenever a new subscription product is published or updated, enable the toggle button Auto Sync Subscription whenever new Subscription is released.
  • Once you've completed the above steps, click on the Save Settings button.
  • After giving a valid firestore collection path, click on the Sync All WooCommerce Subscription button, which will sync all Subscription data into cloud firestore.
  • wordpress-firestore-integrator-setup

2. Subscription Orders:

  • Enter the correct Cloud Firestore collection path where you want to sync your subscription order data.
  • If you want to sync Subscription orders automatically whenever a new order is created or updated, enable the toggle button Auto Update status of orders.
  • Once you've completed the above steps, click on the Save Path button.
  • wordpress-firestore-integrator-setup

E) Setup to preview data from Cloud Firestore

  • To preview your Cloud Firestore data, go to Firestore Integrator plugin ⇒Get Firestore Data. To display the data, provide a valid path of the collection and click on the preview button. Use the format Collection/Subcollection/Document if you're accessing a document in a subcollection or Collection if you're accessing a document in the root collection.
  • For example: if your collection is named WordPress and you want to access a subcollection named users and a document within it named Data, the path should be WordPress/users/Data.
    Avoid using paths that don't conform to this format, such as WordPress/users for a subcollection, as this may lead to errors.
  • wordpress-firestore-integrator-setup

F) Steps to create a shortcode

  • You can create a shortcode to display all your Cloud Firestore data on your WordPress Site. To create a shortcode, go to the Firestore Integrator plugin => Create Shortcode tab.
  • Note: To create a shortcode you must have to give a valid shortcode name, a valid Cloud Firestore path, where all the data you want to display is stored, and At least one mapping.


    wordpress-firestore-integrator-setup
  • In the Custom Field Mapping tab, you have to map fields in the format of the Name you want to give for that column: Actual document field name.
    e.g., In the below screenshot, ID is the text you want to show as the column name on the display and product_id is the Cloud Firestore document field.
  • wordpress-firestore-integrator-setup wordpress-firestore-integrator-setup
  • After successfully creating a shortcode, you will see a test configuration button, and by clicking on that you can see an output table as shown in the image below.
  • wordpress-firestore-integrator-setup
  • You can copy the shortcode and paste it on your WP page to display your data on WordPress Site.
  • wordpress-firestore-integrator-setup

G) Steps to Sync all users into firebase

  • To sync all your WordPress user's meta into your cloud firestore database. Go to Firestore Integrator plugin ⇒ Sync WordPress users tab.
  • Enter the correct Cloud Firestore collection path where you want to sync your user data.
  • wordpress-firestore-integrator-setup
  • If you want to sync user profiles automatically whenever a user registers or updates their profile, enable the toggle button Sync User Profiles on Registration and Profile Updates.
  • In order to sync user data from WordPress to Firestore, you can choose which specific user meta information you would like to sync. This means that only the selected information will be synced into the Firestore collection.
  • wordpress-firestore-integrator-setup
  • Additionally, if you're using WooCommerce, you can also sync user details related to WooCommerce into Firestore. To do this, you simply need to choose which WooCommerce profile information you want to sync into Firestore.
  • Once you've completed the above steps, click on the Save Settings button.
  • wordpress-firestore-integrator-setup
  • After successful configuration of all the above settings, click on the Sync All Users button to sync all your existing WordPress user's meta to your Cloud Firestore database.

Note: If you synchronize all users at once, then the users who have already been synchronized into Firestore will not be synced if you click on the ‘Sync All Users’ button again and only the new users who are not yet added to the collection will be synced. Please email us at oauthsupport@xecurify.com.

Additional Resources


Hello there!

Need Help? We are right here!

support
Contact miniOrange Support
success

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com