Articles about e-commerce

Stock for Drupal 8 commerce - Technical overview & use cases

The business requirements

Drawing on the experience of maintaining the Drupal 7 stock module and working with a number of ERPs over the years we have come up with a completely new architecture for Drupal 8 commerce stock module.

The following are the 4 main challenges that I encountered with the Drupal 7 module that needed addressing:

Brightpearl ERP for Drupal Commerce integration


After many custom Drupal Commerce ERP integration's we have come across Brightpearl an ERP with all the facilities a small to medium size business would need and decided to share our code with the Drupal community see the Brightpearl module page.    

Also check the Brightpearl setup guide Setting up Brightpearl ERP on a Drupal Commerce site post.


Drupal Commerce site for Moscow bakery

We were commissioned to create a Drupal Commerce based web site for a top Moscow bakery.
The site is a custom themed multilingual site offering online ordering, delivery slot choice alongside recipes and other product information.
The Drupal Commerce framework is an ideal platform for the creation of an online shop and with a degree of customisation provides an excellent base for this multilingual online bakery.

Working with Drupal commerce order total

The following gists shows a few approaches for working with Drupal commerce order totals.
All three examples retrieve the order total as two components Ex Vat and VAT:

The first example shows how to get nicely formatted amounts. This is easily done using two functions:
commerce_price_component_total() - Returns the total value and currency for the specified price component in a price array.
commerce_currency_format() - formats the amount with the correct localization and currency symbol

Dickies Workwear - Online Catalogue responsive web site

The internationally renowned manufacture of hard wearing and fashionable workwear - Dickies - engaged us to create a web site for their workwear range.
The web site presents their range of workwear and links through to a network of online distributors and retail shops. The site is presented in 10 languages, is responsive and optimised for multilingual SEO.
The site also provides access to corporate information and enables the ordering of custom workwear, embroidery and access to the extensive image library of Dickies products.

Drupal Commerce Localisation - translate the currency symbol

I didn't see this one coming but on a Multilingual Russian site we recently built, the client asked us to translate the Russian Rubble symbol "руб" to "RUB" when viewing products in English.

As there are no localized options for currency settings I had a look around the commerce code and came across commerce_currency_format() in commerce.module.

Localizing a Drupal 7 Commerce site a step by step guide

This is going to be a step by step guide for localizing & translating a Drupal 7 commerce site. there are many ways and tools Drupal and its contributed modules support and this is just one of them. 

I will not go into too much explanations but will try and make sure I cover all the steps needed to translate a Drupal commerce site.

Note: commerce kickstart 2 comes with some of this but last time I checked it did not provide full localization and translations features.

Setting translators on a multilingual drupal 7 site

Drupal 7 has great support for multilingual site and has various approaches to content translation and localization.
In this quick recipe post I will cover the setting up of a "Translator" role for the following translation approaches

  • Interface translation: The translation of strings used throughout the site
  • Entity translation: The translation of Nodes and other entities using entity/field translation

I will try and cover other translation & localization approaches at a later stage

Drupal 7 menus in a localized site

i18n / Internationalization module

We use the i18n menu module that comes with the Internationalization module.
While the module provides configuration options for language specific menu items, simply enabling the module creates a new translation text group called "Menu" that exposes all menu items to the translation interface.

You can use the translate interface to translate all the menu items except for once created by nodes for those you should translate the node and specify the translated menu title.

The Commerce Detective: Cloud Zoom JQuery plugin 404 errors - A solution

If you have been enjoying the Drupal Commerce Kickstart demo of what Drupal Commerce can do you are likely to be greatly inspired to use the techniques showcased in this amazing product. However you may not yet have noticed that you are getting 404 errors on the product page. In this post I cover how to solve this issue.

Drupal Behaviors, Ajax and doing it once

After wrestling with this for a while this evening it struck me that it isn't a very well documented area - so I thought I'd make a quick post as much for my own notes as hopefully assistance for someone else.

The issue:  You have some jQuery that runs once the page has loaded and you find that it runs on Ajax post backs .. Ugh!!

The end result is that you get the behaviour repeated every time the code runs - not nice.

The answer lies in the use of the jQuery .Once() - see

Why are you looking for my crossdomain.xml?

If you are developing commerce sites and review your logs regularly, chances are you will come across 404 errors looking for crossdomain.xml. We get a lot from the plugins that looks for coupons on e-commerce sites (e.g. Drop Down Deals). In fact you are likely to get them on any sites you develop - but we have seen them more frequently on ecommerce sites.

Drupal Commerce for Dickies Streetwear

We were engaged to create a socially linked ecommerce site for a new brand range of Dickies clothing - Dickies Streetwear. The brief called for a high performance state of the art site that engaged a growing customer base in the streetwear market. So rather than create a run of the mill ecommerce catalogue site we wanted to create a rich user experience based around news and social media with purchasing opportunities presented across the site.

Drupal Discovery Day - Brighton

Drupal (pronounced drew-pull) is a Content Management System and web application development software written in a popular scripting language - PHP. Drupal has over 11,000 modules and over 1,000 themes, along with both a point and click interface to allow tech-savvy people to put together websites with no programming experience; and an API and framework for programmers to develop unique applications. Best of all, it's free, open source software!

Drupal Commerce Order display - Missing Template filename and path - .tpl.php

Wrestling with an error message on a Drupal Commerce site today. I kept getting errors relating to a missing template file with no path and no file name .tpl.php. Fortunatley with a little debugging giving me a pointer to the correct issue queue on Drupal the solution was readily available. So here's a few easy steps to follow in case you have the same issue.

Importing Products Displays and related Products to Drupal Commerce

In this post I am going to look at Drupal Commerce and demonstrate how to prepare e-commerce product data for import into Drupal Commerce - and show how to create a delimited list of product references to link the products to their display nodes. These techniques supplement the wealth of great practical demos and documentation provided by the Commerce team.

A case for the Drupal commerce detective

Finally solved a curious issue that has been nagging me on a test Drupal commerce site.
I have a utility script that lists products that are not linked to Product Displays (handy). Perplexingly the ‘report’ kept showing some orphaned products even though I had linked them all and the report had shown none previously.
It is a test site undergoing some heavy development so at first I put it down to that - rolling the database back and forth etc But today I noticed it and was pretty sure that nothing had changed that could cause such data changes. Could it be some bug in entity API, commerce ? Unlikely! So crack out the deer stalker and pipe lets investigate!

Drupal 7 commerce multi currency site using a price list

Below are my notes taken as I investigate techniques to achieve my Objective,
(This post is not a normalised set of instructions but the process I went through to figure out the best way to handle multiple currencies c objective)
if I get a chance ill create another post with a normalised set of instructions/explanation.

We were engaged by Pelgrow UK Ltd to develop an online e-commerce solution for their network of highly successful high street pharmacies in London and across the UK. We were tasked with the design and building of the YourPharmacy brand through the design and creation of an online e-commerce store.