Case study: B2B on Magento

Picture of Tomasz Karwatka
Tomasz Karwatka

Supervisory Board Member at Divante. Leading industry voice who believes eCommerce can improve our world. Co-founder of Vue Storefront and Open Loyalty, angel investor, and founder of Tech To The Rescue. CoFounder at Catch The Tornado eCommerce Startup Studio

Care to share?  is an original project by TIM SA – one of the biggest distributors of electro-tech articles in Europe. TIM has been on the market for nearly 25 years. The company offers ca. 9000 products on demand. The Central Magazine is almost fully automated – both when it comes to storage processes and additional services, such as cable rewinding and tailored cable cutting services.

User-Centered Design

In Divante, we follow the User-Centered Design methodology whose main goal is to satisfy customer needs in the possibly most intuitive and comfortable way.

The project included the following process:

  1. Analysis of business needs and demands – during which we filled in the functional document, wrote down additional demands and, during workshops with the client, gathered business goals and other functional and non-functional demands (concerning e.g. efficiency and capacity of the system).
  2. User interactions designing – when the UI was prepared and optimized, together with a list of user cases, user tests and the final improvements.
  3. Technical analysis and choosing integration pattern – which was a tough nut to crack because it demanded changing technical infrastructure and the client’s systems. At this stage, we gathered all specifications of network services and set up data exchange protocols (more on this later).
  4. Graphic designing – based on the interactive prototypes.
  5. Implementation – based on Magento engine.
  6. Tests and release – We run a series of tests and prepared reports on every aspect of the application. Testing is vital for us because we want our final product to be complete and reliable. Also this time testing took quite long but after it was done both the client and us were sure that launching the store will be a piece of cake.
  7. Survey and optimization – some time after the service had been launched, we performed a series of analytical surveys to see whether the business goals were in fact achieved.

People involved in the project:

  • at the analytical and graphic designing stages: 2 user experience designers, 1 system analytic (integration analysis and business process detailing), 1 graphic designer
  • during deployment: 1 webmaster, 2 programmers (full time), 1 programmer (part time), 1 web administrator (part time)
  • during tests: 1 tester and business analytic (test scenarios and reports)

User tests

Based on interactive prototypes, we tested how the potential customers would work with the application. To bring in the reality factor, we selected a group of users with a very diverse experience in online shopping. During the tests, the users performed tasks that had been earlier defined with the client.

Task for retailers and wholesalers of electric equipment
Imagine that you need 345 m building-supply cable for sale. Try to buy it on this site.

Task for traffic maintenance
Imagine that you need 345 m building-supply cable for sale. Try to buy it on this site.

Optimizing The Calculator

The user tests allowed us to introduce optimizations that made using the store intuitive – although it sometimes concerns complex orders.

It is a good moment to briefly discuss why in the case of cables we deal with untypical product and what kind of repercussions it brings. Cables are sold in rings or reels – and different lengths. They can be also tailor-cut to meet customer needs. TIM SA, as every cable distributor, after some time has faced the problem of storing the remaining snippets which are so short that hardly anyone wants to buy them. Their storing means using the precious logistics space. That is why BankKabli was also supposed to sell them out.

Optimizing The Calculator

In order to do that, a special calculator was designed. It answers a given cable length demand with a choice between a tailor-cut cable section and a sum of snippets on sale plus joints – in order to get rid of the snippets and offer a lower price.

Magento implementation

While deciding on a technological platform, our client focused on a couple of factors:

  • Business security – The platform’s license should be open-source so that the client himself could add functions according to the changing needs and take care of software maintenance and development.  It was also important to be able to pass on the development to another company or even use the producer’s technical support if needed.
  • Functional flexibility – B2B system is a challenge for software itself, plus the client’s business is constantly changing so a lot of new functionalities appear to be necessary as it grows – which is why the platform has to make their implementation cheap and easy.
  • System security – It was demanded that software update should be possible (despite all the upgrades) and take place regularly according to the producer’s schedule (e.g. security patches).

Taking all the above factors into account, Magento seems to be ideal. Because of its flexibility, it ensures lots of development opportunities. Currently, a number of Magento’s partners develop additional modules which can be used in the future – they also provide business security. At this moment, Magento is a sort of a standard when it comes to e-commerce software.

All introduced modifications to software were added as extra modules which enable updating the core of the platform. And they do not collide with the producer’s patches. The module structure makes it easy to add more modifications and plan the development. In the following subchapter, we’ll discuss technological challenges and solutions that we came up with during implementation.

Untypical product

Cables are sold in rings and reels. Storing information about the available length of cable in stock is not enough because it is necessary to know what exact fragments are available (e.g. to be able to sell out the remaining snippets as discussed above).

Additionally, each purchase includes tailor-cutting or deposit for container (reel), plus logistics costs.

If that already isn’t enough, the prices of the cables are not steady because they depend on the number of items in stock, customer demand and many other business factors. In BankKabli, the prices are calculated each time according to an algorithm which uses these factors, imported as Ms Excel files and read via ERP system.

Implementing price rules and specific products demanded writing data models in Magento and matching the algorithm via events mechanism. Anywhere, from product pages through calculator to user path, the prices are calculated by one algorithm taking into account all the dynamic factors.

Also the promotional rules and discount codes were changed. The final implemented cable calculator is displayed below.

B2B elements

In the case of BankKabli, implementing B2B functionalities kept us awake at night. Because Magento does not have a native support for such modules (and it is hard to get ready modules which can be used without modifications), we had to work hard to implement a couple of features:

  • Hierarchical customer accounts – a customer having departments can set up separate accounts for all employees, where they can make purchases up to the preliminarily set limits.
  • Purchase limits – fully integrated with ERP system – both the process of asking for a limit (electronic order) and its maintenance were implemented in Magento. We created a new method of payment to comply with the customer’s balance. The data is being actively exchanged with the ERP system.
  • Multiple pick-up addresses and booking pick-up times – Thanks to automatic logistics, it is possible to book pick-up time directly in the Central Magazine. One customer can have an unlimited number of pick-up addresses, matching his departments.
  • Complaint service – complaints are generated automatically and sent to the Workflow system in TIM (accepting all documents).
  • Invoices and other documents service – each customer, even buying offline, can check his or her order’s status and documents after setting up an account, thanks to integration with Workflow. Moreover, it relieves Call Center and is an info hub for the customers.

To create a B2B account, we used server mechanisms and events in Magento again, we extended a couple of models, plus we used EAV mechanisms to add non-standard attributes to all object groups in the database (including user and customer models).

Untypical user path

Those who know Magento, initially praise the “One-page checkout” mechanism. This solution is based on the AJAX user path mechanism, including only one step (with dynamically added elements). But the mechanism was inadequate for the BankKabli.

During user tests and interactive prototypes designing, we detailed all the user path steps. We used the method of precise delivery, i.e. booking pick-up address, date and time, different payment models, purchase limits and text-message notifications about the subsequent stages of the delivery.

We had to re-write the whole user path mechanism (introducing a new controller and models responsible for these functionalities in Magento). We did our best to use the standard models and data models, e.g. pick-up addresses, orders, invoices, and only made modifications where it was necessary.

Cooperation with company’s IT

The implementation included integration with a couple of systems:

  • automatic magazine
  • ERP system (MFG/PRO)
  • document service system

TIM has well-working and well-optimized business processes which the Internet system shall complement by evolution, not revolution. Thus, during pre-implementation analysis, all processes that were supposed to be affected were written down in BPMN notation. Next, we decided which steps would be supported and to what extent.

Based on such business processes, we listed system demands, designed user interface and system user cases.

Integrations were co-prepared with the client’s IT department in a document called „Integration analysis”, describing all data formats and ways (protocols) of their exchange.

We have used the Microsoft BizTalk Server data bus which has standardized the way of exchanging information. As formats, we have used XML documents prepared via OAGIS. Thanks to this approach, the integrations can be used in TIM’s new systems, as well as in the case of Internet solutions that communicate with these systems. Using standard solutions in integrations is vital.

The extent of data exchange:

  • Products – full technical specifications of products are exchanged (once a day, sent by ERP system).
  • Numbers of items in stock – they are synchronized a couple of times a day, the store also allows for online reservations of products, and full info about the purchased fragments is passed on to the storage system.
  • Orders and customer data – full mutual synchronization. The store sends the orders and customer data to the magazine, while the customer receives information concerning the stage of delivery. In this way, the processes concerning logistics and purchase were not modified and are still supported via ERP system and no additional trainings for the employees responsible for deliveries were necessary.
  • Purchase documents and limits – also mutual synchronization in real time.

Tests, tests, tests

E-commerce systems are systems with increased level of demanded availability. In the case of CableBank, the extra risk factor influencing the system’s stability was the big number of integrations. We prepared full test scenarios to User Acceptance Tests (UAT – functional tests) and planned efficiency testes and other tests.

To sum up, we performed the following tests:

  • Functional/acceptance – based on scenarios which became the basis for further smoke and regression tests, performed during development, after implementation.
  • Integration – based on test scenarios, together with TIM, we checked whether data synchronized in the desired scope and time and what was the efficiency and risk potential of the system.
  • Security – two-phase. First of all, we performed automated tests for the typical weaknesses (XSS, SQL, Injection, CSRF). On the other hand, we reviewed the source code of the added Magento functionalities.
  • Efficiency – via Siege and JMeter tools, we tested the crucial paths of the application. Based on the maintenance agreement, the application guaranteed response and user goal realization times. The efficiency tests showed that the goals were being appropriately realized and that the application was able to serve to the predicted traffic.

To provide Quality Assurance, we followed our standards:

  • Version control system – SVN with version tagging, development plan and tagging the commits.
  • Commits recording system – Redmine which deals with all the communication and decisions made with the client. Redmine is also used to plant the successive editions of software.
  • Monitoring system – Incinga which monitors all the OS parameters and the application’s accessibility (HTTP).
  • PHPUnit automatic tests – which monitor whether the key application algorithms are accessible and correct: calculating prices, integrated services, user path.
  • Separate environments: developer, test and production.
  • Transactional implementation system – Using SVN and procedures, the versions are planned once a week, bearing in mind the time for the client’s UAT tests and our functional tests, as well as regression tests.

Published January 19, 2014