Magento 2 Matrix Rates

Magento 2 Matrix Rates helps store owner to offer and charge custom shipping rates based on shipping locations, product weight, price, and quantity.

Table of Content

  1. Extension Installation Guide
  2. Add Method to Import Matrix Rates
  3. Configuration
  4. Create Shipping Types Options
  5. Matrix Rates in Frontend
  6. Matrix Rates Details in Backend


  1. Extension Installation
  • For Magento Marketplace Customers
    • Find the Composer name and version of the extension in the extension’s composer.json file.
    • Login to your SSH and run:
      • composer require meetanshi/magento2-matrix-rates
  • Enter your authentication keys. Your public key is your username; your private key is your password.
  • Wait for Composer to finish updating your project dependencies and make sure there aren’t any errors.
  • To verify that the extension installed properly, run the command:
      • php bin/magento module:status Meetanshi_Matrixrate
    • By default, the extension is probably disabled.
    • Enable the extension and clear static view files:
      • php bin/magento module:enable Meetanshi_Matrixrate --clear-static-content
      • php bin/magento setup:upgrade
      • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
      • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
      • php bin/magento cache:flush


  • For Meetanshi Customers
  • Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
  • Login to your SSH and run below commands step by step:
  • php bin/magento setup:upgrade
  • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
  • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
  • php bin/magento cache:flush


  1. Add Method to Import Matrix Rates
    To import the Matrix Rates, go to Sales à Matrix Rates and add method from the “Add Method” button. All the already added and saved methods seen enlisted here.


  • Add New Rate to Import Matrix Rates
    Configure the following general settings to add new method.
    • Name: Add name for the matrix rate method. Use variable {day} to show estimated delivery days along with the rates. {day} variable will only show the value if the days have been added through shipping rates CSV.
    • Status: Set the status of the matrix rates method as “Active” from here.
    • Priority: Set priority for the method.
    • For Products with Different Shipping Types:
      • Sum Up Rates: Summarize rates for products of different shipping types in the cart.
      • Select Maximal Rate: Use only rate with maximal value for shipping type.
      • Select Minimal Rate: Use only rate with minimal value for specific Shipping Type.
    • Stores: Select the store view to which the matrix rates apply.
    • Customer Groups: Select customer groups to which the matrix rates apply.


  • Import Matrix Rates
    Move to “Import” tab to import matrix rates using CSV. Make sure to download the sample CSV to match the format of your shipping rates CSV.
    • Delete Existing Rates: All the existing rates will be removed when you try to save changes or import CSV with rates.
    • CSV File: Upload CSV file with Matrix rates in a proper formatting.

Click “Save” or “Save and Continue Edit” to save the matrix rates.



  • Methods and Rates
    To view the imported Matrix Rates, navigate to “Methods and Rates tab”. Here’s what each grid column means:
    • Country: Shows the country for which the rates will be applied.
    • State – Shows the state for which the rates will be applied.
    • City – Shows the city for which the rates will be applied.
    • Zip From - To – Indicates a specific postcode range. When it's filled like 'From: 20001 To: 30000' the rate will apply for all 1000 postcodes inside the 20001 - 30000 range. The UK postcode format is supported.
    • Price From - To – Indicates the prices for products with the same shipping type will be summarized.
    • Weight From - To - Same condition as above but for the weight attribute of the product.
    • Qty From - To - same as above but for the quantity in the shopping cart.
    • Shipping Type – All means the rate will be applied to all the products.
    • Rate – The applicable rate amount for the whole order.
    • PPP - Percentage per Product Price. Shipping will be calculated as a percentage of the product price.
    • FRPP - Indicates Fixed Rate Per Product Price. Shipping will be calculated multiplying product quantity in the cart by the value in FRPP field.
    • FRPUW - Indicates Fixed Rate Per Unit of Weight. The rate will be calculated based on the Weight of the product. For example, if FRPUW is set to 3.25 and Weight of the product in the cart is 4.15 then the calculation will be like this: 2.25*4.25=$13.48
    • Estimated Delivery (days) – Specifies the estimated delivery days for the shipping method. The days here will be inserted in the {day} variable which you can use in the Name field.

  • Download Shipping Rates CSV
    Once you have saved the matrix rates method, if in future, you require to download the rates, go to Sales à Matrix Rates, click on an existing method for which you want to download the CSV, move to “Import” tab and click on “Download” button besides the Existing Shipping Rates CSV.


  1. Configuration
    To configure the shipping method, login to Magento 2, move to Stores  à Configuration  à Sales  à  Shipping Methods à Matrix Rates where you can find various settings to configure the extension.
  • Enabled for Checkout: Set YES to enable Matrix Rates.
  • Title: Enter title of the shipping method.
  • Ship to Applicable Countries: Select countries to allow use of the shipping method.
  • Displayed Error Message: Enter error message for shipping unavailability.
  • Allow Free Shipping Promotions: Select YES to allow free shipping rule from shopping cart price will be applied.
  • Ignore Price and Quantity of Virtual Products: Select YES to ignore price and quantity of virtual products while calculating shipping.
  • Compare Post Codes as: Select an option on how you want to compare the added post codes in the CSV.
    • Range: Considers added post codes as post code range. For example, from 05101 to 05109 or from AB10 to AB50.
    • Regular Expression: Considers added post codes as regular expression. For example, BB%, %1B%, B%A%
  • Use price AFTER discount: Set YES to use price after deducting the discount.
  • Use price INCLUDING tax: Set YES to use price as inclusive of tax.
  • Use only one shipping type for shipping method: When set to YES, if the shopping cart is having products with different Shipping Types, the rate with 'Shipping Types = All' will be applied instead.
  • Sort Order: Set sort order of the shipping method to show in frontend.


  1. Create Shipping Types Options
  • Create Shipping Type Attribute Options
    To create the options for ‘shipping type’ attribute please go to Catalog à Products à Attributes Action à Edit Product Attribute "Shipping Type“ à Manage Label/Options.


  • Shipping Types Options
    Navigate to Properties tab in Attribute Information menu. As shown below, click “Add Option” button to add shipping type options.



  • Assign Shipping Type to Product
    Once the shipping options are created, assign value of the attribute to the product to calculate matrix rates based on.



  1. Matrix Rates in Frontend
    Once the settings are configured and shipping method is enabled, add a product to cart to see Matrix Rates calculated and applied in the frontend.

  • Matrix Rates on Cart Page
    When a customer adds products to cart, the Matrix Rates is displayed on the cart page.


  • Matrix Rates on Checkout Page
    Moving further to the checkout, Matrix Rates are also displayed on the checkout page.



  • Matrix Rates in My Account Page
    Immediately after the order is placed successfully using Matrix Rates shipping method, matrix rates detail is shown in “My Orders” tab under My Account section.


  1. Matrix Rates Details in Backend
    Apart from the frontend, the admin can see Matrix Rates details from Sales > Orders > Order view section in the backend.