Drop Ship E-commerce: Building a Magento 2 Extension

Drop Shipping in Magento 2

Multiple drop ship locationsThe drop ship business model is increasingly common in the e-commerce world as entrepreneurs and expanding businesses alike seek to reach a larger market. Drop shipping goods can be the key to building a large online marketplace with a variety of goods but without the overhead of maintaining a centralized inventory.

McVickerStreet offers an online collection of handmade products from local makers and has recently commissioned Flexpro to build a custom Magento 2 drop ship extension. Seeking to mitigate the overhead of their business model, McVickerStreet’s primary objective was to maintain control over the order process but to enable makers to complete shipments from their location. Specifically, they desired the ability to split a customer’s order into multiple shipments based on each product’s maker and print the appropriate shipping labels for each drop ship location, while charging the customer the correct amount in shipping cost.

An extension to enable drop shipping within the Magento environment touches upon several core areas of the Magento framework: product attributes, admin panel controls, data manipulation and storage, shopping cart UI, and 3rd party API. In this case, shipping is being handled by the 3rd party service EasyShip, which provides shipping rate options and their costs to the shopping cart for customers to select from, and then handles the purchase and printing of the shipping label itself. What follows is an outline of the challenges faced during the process of building a custom drop ship extension in Magento.

Shipment Flow Overview

The key functions of the drop ship extension map to the different actions required of the site administrator and customer, respectively, in order to fulfill a drop ship order from start to finish. These functions can thus be categorized and discussed in a quasi-chronological fashion. The steps are as follows:

  1. Setting up the address information for each of the respective drop ship locations
  2. Categorizing products in the store catalog according to their drop ship location
  3. Retrieving the correct shipping costs depending on the products in the customer’s shopping cart
  4. Displaying various shipping options to the customer in the shopping cart user interface
  5. Passing shipping information to a shipping manager, in this case EasyShip, for label generation
  6. Fulfilling the shipment from the drop ship location

Drop Ship Locations

Before any of the subsequent steps in the shipment flow can take place, the extension needs to know the drop ship warehouse locations. In the case of McVickerStreet, these locations were not warehouses but Makers, small businesses of their own, focused on producing handmade goods. The challenge here is to create a repository for those addresses, as well as provide an organization structure for them, and finally an admin panel interface for the store administrator to use. This allows the store administrator to easily add, remove, or modify a list of addresses. This can be accomplished by taking advantage of an essential feature of Magento extensions that allows the creator to initialize database tables during the extension install.

By creating a table with columns for standard shipping information like name, address, state, zip, etc., and adding unique ID columns for each Maker and Maker address, it quickly becomes easy to organize a list of makers and their addresses. Each Maker can also have multiple addresses, should they have their own collection of drop ship locations. This two-factor ID for drop ship locations may be overbuilt for some applications, in which case a single address ID can be used. Either way, the ID system will be used later to map individual products in the catalog to their drop ship location.

For the store administrator to modify their new drop ship address database, the extension can leverage Magento forms and grids. The grid element in the Magento admin panel allow for clean tabular display of database information with a variety of organizational features such as column sorting, filters, and text search. The form element is employed to create a pre-defined structure for the insertion of new address information. It can be built to include helpful features like data validation, helping the administrator to avoid typos or data formatting mistakes.

Product Attributes

Once the system for address management is in place, the next step is to map those address to the products themselves. The solution here is to leverage Magento’s product attribute system to add two new attributes to every product for the two-factor ID system discussed previously. If only one address ID is used, then simply add one new corresponding attribute.

Like the drop ship location database table, the creation of these attributes can be programmed into the extension installation procedure. This ensures that the attributes will be added correctly and automatically with every extension install, without the need for the store administrator to do so manually.

Adding the actual address ID values into the new attributes for every product can be accomplished manually or via SQL query directly into the database. The chosen approach is going to depend on the catalog size and structure. In the case of a large product catalog and a complicated network of drop ship locations, this step of the process can quickly become the most time consuming for the store administrator.

Shipping Costs

The process for altering shipping cost data for the different drop ship locations is going to vary from solution to solution. The primary factor in the case of McVickerStreet was the use of EasyShip, a 3rd party shipping service. With the installation of the EasyShip extension and the creation of an EasyShip merchant account, that service takes over the generation of shipping costs and their presentation to the user in the shopping cart during the checkout process. The extent to which different shipping options can calculated and how the shipments can be broken down by drop ship location is thus closely intertwined with the downstream data use.

Regardless of how exactly the costs themselves are generated, the process is dependent on the prior setup of drop ship addresses and product attributes. By reading the drop ship attribute ID information from the product and mapping that ID to an address in the drop ship address database, it becomes possible to segment the order into groups according to their ship from location and calculate a shipping cost for each group.

Many alternatives to this setup are possible depending on the desired level of accuracy in shipping costs. For example, it may be acceptable to provide a general estimate of the shipping cost to the customer, knowing that it will be sometimes high and sometimes low. The difference in cost will fall on the store owner, but they may be comfortable with that in exchange for a simpler and cheaper solution. An even more basic alternative exists where all shipping costs are calculated from one shipping location. This will introduce additional inaccuracies in the shipping cost presented to consumers, but if all the store owner desires is that the order get separated into different groups by address, for the purposes of shipping label printing, then that may also be acceptable.

Shopping Cart UI

The core shopping cart user interface of Magento assumes a single shipment per order, and as such, is designed to provide customers with a single choice of shipping preference. Customization of the shopping cart will be required and the degree of customization is dependent on the decisions made around how shipping costs are presented to the customer. In the case of McVickerStreet, they opted for a solution that presents a single shipping cost to the customer for the entire order, thus simplifying the UI changes required. As McVickerStreet’s customer’s requirements change they will have the ability to make additional changes to the UI presentation.

Shipping Labels

Once orders are confirmed, it’s time to generate shipping labels. This step once again depends greatly on the service used for shipment management. It is important to consider the desired flow for the generation of the label ahead of time. If this ultimate goal is a fully automated breakout of a single order into multiple shipping labels, complete with the correct drop ship location addresses and accurate shipping costs, then it is imperative that the shipment management service be capable of handling said procedure. Carrying the necessary address, cost, and product data through to the final step will depend on the API capabilities of the shipping service. If it is known ahead of time what the final shipping flow is expected to be, then a shipping service choice can be made accordingly. This choice then impacts the integration of shipping cost calculations and, to a lesser extent, UI customization.

Shipment Fulfillment

The final step in the shipping flow is for the drop shipping location to acquire the shipping label and ship the order. How this step works depends on the software used to print the labels, as well as other decisions related to the overall shipment volume. McVickerStreet is currently opting for a centralized solution to this problem, involving a single user generating all shipping labels and distributing them to the various Makers. This solution works for McVickerStreet due to the manageable volume of shipments. When dealing with larger numbers of shipments in the future, this manual solution can be swapped for an automated one, with each dropship location accessing the shipment management software and generating and printing the shipping labels relevant to their location.

Do you have experience with the drop ship business model or Magento? Do you want to learn more about building a custom Magento extension? Please comment below and we’ll be happy to discuss your thoughts.

Leave a Reply

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