Magento is an open-source, cloud based eCommerce platform used for online stores. In 2015, the newest version of the platform, Magento 2, was released and it is this version that the nShift plugin supports. Follow this tutorial to setup an integration from Magento 2 to nShift DeliveryHub and start printing shipping labels in no time.
Your Magento 2 account must be linked to a Shipment Server account. Please contact our Customer service to get a Shipment Server account if you do not already have one.
This article will explain:
- Installation of the plugin
- Linking your Magento and nShift accounts
- Setting up Shipping Profiles
- Adding a checkout solution
- Download ZIP file
Installation of the plugin
You must install the Magento 2 pugin to use the integration. The plugin is currently pending approval by Magento and once it has been approved, it will be added to the Magento Marketplace. In the meantime, use this ZIP file.
Important note: The plugin does not support Magento versions over 2.3.
Follow these steps to install the files:
- Extract the zip archive on the server where your Magento platform resides.
- Copy and place the files in the following folder: app/code
- After copying the files, the following commands must be run on the Magento platform folder:
- php bin/magento module:enable Nshift_Integration --clear-static-content
- php bin/magento setup:di:compile
- php bin/magento setup:upgrade -f
- php bin/magento module:status
- php bin/magento setup:static-content:deploy -f --area adminhtml
- php bin/magento cache:flush
- After these commands have been successfully executed, the Magento module is installed and ready for use. Your Magento menu will now contain an nShift item.
Linking your Magento and nShift accounts
The first thing you must do after installing the plugin is link your accounts.
- In the left side menu, select Shift > Settings.
- Fill in the Magento API credentials. If you do not already have an access token, you can generate it here: https://devdocs.magento.com/guides/v2.4/get-started/authentication/gs-authentication-token.html (Note: The token must have access to "Orders" and "Shipments" in Magento 2).
- Fill in the nShift API credentials. The nShift credentials are your Portal username and the actor ID and key needed to connect to Shipment Server. Contact nShift Customer Service if you do not have these credentials.
- Finish by clicking the Save button. You can access the Settings page at any time if you need to update the information on the page.
Setting up Shipping Profiles
Once the integration is in place, the shipping profiles must be defined. A Shipping Profile in Magento corresponds to a product in Shipment Server and also holds information about additional services and goods types. There must be a shipping profile for each combination of products and services, so only configure the ones you need.
Follow these steps to configure a Shipping Profile:
- In the left side menu, select nShift > Shipping Profiles to access the configuration page.
- Click the Add Shipping Profile button.
- Type in a profile name and click Save. The system allows multiple profiles with identical names but we recommend using unique names to make it easier to identify the correct profiles later on.
- The list will look like this after adding the first Shipping profile. You may create multiple shipping profiles at this point.
- Each profile must be configured before it can be used. Select one of the available nShift products from the drop-down list.
- Select an available printer from the drop-down list. The printers shown are those configured in Drop Zone (read more). If you do not select a printer, the integration will create labels as PNG images by default.
- Select Enabled or Disabled in the Status column. To use a profile it must be set to Enabled.
- In the Action column, click on Settings to specify more information about the product. The options will vary from product to product and may contain additional services or information required for the product to work. The example below shows the form of a DHL Express product.
- Click Save to save your settings.
- The Details link in the Action column will open the carrier details page. This is only needed if you are using customs details for shipments crossing customs borders, e.g. shipments from inside the EU to destinations outside of the EU. This content is carrier specific and the example below shows a subset of the fields you will see on a DHL Express product.
- Click Save to save your settings. The shipping profile is now ready for use.
See also our article about Getting started with the Magento 2 plugin. This article will explain how to create orders and shipments.
Adding a checkout solution
The Magento 2 plugin also supports a checkout solution based on Shipping Rules. When the consumer enters the checkout, they are prompted with two alternatives:
- Postal address (home/work alternatives)
- Local collection point (drop points, pickup boxes)
Once selected, they get different address fields based on the selection.
Next Shipping Methods are returned from nShift Ship Advisor
Configuration of the checkout solution
Magento does not support delivery options to be sent dynamically, therefore we have created our own shipping method called Shipadvise.
You can find them in Store > Configuration > Sales > Shipping methods.
- Enabled: Yes
- Method Name: shipadvise
- Price: Any value. Will be overwritten by CSR.
- Sort Order: 1
- Title: shipavise
- Ship to Applicable Countries:
“All allowed Countries” or “Specific Countries” – Defines which countries that should appear in the drop downs.
- Displayed Error Message:
Error message to be displayed if nothing is found by shipping rules.
- Google Maps API Key:
Google key to add google map.
- Debug: Yes (SSTEST) / NO (SS PROD
- Token: Supplied by nShift
- QA Token: Supplied by nShift
- UPS Delivery Date Required (Hides shipping method if UPS delivery date is not provided):
"Yes" – If we can not find a match in the UPS Time in Transit the setting "Yes" will filter out the delivery option.
"No" – Ignore the UPS Time in Transit and display fallback ETA data if no match is found.
The checkout also supports a multi-store setting which gives you the possibility to connect a specific store to a specific actor on the nShift installation.
Saving selected shipping option
Currently, there is no connection between the checkout module and the shipping module.
This means that the selected shipping option must either:
- Be downloaded from the database and produced through COP/Shipment Server
- Manually selected in the nShift shipping module. The selected shipping option is stored on the Magento Order.
In the Magento database, we store:
- Carrier products and services
Format is shipadvise_prodcsid-serviceid|serviceid|serviceid
- Drop Point id
- Cutoff/despatch datetime
- Delivery datetime
Ordering a checkout solution
Contact nShift's Customer Service if you would like the checkout solution activated in your Magento 2 plugin.
Download ZIP file
- 2.5.0 - Bugfixes, extra debug tracking, and UX improvements.
- 2.4.0 - Complete rebranding from Consignor to nShift.
- 2.3.0 - Fixed issue with missing token on customer install.
- 2.2.0 - Added Ship Orders in Bulk interface meant to speed up shipping process.
- 2.1.0 - refactored customer install procedure and linked both admin plugin and checkout plugin to the same logic.
- 2.0.0 - added shipping methods and drop points in checkout using Shipment Server - Shipadvisor.
- 1.2.0 - solved issue with https on production and CORS policies.
- 1.1.0 - bugfixes.
- 1.0.0 - initial version.