How to Set up Magento Shipping

Jun 11, 2019451
How to Set up Magento Shipping

Discover how to configure Magento shipping, how to set up free shipping in Magento and how to manage Magento shipment programmatically.

Is shipping an important aspect of an ecommerce business? Online shopping is many-faceted, and in order to provide customers with the excellent shopping experience, an ecommerce owner should take care of a great many aspects: product images and descriptions, marketing, order management, inventory and warehouses, store design and interface, etc. Shipping is among these crucial aspects; in fact, just as it is impossible to make a first impression twice, you will be unable to regain your reputation after a badly organized or even failed shipping experience.

The level and quality of shipping organization depend, to a great extent, on an ecommerce platform itself. With Magento, one can perform both simple and sophisticated shipping configurations via admin panel and programmatically.

Read on and learn what shipping providers is Magento natively integrated and how to set up Magento shipping rates and free shipping in the back office. Apart from this, you will find out how to configure Magento shipment programmatically

Table of contents:

How to perform Magento shipping settings
How to configure Magento shipping table rates
How to сustomize the list of shipping methods in Magento 2
How to configure free shipping in Magento 2
Magento 2 create shipment programmatically
How to create shipment with tracking information in Magento 2
How to create partial shipment programmatically in Magento 2
How to create Magento 2 shipment via API

Magento international shipping integrations

According to recent research, over 90% of customers mark that the variety of shipping options are vital for a satisfactory shopping experience. Therefore, to be able to attract new customers as well as retail the loyal ones today, a store should provide global shipping and enough shipping options for a customer to choose from.

There is a number of established shipping companies, like DHL, UPS, DPD, Hermes and so on, that cater for international delivery. The majority of online businesses tend to rely on them for good-quality global shipping. However, the process of integrating the shipping solution of your choice into an ecommerce platform can be lengthy and complicated, which can discourage small businesses from shipping their goods internationally.

International shipping is not an issue with Magento. By default, Magento is connected to the major shipping providers, which greatly simplified the organization of shipping workflow.

Magento DHL shipping

dhl magento shipping integration

DHL (Dalsey, Hillblom and Lynn) International GmbH is an international courier company. Founded 50 years ago in the USA, it used to provide solely offshore delivery, but the popularity of FedEx encouraged it to engage in domestic delivery as well. DHL is the top Magento delivery partner, available in both Open Source and Commerce versions of the platform. Apart from this, DHL offers three native extensions that allow to expand the default functionality.

FedEx Magento shipping

magento fedex integration

FedEx, abbreviated from Federal Express, is a multinational courier company from Tennessee, US. FedEx provides ground, air and freight delivery all over the world. The company pioneered a package tracking system and location updates and is known for the fast delivery terms.

Magento UPS shipping

UPS (United Parcel Service) is a multinational package delivery company from Seattle, US. Founded back in 1911, it used to be a domestic delivery service, but with the development of transportation technologies, it entered the market of international delivery. UPS has 100.000+ delivery vehicles worldwide, with delivery vans, tractor trailers, bicycles, trains and airships among them. UPS is integrated into Magento as a default delivery method, but in case you need to expand the in-built functionalities, you can always find a selection of UPS extensions at the official Magento marketplace.

Magento USPS shipping

usps magento shipping integration

USPS, or United States Postal Service, is an independent branch of the US postal service, formed in 1971. USPS offers both domestic and international delivery by land and air and is famous for flat rate shipping for smaller size and lightweight items. Currently, it employs over 600.000 staff members and delivers 47% of all the mail worldwide. USPS is natively integrated into Magento ecommerce platform, which allows the retailer to launch US-wide and international delivery in no time.

As you can see, Magento natively integrates the core global shipping providers. In addition to this, Magento’s flexible open source architecture allows to carry out integrations with other third-party shipping providers, like Australia Post, UK Mail and so on. Therefore, when you choose Magento, there is no need to limit your business to the default options.

magento integration

Magento Integration

Take your online store to the new level with Magento integration service

Visit the page

How to perform Magento shipping settings

The first step in back office Magento shipping configuration is to set up the point of origin, which stands for the business or warehouse location from which the shipment is made.

Step #1: navigate to Stores -> Settings -> Configurations in Magento admin panel.

stores settings configure

Step #2: expand the Sales tab on the left and select Shipping Settings.

sales shipping settings

Step #3: enter the info about your point of origin into the Origin section.

sales shipping settings

Another Magento shipping configuration that is better to perform beforehand is establishing Shipping Policy Parameters. There, a store owner can identify his company shipment rules and guidelines, and this policy will be displayed during the checkout to every customer.

Step #1: expand the Shipping Policy Parameters section, located below the Origin.

magento shipping policy

Step #2: set up the Apply custom Shipping Policy at Yes.

shipping policy field

Step #3: paste your shipping policy into the appeared field.

Step #4: press Save Config in the upper right corner.

Having completed these basic settings, a store admin can proceed with configuring shipping in Magento 2 further.

How to configure Magento shipping table rates

In Magento, shipping rates are calculated from the combination of the following conditions:

  • Price v. Destination
  • Weight v. Destination
  • Number of items v. Destination

For each Magento store, a table with the rates should be prepared in CSV format and imported into the back office.

Step #0: make the shipping rates table.

For the demonstration’s sake, I will demonstrate what columns should shipping rates table for Weight vs. Destination consist of.

shipping rates table

When done, save the document as tablerates.csv.

Step #1: go to Stores -> Settings -> Configuration.

stores settings configure

Step #2: expand the Sales tab and select Shipping Methods.

shipping methods

Step #3: expand the Table Rates section and configure the following fields:

magento table rates

  • Enabled at Yes
  • Title – the name of the table rates section
  • Method Name – the title that will be displayed to a customer at the checkout
  • Condition – select one of the three alternatives
  • Include Virtual Products in Price Calculation – set at Yes to include, No to exclude
  • Calculate Handling Fee – if your store charges handling fee, select how it will be charged – Fixed or Percentage
  • Displayed Error Message – enter the text displayed in case of an error
  • Ship to Applicable Countries – either All Allowed or Specific Countries
  • Sort Order – determine the position of the table rates at the checkout

Step #4: press Save Config button.

Step #5: select Main Website store view in the upper left corner.

store view

Step #6: press the newly appeared Export CSV button to import the shipping rates spreadsheet created beforehand.

export csv

Step #7: press Save Config button.

Repeat this course of action to set up two remaining shipping rate tables.

Extensions for Magento 2

Magento 2 Extensions

Take your online store to the next level with BelVG Magento extensions

Visit the store

How to сustomize the list of shipping methods in Magento 2

There is no in-built functionality for customizing the list of shipping methods in Magento back office. Instead, these configurations can be performed programmatically by a skilled frontend developer. Below, you will find three-step instructions on how to customize a shopping methods list programmatically.

Step #1: create a template for the shipping method item.

Create the following file:

<root_dir>app/code/BelVG/Shipping/view/frontend/web/template/custom-method-item-template.html

Insert there the text from the default template

<Magento_Checkout_module_dir>/view/frontend/web/template/shipping-address/shipping-method-item.html with a couple of modifications:

  • Add <tr> element that contains the delivery method description
  • A column to expand \ hide the description
  • Wrap you code in the <tbody> to give context to the collapsing lines

Step #2: Create a template for shipping methods list

Create the following file <root_dir>app/code/BelVG/Shipping/view/frontend/web/template/custom-method-list-template.html
by copying the text of the template from Magento 2 <Magento_Checkout_module_dir>/view/frontend/web/template/shipping-address/shipping-method-list.htm. Introduce the following modifications:

  • Add your column into <thead>
  • Delete <tbody> because we already put it in the previous template

Step #3: Override the configuration of the shipping step

Create the layout in your module
<root_dir>app/code/BelVG/Shipping/view/frontend/layout/checkout_index_index.xml

There we override the default templates into the new ones we created in step 1 and 2. Now apply them as features of the shippingMethodListTemplate and shippingMethodItemTemplate methods in Magento_Checkout_module_dir>/view/frontend/web/js/view/shipping.js

Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Vlad

How to configure free shipping in Magento 2

Free shipping as a delivery method has been gaining popularity among large and small ecommerce retailers, and the majority of customers expect to see this option at the checkout. At the moment, you will be default find free shipping option at every global marketplace like AliExpress, iHerb or Asos; the local online stores also more often than not grant free shipping, depending on the order volume.

aliexpress shipping

iherb free shipping

asos free shipping

Free shipping plays a crucial role in the customers’ purchase decision; a client is encouraged and pleased by the fact that they do not have to run into additional costs with delivery. Whether to grant your customers a free delivery option or not is up to you, yet it is important to be aware of how to enable free shipping in your Magento store.

Follow this step-by-step instruction to enable Magento free shipping via back office.

Step #1: navigate to Stores -> Setting -> Configuration.

stores settings configure

Step #2: expand the Sales tab and select Shipping Methods

shipping methods

Step #3: expand the Free Shipping section and configure the following fields:free shipping magento

  • Enabled at Yes
  • Title – set the name for the free shipping method
  • Method Name – enter the method description (Free by default)
  • Minimum Order Amount – the order sum to qualify for free shipping
  • Displayed Error Message – enter the message to display in case an error occurs
  • Ship to Applicable Countries – select either All Allowed Countries or Specific Countries to select a certain destination state
  • Show Method if Not Applicable – if Yes, the free shipping method will show even if it is not available, if No, then free shipping will show only then available
  • Sort Order – set up the position of free shipping method among other shipping methods during the checkout.

It is not enough to make the Free shipping configuration – you must also accord these provisions with the shipping provider. In the Shipping Methods section, there are five tabs with the configurations for shipping methods Magento supports – Magento Shipping, UPS, USPS, FedEx and DHL. Expand the corresponding shipping method tab and set up the following:

Step #4: set Free Method at Ground, Free Shipping with Minimum Order Amount at Enable and define the Minimum Order Amount for Free Shipping (it should equal the one you set in the Minimum order Amount in the Free Shipping section).

ups free shipping

Step #5: press Save Config in the upper right corner.

Done! You have created Magento free shipping option.

Magento 2 create shipment programmatically

In Magento, there is a difference between shipping and shipment. While shipping relates to the organization of delivery, shipment stands for the whole process of dispatching the ordered item. Since it is a store admin who processes the orders and makes the decision about the shipment, there is a wide capability for creating, managing and cancelling Magento shipment in the back office.

There is an alternative to creating a new shipment in the Magento back office. If you possess enough Magento development knowledge or have developers on the team, then creating shipment programmatically may turn out to be a more convenient method for you.

Below you will find our example of a test controller that creates shipment programmatically from the order.

How to create shipment with tracking information programmatically in Magento 2

Magento also allows to add tracking information to a shipment. Now, we will demonstrate the developer method – how to add a tracking number and tracking information programmatically in Magento 2. In order to add tracking information for several shipping providers, we will modify the controller we already created during the $shipment shipment object creation.

How to create partial shipment programmatically in Magento 2

In order to create Magento partial shipment programmatically, follow these two steps:

Step #1: when you create $shipment object, pass into create() the array of the products that need to be delivered now [$orderItemId => $qty].

Step #2: modify the controller:

How to create Magento 2 shipment via API

To create Magento shipment via API, you need order_item_id of the items you want to send. In case you need to send a bundle product, then specify only the amount of the main product.

When you need to create Magento partial shipment, then specify the number of items you need to deliver now. As the product is successfully delivered, the whole order status is changed at Complete Endpoint.

Headers

Payload

If needed, you can add the tracking info into the tracks array.

Show code sample

Wrapping it up

We hope that this article will prove to be a useful guide into Magento shipping and Magento shipment programmatically configurations. The step-by-step instructions on how to set up basic and free Magento shipping will undoubtedly be useful to admins of large, middle and small online stores. We also believe that for both beginning and experienced Magento developers will find in our instructions useful tips and tricks for creating shipping and customizing shipping operations in their store.

If you have any questions or comments, feel free to leave them down below.

magento development services

Magento Development Services

Take your online store to the next level with BelVG Magento development

Visit the page

How useful was this post?

Average rating / 5. Vote count:

Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Vlad

Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *