This project is not covered by Drupal’s security advisory policy.

Commerce Shipping Price Matrix provides a shipping method that calculates the shipping costs for an order based on a price matrix i.e. the shipping costs depend only upon the order subtotal. An example price matrix is given in the attached image.

The price matrix can be uploaded in a CSV file of the following format:

// my-price-matrix.csv

0,fixed_amount,5
15,fixed_amount,10
30,percentage,0.33,12,30
100,percentage,0.2,25,100

Matrix interpretation

The example matrix would be interpreted as follows. Assuming the currency is in USD, orders with subtotal between $0 and $14.99 will be charged a fixed amount of $5 in shipping costs. Orders with subtotal between $15 and $29.99 will be charged a fixed amount of $10. Orders between $30 and $99.99 will be charged 33% of the order subtotal but with a minimum charge of $12 and a maximum charge of $30. Orders with subtotal of $100 or higher will be charged 20% of the order subtotal with a minimum charge of $25 and a maximum charge of $100.

Currencies

There is currently no support for multi currencies - that is a feature that might be added in the future. The shipping method assumes that there is only one currency defined in the website and that the order is on the same currency as the price matrix.

Order subtotal calculation

Excluding product variation types

By default, the full order subtotal is used to calculate the shipping costs, i.e. all order items included. The shipping method can be configured to exclude certain product variation types from the order subtotal. For example, if an order contains an item with t-shirts with a total item price of $30 and an order item with shoes with a total item price of $60 and t-shirts are excluded from the order subtotal calculation, then the shipping costs will be calculated based on a $60 order subtotal.

Excluding individual product variations

A boolean field can be added to any or all product variation types that will specify whether or not an individual product variation should be excluded from shipping costs calculation. Configure the shipping method by choosing the boolean field in the method's Edit form (after adding it to one or more product variation types). When you create or edit a product variation, you can now select whether it should be excluded when calculating shipping costs.

Supporting organizations: 
Sponsored development

Project information

Releases