How to Setup ECommerce for WordPress Website

Every business old or new, need a strong online presence to reach out to millions of people across the globe. If you are planning to sell something then mere creating a super cool website wont suffice, you need to adopt an eCommerce platform and setup a shop online. The article “How to Setup ECommerce for WordPress Website” will take you through the exact process that is required to setup your own online shop.

There are many ecommerce plugins or platforms available in market like ZenCart, Open Cart, OSCommerce and Magento etc. All are good in their own way but being an WordPress fan, I am looking for a solution that is easily fit in to WP framework and precisely for this point WooCommerce stands out clearly on top of all. Here we will see how and where to get woocommerce, how to setup, how to update your theme for correct pages.

ECommerce for WordPress

Get WooCommerce and Install

Amazingly WooCommerce is freely available on their official site as well as WordPress Plugins Repository. You can simply go and download a copy for yourself. It is a fully open-source e-commerce plugin for WordPress. It offers a stable and secure platform built right on top of the WordPress Core making it easy to customize setup e-shop easily.

Download WooCommerce

You can install this plugin either manually by uploading the unzipped archive to your plugins directory or you can install plugin automatically from WP Repo. I would prefer automatic install from your WP Dashboard, as it saves lots of trouble involved in uploading plugin files to your host. The moment you activate your plugin you will be presented with a notice on top of your page.

 

Nothing to worry about this. This is not going to break you sites functionality, it will only affect layout of your newly setup shop. To remove this notice, you need to add woocommerce support in your theme.

WooCommerce – eCommerce for WordPress Theme

Most of the WooCommerce templates will integrate nicely with WordPress themes. Sometimes WooCommerce content wrappers do not match your chosen themes and it may break your layout on WooCommerce pages and shifting your sidebars into incorrect positions. This layout issue may affect the shop page, the single product page and the taxonomy pages (categories and tags) because WooCommerce uses templates of its own. Other “pages” (checkout, cart, account) are not affected because they use your theme’s page.php template.

 update functions.php

This step is required and you need to update functions.php from your themes folder with following code. Here I am adding woocommerce support only when the WooCommerce plugin is active.

Override WooCommerce Templates

We would need to override the templates for shop and single product pages. By default the plugin uses templates that are available in plugins directory. But we can simply override that by creating template in your theme folder with same name. Just create a directory named “woocommerce” and copy the templates you want to override from plugins folder and changes them as you please. But remeber to use woocommerce specific functions and wrappers. I have overridden “archive-product.php” and “single-product.php” as shown below to match up with the Openstrap Theme.

 

Add Special Sidebar Widget Area

As mentioned earlier shop, single product page may break the layout. We will declare special widget areas that will be used on these woocommerce pages. You can see in above files I am using a different sidebar ‘product’ and ‘shop’. We will define that in our functions file only if the plugin is active.

Now, at this stage You have successfully added a templates that works well with your chosen theme. Just explore the Plugin and setup your shop. Add products, set categories, define payment gateways and lots more you can do with the help of woo. You can even make the look, feel and functionality better with the help of hooks. Woocommerce support variety of hooks and filters that you can use to enhance the user experience. One such filter is for Product Search Box, that comes by default with plugin-

I hope you find this article to setup ecommerce for wordpress website useful. Please watch for our next article that will cover WooCommerce Plugin Functionality.

9 Comments
  1. Joyce
    April 14, 2014 | Reply
  2. March 29, 2014 | Reply
  3. MastroPino
    March 26, 2014 | Reply
  4. March 20, 2014 | Reply
    • Pavan
      March 24, 2014 | Reply
  5. Jon
    March 11, 2014 | Reply
    • Pavan
      March 11, 2014 | Reply

Leave a Reply to Pavan Cancel reply

Your email address will not be published. Required fields are marked *