Ecommerce will soon become the dominant business model that will eclipse traditional business models. Given the rising popularity of this trend, it is easy to see that the competition among the ecommerce platforms has already become fierce. It is all about the survival of the best platform!
Drupal has already established itself as an important CMS that has a large and active user base that employs it for all possible scenarios. Ecommerce is no exception, and Drupal offers a comprehensive ecommerce solution that is easy to implement and maintain.
In this tutorial, I’m going to tell you how to setup Drupal ecommerce store using Drupal Commerce 2.x. Drupal Commerce is a set of plugins that extend Drupal platform and turn it into a functional ecommerce store.
If you are a Drupal 7 fan, checkout how you can set up a Drupal 7 ecommerce site.
Installing Drupal commerce 2.x at a new website is pretty simple. The process, however, has a few prerequisites:
- Drupal 8.3.0 or higher
Please make sure that your website meets these requirements before proceeding any further.
Access your website’s SSH terminal and enter the following command:
composer create-project drupalcommerce/project-base mystore --stability dev
The installation process will resemble a regular Drupal installation. Once the installation finishes, the Drupal commerce modules will also be enabled automatically.
Installation on an Existing Website
In many instances, users already have a functional Drupal website. In this case, a different method of installing Drupal commerce 2.x should be followed. Simply execute the commands given below in the given order:
composer config repositories.drupal composer https://packages.drupal.org/8
The above command adds a Drupal.org composer repository.
composer require "drupal/commerce 2.x-dev"
The above command downloads Drupal Commerce and all the required libraries and modules.
When you are done, execute the following command using the Drupal console to enable composer modules.
drupal module:install commerce_product commerce_checkout commerce_cart
This concludes the installation of Drupal Commerce 2.x. Now, I will discuss the actual setting up of the store.
Setting up the Stores
Once you are up and running with Drupal Commerce, setting up the store is a matter of a few clicks. Drupal Commerce makes it incredibly easy to configure many ecommerce related operations at your store.
To set up your store, simply follow the procedure outlined below:
- Navigate to the commerce section in the admin panel.
- Before setting up a store, you will need to import a currency. This step ensures that only the required currencies are imported into the store’s database. To import a currency, click the currency tab under the commerce tab, go the to Import tab and select the currency you wish to import.
- Now that the currency has been imported, you can start setting up your store. In order to do this, click the stores section under the commerce category.
- In this section click the add new store button. Now enter the details of the store such as name, tax etc. Once you have set all the details, click save.
You can now start adding products.
The process of how to setup Drupal ecommerce store is incredibly easy and ensures a clean setup of the store at the Drupal website. As with everything Drupal, you can dive in deeper and alter everything to your liking.
Until next time, happy entrepreneurship!