WooCommerce combined with the WP Cloud Server plugin provides an easy way to sell website hosting plans to your clients and customers.
WooCommerce is without doubt the most popular WordPress eCommerce solution in use today. It is extremely powerful and highly flexible! But out of the box it does not easily allow for the selling of website hosting plans! We decided that integrating support for WooCommerce in to our plugin would be a powerful solution.
Enabling WooCommerce Support
I will assume that you have the ‘WP Cloud Server’ plugin installed. So, all being well you will have activated the modules that you want to use! For this example we will use ‘ServerPilot’ and ‘DigitalOcean’. The beauty of using these modules is that they allow for a DigitalOcean server to be deployed and then, automatically, have ServerPilot install WordPress.
Next we need to install the standard WooCommerce plugin. If you are logged in to your WordPress Admin Dashboard click on ‘Plugins’ and then search for ‘WooCommerce’. Once you’ve located it just click ‘Install’ and then ‘Activate’. You will find that the WooCommerce set-up wizard takes you through a series of questions to set-up your eCommerce shop how you want. Any problems or concerns then please get in touch, we will try and help!
Once you have WooCommerce installed and activated you will see some new tabs appear for each service in the ‘WP Cloud Server’ plugin. These tabs are ‘Templates’, ‘+ Add Template’, and ‘Clients’. For this article we will be concentrating on the first two.
What is a ‘Template’
A ‘Template’ is a powerful feature provided by the ‘WP Cloud Server’ plugin. It allows you to define the technical specification for your website hosting plan. You can create any number of templates describing all of the plans you want to sell. When a customer buys a web hosting plan and the payment has been received the ‘Template’ is used to build the website!
Let’s pause for a minute to see what sort of information is captured in the ‘Template’. Note that ‘Templates’ are linked to a service so the exact information saved will vary from module to module! That’s take a look at the information saved in a ‘ServerPilot’ template.
- The template name for easy identification
- Cloud Provider e.g. DigitalOcean, Linode
- Server Image e.g. Ubuntu 20.04
- Server Region e.g. Amsterdam
- Server Size e.g. 1 CPU, 2GB Memory, 25GB Disk
- Enable Server Backups
- Enable AutoSSL
- ServerPilot Plan e.g. Business
- Admin SSH Key
As you can see the ServerPilot ‘Template’ contains all of the information needed to deploy a DigitalOcean server and connect it to ‘ServerPilot’. This is a powerful feature and means that in order to sell a website hosting plan all you need is the module, in this case ‘ServerPilot’, and the template name.
Creating a ServerPilot Template
Now that we understand what ‘Templates’ are let’s create one. In our example we are using ‘ServerPilot’ so we need to go to the ‘ServerPilot’ control panel inside the WordPress admin dashboard. ‘ServerPilot’ is grouped in ‘WP Cloud Server’ plugin under ‘Managed Servers’ admin menu item. Simply click this option, or chose ‘ServerPilot’ from the sub-menu if you have more than one service in this section.
You will find that the ‘ServerPilot’ control panel defaults to the ‘Servers’ section. All you need is to find the tab labelled ‘+ Add Template’. You will see the screenshot below. I have just selected some standard values for this example. Enter a descriptive name, select the options you want, and finally click ‘Create Template’. After a few seconds your template will be saved for later use.
Creating a WooCommerce Product
Let’s take the information that we have learnt and create an actual web hosting plan product using WooCommerce.
The process of creating the product is exactly the same as for any WooCommerce product!
If you hover over the ‘Products’ menu item and click ‘Add New’ you will be taken to a new product page. You can enter the hosting plan name, the description, then in the product data box you can enter pricing, select virtual because it is a virtual product.
You will find a new tab called ‘Web Hosting Plan’. This is added by the ‘WP Cloud Server’ plugin and allows you to enable web hosting for this product. If you click on the tab you will see a new section displayed with three items, a checkbox, and two dropdown lists. The screenshot below shows the new section.
The checkbox is just a confirmation that when this product is purchased the plugin should go ahead and deploy any necessary servers and websites. The first dropdown list is for selecting the ‘Module’, which in this case will be ‘ServerPilot. Then the last dropdown is for selecting the template, in this case we created a template named ‘ServerPilot Template’ earlier, which is now available in the dropdown. Once you are happy with your product you can save it. You’re now ready to sell website hosting.