Roger Rosweide, co-founder and CCO of WPCS.io, shows you how to automate the sale and launch of your websites using a storefront. Only 2 plugins are covered that make up this automation: WooCommerce and Uncanny Automator.
Better yet, WPCS now also features an additional “Storefront” base snapshot that includes these two plugins and the configurations necessary to set up this API automation quickly and effectively.
To use this snapshot, just spin up a new Product in WPCS and select the Storefront snapshot when creating your first Version. Of course, this snapshot contains only the 2 required plugins and their configurations and isn’t stylized in any way. You can do that however you wish.
In any case, after watching this video and following along with the recipe below, you are ready to automate the sale of your business!
Automating with a Storefront
Create a new “Storefront” Product
Go back to the Product overview and create a new Product. You can call it whatever you want. For our purposes, we’ve called it Storefront. When the Product is ready, launch a new Version with the Storefront Base Snapshot.
Create a tenant
Don’t forget: your Versions only act as a development environment. So, even though you will only launch 1 website in this product, you need to create a Tenant from which you’ll trigger the automation. So, create a tenant inside your version and open the wp-admin.
WooCommerce + Uncanny Automator
For this automation, we’ll use WooCommerce and Uncanny Automator. If you’ve created your Version using the Storefront Snapshot, these are already installed. Make sure your Product in the WP-admin has the proper name you want to use and take note of the Product ID (we will need it when we create a groupName).
Create an API Key
Next, go back to (or create) the Product where you want your tenant(s) to be created and create a new API Key called “Storefront”.
Please note: you can create an API Key in your existing WPCS Product or have an entirely separate one in which you want your new tenants to be created. For this video, we used another Product (but this totally up to you).
Convert your API Key and Secret
Go to https://www.base64encode.org/ set the settings to “Encode” and then paste the API Key, insert a colon :
and then the API Secret one after the other. Make sure there is no colon in the API Secret when you generate it, otherwise you have 2 (which Base64 finds confusing).
Insert the resulting string into Uncanny Automator
Go to Automator and:
- Paste the result from Base64Encode at the Value under Headers behind Basic
- Add a Pair. Name this “groupName” (watch the capital N) and then select Product ID
Then go back to Console and create a tenant Snapshot with the groupName corresponding to Product ID (it’s a number!)
Ready to automate! Seriously, it’s that easy. Try it out by “buying” something in the storefront. Of course, you can stylize, customize, and modify the storefront however you like. In any case, your automation now works 🙂