Setting up a WooCommerce store in Codesphere
WooCommerce is the leading e-commerce plugin for WordPress. It is highly customizable, open-source and given the right hosting setup can power large e-commerce businesses. Setting it up in Codesphere is really simple.
- A MySQL database (can be provisioned in DigitalOcean in a few clicks if needed, explained below)
Navigate to the team where you want to create your store and click new workspace.
Select the WordPress template, provide a name for your application and select a plan (for testing the small plan will be sufficient, for any production environment go for Boost or higher):
Create a new or open your existing DigitalOcean account, select Databases and follow the steps to create a new MySQL database. The provisioning will take some time, afterwards you will find the connection information under Connection Details in Overview. You will need these details in the next step.
Back in your created Codesphere workspace open
html/wp-config.phpand scroll to the database settings.
Edit the following entries of the WordPress installation to point them to the correct database (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST).
Make sure to append the port (:25060 for DigitalOcean) to your DB_HOST
Scroll down to the authentication and salt keys part of your wp-config file. Open this link in any browser to generate a new set of keys: https://api.wordpress.org/secret-key/1.1/salt/
Copy the string snippet generated into your wp-config file, replacing the empty keys.
Navigate to CI Pipeline, select the run stage and click the run button. Now Wordpress will start up.
Open your deployment and follow the steps on the screen to finish up the WordPress installation.
Now you have a clean WordPress installation, if you want to install WooCommerce it’s just a few clicks away via the Plugins tab. Follow the guided steps and you will have your shop up and running in no time.
Once you are ready to take your shop live you might want to connect a custom domain by following this tutorial: Custom Domains
Check out the following tutorials to learn more: