Introduction

Route has developed a Magento Extension that adds secure shipping insurance to your orders. The extension has been tested on Magento 2.0, 2.1, 2.2 and 2.3.

If you are having issues with our extension please reach out to our customer support. Click here to get help.

The Route Shipping Insurance option simply sits on your checkout page, adding a layer of 3rd party trust to your site while improving your customer's shopping experience.

Route instantly protects your store, and your customers while covering losses, keeping more revenue in your pocket and your customers happy.

Guide for Route Extension installation

Magento Marketplace

After purchasing our extension from Magento Marketplace, copy the component name of our extension in the My Purchases page.

Currently: route/route-m2

Make sure you have composer set up with your access key provided by Magento Marketplace.

In your project root folder run the following command to install our extension:

composer require "route/route-m2"

You should see the following output:

home@localhost:/var/www/magento_root_folder$ composer require "route/route-m2"
Using version ^1.0 for route/route-m2
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing route/route-m2 (1.0.5): Downloading (100%)         
Writing lock file
Generating autoload files
								

Run the bin/magento setup:upgrade command, and you should see the following:

home@localhost:/var/www/magento_root_folder$ bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/magento_root_folder/generated/code/Composer
/var/www/magento_root_folder/generated/code/Magento
/var/www/magento_root_folder/generated/code/Symfony
/var/www/magento_root_folder/pub/static/deployed_version.txt
/var/www/magento_root_folder/pub/static/frontend
/var/www/magento_root_folder/var/view_preprocessed/pub
Updating modules:
Schema creation/updates:

Module 'Route_Route':
Schema post-updates:

[..]

Module 'Route_Route':
Data install/update:

[..]

Module 'Route_Route':
Data post-updates:

[..]

Module 'Route_Route':
Nothing to import.
								

Route has been successfully installed.

How to Setup your Extension

  • After plugin installation, go to the Magento Admin side and navigate to System -> Cache Management. Click on Flush Magento Cache.

  • After you clear the cache, sign out and sign in back to the admin.

Add Merchant Tokens

If you do not have merchant tokens, please sign up here.

You should have received three tokens from our team. A public token, a production secret token, and a test secret token.

The test secret token must be used if you're planning to place test orders only.

  • To enter the merchant tokens, navigate to Stores -> Configuration -> Route -> Integration Setup

Route Plus

Route Plus enables the insurance checkbox to be displayed on your checkout page. You have the option to disable the insurance option and only send us the order and tracking information.

To disable the Route Plus, change the select field to No.

Public and Secret Tokens

The public token is used to calculate the insurance amount on your checkout page.

The secret token is used to send the order and shipping information to Route's API.

The test secret token must be used if you're planning to place test orders only.

Apply Default Insurance

To apply default Route insurance for all products navigate to

Stores > Configuration > Route > Integration Setup , Select 'Opt-out' from default setting dropdown for preselecting route insurance checkbox during checkout otherwise select 'Opt-in' for not preselecting route insurance checkbox.

Route Label

You can change the text displayed on at your checkout page. By default, the text is going to be Route Shipping Protection.

Order Confirmation

You can check if an order was placed using Route Insurance by navigating to Sales -> Orders and then selecting a specific order.

If an order was placed adding Route, you will see the fee added to the order summary.

You can also see the Route API calls in the Comments History section.

Widget Block / Shortcode

Route provides a widget block/shortcode if your store uses a custom checkout system, or if you need to place the Route checkbox in another page such as a slide cart.

CMS / HTML

When editing the page in the CMS, you can add the Route Widget by adding the following block code:

{{widget type="Route\Route\Block\Widget\Widget" type_name="Route Widget"}}

This code will render the Route checkbox wherever you add it.

PHP

You can also render the checkbox in any PHP/PHTML file. You can add the following code to your file:

<?php echo $this->getLayout()->createBlock("Route\Route\Block\Widget\Widget")->toHtml(); ?>

Custom Line Item Integration

If you use a custom checkout system, or if Route is not showing up on your checkout page, Route provides three different solutions to fix this issue:

JSON response

You can make a request to get the JSON object containing the line item information.

Endpoint: /route/index/routeLine?format=json

Response:

{
  route: {
    label: "Route Insurance",
    amount: 0.98,
    currency: "USD",
    currency_symbol: "$"
  }
}

You can parse this JSON object and then add Route to your checkout page.

HTML output

The response will return a HTML snippet that can be appended to your checkout page. Since it returns a generic HTML code, you probably need to add some CSS code to customize its style.

Endpoint: /route/index/routeLine?format=html

Response:

<div class="route">
	<span class="label">Route Shipping Protection</span>
	<span class="amount">$1.23</span>
</div>

PHP

The PHP function will return an array containing the label and the amount to be displayed, similar to what the JSON object returns. You can call this function and then append it to your line items.

Add the Route Helper to your constructor:

public function __construct(
    [...]
    Route\Route\Helper\Data $helper,
    [...]
)
{ 
    [...]
    $this->_helper = $helper;
    [...]
}

Use:

<?php $this->_helper->getRouteLine(); ?>

Output:

[
	'label' => 'Route Shipping Protection', 
	'amount' => 1.23
	'currency' => 'USD'
	'currency_symbol' => '$'
]

Removing Legacy Version

Due to incompatibility issues, you must completely remove the old version of Route.
In order to do this, you should remove the following folders:

  • app/code/Route
  • app/code/Routeapp

Please make sure you have cleared the cache after removing the files.

After clearing the cache, please run the following command:

php bin/magento setup:upgrade