Shipping Suite¶

Introduction¶
It's widely reported that high shipping costs are the main reasons why people might abandon shopping carts. Hence, optimizing this aspect is vitally important for every eCommerce store.
Out of the box, Magento only allows you to restrict shipping methods for specific countries. Changing the default shipping rates and costs, offering free shipping or using promotional rates are not available in the default version of the platform.
Magento 2 Shipping Suite extension not only has the above-mentioned functionality, but also significantly expands it.
To better understand the key features of the extension, it is important to define several shipping-related terms.
Shipping Carrier¶
Generally, a shipping carrier is a company that delivers customers' orders by air, land, sea, etc. For example, popular shipping carriers are DHL, UPS, FedEx and others. Some of them available in Magento 2 out of the box (one can find them in STORES ⟶ Configuration ⟶ SALES ⟶ Shipping Methods)

Others can be setup with the help of third-party extensions.
Note that all carriers are connected with shipping methods. As you may see, the configuration page has the name (Shipping Methods not the Shipping Carriers). This is because the list of the carriers includes the setup of all shipping methods. Also, in order to create a new method, one has to specify a carrier that will be associated with it.
Shipping Method¶
A shipping method is a way to fulfill the delivery to customers via a shipping carrier.
Shipping methods can vary according to different criteria, such as a warehouse location, country, shipment sizes, weights, the desired delivery time. Some examples of the Shipping Methods are USPS Express Mail, DHL Flat Rate Box Shipping, UPS two-day, DHL Jetline etc.
One can find all the list of the shipping methods available in the Magento 2 installation by checking the shipping methods condition section in e.g. MARKETING⟶Promotions⟶Cart Price Rules.

Here, you can see the list of the methods arranged in the groups of the corresponding carriers.
Shipping Rates¶
Shipping rate is a price at which a certain order is delivered from point A (merchant's warehouse or store) to point B (the customer).
With the extension, shipping rates can be defined for each new/existing shipping method.
Rates are set by the shipping carrier. Their amount depends on various factors, such as the mode of transport (truck, train, ship, aircraft), the weight of the ordered goods, product dimension and the distance to the delivery destination.
The default Magento allows importing a CSV list of the table rates for only one method of one carrier.

So to sum up, the full structure of our extension supposes such use mechanism :
-
Manage Shipping Carrier
-
Add Shipping Methods for this carrier
-
Create or adjust the method’s Shipping Rates
Location Groups¶
This notion refers to the geographical area that you want to ship to. It may be useful when separate areas of the countries/group of countries share some mutual shipping costs (like EU region)
Requirements and Installation¶
Shipping Suite supports both Community and Enterprise edition of Magento starting from version 2.1. The current version of Magento installed on your website can be found in the lower right corner of any backend page.

Shipping Suite has 3 separate ways of installation:
1) Copy the code (ready-to-paste package);
2) Use local Composer;
3) Use MageWorx Repository.
Extension Configuration¶
To start the setup, we'll go through the full aforementioned algorithm: Carriers-Methods-Rates. After this initial setup is ready, we'll check the Shipping Zones configuration and how Shipping Rules and Restrictions are working.
Shipping Carriers¶
Log into the Magento Admin panel and go to STORES ⟶ MageWorx Shipping Suite ⟶ Shipping Carriers.

Please note that during the initial setup this grid will be empty.
The columns can be sorted alphabetically by clicking the column title.
To create a new carrier click the Add New Carrier button.
The initial setup of the carrier consists of the 2 tabs.
1. Carrier settings¶
-
Default Title - A name of the Shipping Carrier. The customer will see it during checkout.
-
Sort Order - A sort order of a shipping carrier on the checkout.
-
Is Active - The toggle that lets you enable/disable the carrier to be visible on the website.
-
System Name - That is the name of the carrier made for your reference. This information won't be visible on the frontend.
-
Carrier Code - The system code for the carrier name. This information won't be visible on the frontend.
-
Store View - You can assign the certain shipping carriers to the store views you want these carriers will be visible on.
2. Labels¶

Labels Section is designed for different frontend names of the carrier on different store views. Some carriers may need to be translated and, for this matter, this section allows specifying the appropriate name. Please note that if the string is empty, the initial Title specified in the Carier's configuration will be used
Once you hit the Save button, the Method Settings appear. Here, you can tweak the Shipping Methods for this Carrier.

Clicking the Add Method opens Shipping Method configuration settings. Actually, these are the same settings as the main Shipping Methods configuration with the only difference: if you specify the Shipping Method from the scratch, you need to select the carrier of this message while if you open it via the carrier this information is redundant and, therefore, hidden.

Shipping Methods¶
To configure Shipping Method, go to STORES ⟶ MageWorx Shipping Suite ⟶ Shipping Methods.

Please note that during the initial setup this grid will be empty.
The columns can be sorted alphabetically by clicking the column title.
To create a new carrier, click the Add New Method button.
The initial setup of the method consists of the 2 tabs.
1. Method Information¶
-
Carrier - in the dropdown you can select the desired carrier created in the STORES ⟶ MageWorx Shipping Suite ⟶ Shipping Carriers
-
Title - the name of the shipping method title. The customer will see it during the checkout.
-
Code - the system code for the method name. This won't be visible on the frontend.
-
Active - the toggle that enables/disables the carrier on the website.
-
Store View - this multi-select allows you to assign a method to ceertain store view(s).
-
Hide method if there are no valid rates - in case the shipping method doesn't contain any rates and this setting is enabled, the method will be hidden.
-
Replace method's title - if the rate has it own title, enabling this setting will replace the original method title with the title of the applicable rate with the highest priority.
-
Price - the initial price of the shipping method for the customer. If no rates are applied, this will be regarded as the method's price.
-
Min Price Threshold and Max Price Threshold - if multiple rates can be applied for some cart, the price can be changed significantly, so it is highly recommended to define the lowest and the highest possible price. These limits are used only for the price calculated from the rates; they don't change the method's own price if there are no valid rates.
-
Ignore Virtual Products Price - if enabled, the price of the virtual products in the cart is not counted in the subtotal used for the rates.
-
Use Subtotal with Discount - if enabled, the rates' Subtotal from and Subtotal To conditions use the subtotal after discounts.
-
Cost - the initial price of the shipping method for the merchant. If no rates are applied, this will be regarded as the method's cost.
-
Multiple rates price calculation - this setting manages the method price calculation if multiple rates can be applied for some cart. Can be the rate with the min or max price, the rates can sum up or the rate with the highest priority only to be selected.
-
Free Shipping Allowed - the store owner may the Cart Price Rules specified in MARKETING⟶Promotions⟶Cart Price Rules
Alternatively, this can be some setting in the third-party extension. Our methods will rewrite this original rule but if the store owners wish it to be accomplished, they may enable the Free Shipping Allowed toggle.
The following method configuration provides the possibility to specify the delivery time. It can be taken globally for the method or specified directly for any rate.
-
Display the Estimated Delivery Time on front-end - enables or disables this feature.
-
If Allow to replace Estimated Delivery Time is enabled, then the rates ETA will replace the original one.
-
Estimated delivery time min and max specify the delivery time range. These values can used in the description using the {{min_days}} {{min_hours}} / {{max_days}} {{max_hours}} variables as the template in the Delivery Time Message field.
-
Estimated Delivery Time Display Type can be either days or hours.
-
Estimated Delivery Time Message - This message will be displayed with the method title. You can use the following variables that will be replaced with the corresponding values: {{min_days}} {{max_days}} {{min_hours}} {{max_hours}}.
Examples
1) "Estimated Delivery Time Display Type" is set to "Days only (rounded)".
Estimated delivery time min = 5
Estimated delivery time max = 6
{{min_days}} will output 5,
{{max_days}} will output 6,
{{min_hours}} will output nothing,
{{max_hours}} will output nothing.
If the min or max value is set as the decimal value (5.6), then it will be rounded according to the math rules.
2) "Estimated Delivery Time Display Type" is set to "Hours"
Estimated delivery time min = 5
Estimated delivery time max = 6
{{min_days}} will output nothing,
{{max_days}} will output nothing,
{{min_hours}} will output 5,
{{max_hours}} will output 6.
If the min or max value is set as the decimal value (5.6), then it will be rounded according to the math rules.
3) "Estimated Delivery Time Display Type" is set to "Days with Hours"
Estimated delivery time min = 5
Estimated delivery time max = 6
{{min_days}} will output 5,
{{max_days}} will output 6,
{{min_hours}} will output nothing,
{{max_hours}} will output nothing.
4) Estimated delivery time min = 5.4
Estimated delivery time max = 6
{{min_days}} will output 5 hours 10 minutes,
{{max_days}} will output 6,
{{min_hours}} will output nothing,
{{max_hours}} will output nothing.
2. Labels¶

Labels Section is designed for different frontend names of the method on different store views. Some methods may need to be translated and for this matter this section allows specifying the appropriate name. Please note that if the string is empty, the initial Title specified in the methods configuration will be used.
You can also specify the delivery text for separate store views as well

Once you hit the Save button, the Rates Settings appears. It has the grid with the Shipping Rates for this Method.
Press the Add New Rate button to specify shipping rates for this method.
Shipping Rates¶
All the rates of all the methods are also listed in STORES ⟶ MageWorx Shipping Suite ⟶ Shipping Rates. You can add a new rate there with the Add New Rate button.
Shipping Rates configuration consists of 4 tabs.
1. Rate Information¶

Unique Code. The system code for the rate name. This won't be visible on the frontend.
Title. If populated, this would replace the initial name of the corresponding shipping method.
Active. The toggle that allows enabling/disabling the rate itself.
Priority. The bigger the number the higher the priority. Includes both positive and negative numbers.
Store View. The rates can be enabled for a selected store view(-s) only.
Price Calculation Method Allows either to overwrite the initial price of the method or to sum this value to the initial one.
The Estimated Delivery Time min and Estimated Delivery Time max, if populated, overwrite the method's delivery time range specified in the method's configuration.
2. Conditions¶

To begin with, the store owner can choose the shipping Country and the specific Region.
To specify the exact values of the customer's geographic location, it is possible to narrow the conditions down to the zip (postal) codes. The Zip Codes Validation Mode configuration has three settings:
-
none; in this case, the entire condition doesn't check the entered zip (postal) codes;
-
zip codes list; in this case, one can add the list of the zip (postal) codes separated by the commas to validate the rule;
-
zip codes ranges; in this case, one can add the ranges of the zip (postal) codes to validate the rule.
I If the zip code list was selected, two settings appear below this configuration:

Enable the Exclude Zip Codes option if you need to exclude the following list of the zip (postal) codes to validate this condition. The Zip Codes is the comma-separated list.
II If the zip codes ranges was selected, the diapason format and ranges workspace appears below:

First, you need to select the Zip Diapasons Format. Our extension supports various postal code formats:
-
for most countries select the default Numeric format;
-
for the postal codes in the UK, choose the Alphanumeric (UK). This format handles the rather complex system of the postal codes in the UK, dividing the code into 5 separate sections;
-
for the postal codes in the Netherlans, choose the Alphanumeric (NL). The postal code in the Netherlands comprises 2 separate sections and our extension uses this logic for handling such requests;
-
for the alphanumeric zip codes in any other countries, select Alphanumeric (Other).
When this is done, click the Add New Diapason. After that, you can specify the first and the last zip (postal) code from the codes range. If you need to exclude this range to validate the condition, click the Exclude toggle. The recycle bin icon deletes the range. The screenshot above provides the possibility to exclue the range of the zip codes (Philadelphia) in the selected region (Pennsylvania). You can combine these ranges: e.g., the first row enables the range of the postal codes, the second row excludes some smaller range within the first, bigger one.
Below these settings, the price, quantity and weight conditions can be set up:

Subtotal from and Subtotal To stand for the price of all the customer's products.
Total Qty From and Total Qty To stand for the quantity of all the customer's products.
Total Weight From and Total Weight To stand for the total weight of the customer's products.
3. Rate Pricing¶

Rate Pricing provides the price calculation for the rate. Depending on the configuration of the first tab, this setting either rewrites the initial value or adds up to it.
Total Price. Specifies the price of the method.
Price Per Each Product. If the cart consists of 5 units of product A and 3 units of product B, this value will be multiplied by 2 (per each product).
Price Per Each Item. If the cart consists of 5 units of product A and 3 units of product B, this value will be multiplied by 8 (per each item).
The difference between Per Product and Per Items
The "per Item" action uses each row in the cart as multiplier (5 same products in one row and 3 same items in another one is 2 items), the "per Product" action uses an each valid product as multiplier (5 same products in one row and 3 same items in another row = 8 qty).
Price Per Each Product (% of the method price). This depends on the initial price of the method. Assuming the initial price is $ 10. We still have 5 units of product A and 3 units of product B. The value in this field is 10%. Then we multiply 10% * 2 products. This is 20%. 20% from the initial price ($ 10) is $2.
Price Per Each Item (% of the method price). This depends on the initial price of the method. Assuming the initial price is $ 10. We still have 5 units of product A and 3 units of product B. The value in this field is 10%. Then we multiply 10% * 8 items. This is 80%. 80% from the initial price ($ 10) is $8.
Price Per Each Item (% of the item price). This depends on the price of the cart. Assuming we have 5 units of product A ($ 20 each) and 3 units of product B ($ 30 each). The value in this field is 10%. The full price in the cart is 5*20+3*30=190. 10% of the cart is $19.
Price Per 1 Unit of Weight. Depends on the weight units of the product. The unit of measurement defined for your locale in the configuration (can be pounds, grams etc).
4. Labels¶
Labels Section lets you set a different title of the rate for each store view. This tab is hidden if your store has only one store view.
Shipping Rules and Restrictions¶
Extension provides a range of highly-customizable shipping options and restrictions that can be personalized in various ways. To configure Shipping Rules, go to STORES ⟶ MageWorx Shipping Suite ⟶ Shipping Rules and Restrictions.

Please note that during the initial setup this grid will be empty.
The columns can be sorted alphabetically by clicking the column title.
To create a new rule, click the Add New Rule button.
Rule configuration consists of 4 tabs.
1. Rule Information¶

Rule Name and Description allow the store owner to locate a rule whenever it is needed. This information is shown in Shipping Rules and Restrictions grid.
Status can be changed to Inactive if the rule is currently not needed.
Priority The bigger the number, the higher the priority. Сan include both positive and negative numbers. The rule with the highest priority will be the first one to be executed.

The store owner can assign the rule to some particular store view and the clients' customer group.

Further, it is possible to manage time interval specification/settings. From here, you can set the days of the week, as well as the time rage when your shipping rule gets applied to orders. Enabling the Use Time checkbox shows the extra settings to specify the hours range when the rule is active or not.
2. Conditions¶
The extension allows you to create flexible conditions based on the product and cart attributes. You can also create the combinations of the different conditions and use the advanced logic operators ALL/ANY.

Product Attributes¶
The product attribute conditions allows you to create any conditions & combinations of the conditions using any product attribute.
Note
You should enable the "Use for Promo Rule Conditions" setting for the product attribute to display it in the list of available attributes in the conditions.
Cart Item Attributes¶
These attributes allow you to create the rules based on the specific cart items parameters:

-
Cart Item SKU (including custom options) - this condition verifies the final SKU of a product in the cart. If the product has the custom options, that add the SKU to the main product SKU, this rule will validate them as well, i.e. the final SKU with all extras will be checked.
-
Price in Cart - this condition verifies the product price in the cart, including the custom options and configurations.
-
Quantity in Cart - this condition verifies the product quantity in the cart, so you can create the shipping rules to be applied if a specific quantity of the necessary products are added to the cart.
-
Row Total in Cart - this condition verifies the total price of a product in the cart (the product price * quantity added).
Stock Item Attributes¶
This set of the attributes allows you to build the conditions based on the product stock and backorder status:

- Backordered - this condition has the possible values Yes/No and it checks if Magento 2 backorder is triggered for any product matching the other conditions (if any) in the cart.
Example
1) Let's assume, the product A has the available stock as 10 items and the backorder feature is enabled for it in Magento 2 store. A customer adds 20 items of this product to the cart -> 10 items are backordered by Magento 2 -> the backorder tirgger is activated and the rule with this condition will be validated.
2) Similar example but the product A is out of stock and the backorder feature is enabled for it in Magento 2 store. A customer adds any quantity of this product to the cart -> the backorder tirgger is activated and the rule with this condition will be validated.
-
Qty - this condition allows you to add the conditions based on the available product stock. It might be helpful if you need to add the rules if a product's stock is below a specific threshold or the product stock is in a specific range.
-
Qty Backordered - this condition verifies the product quantity backordered by Magento 2 in the cart.
Example
1) Let's assume, you have the rule with the following condition: Qty Backordered is more than 2.
The product A has the available stock as 10 items and the backorder feature is enabled for it in Magento 2 store. A customer adds 20 items of this product to the cart -> 10 items are backordered by Magento 2 -> the quantity backordered condition is validated (20 > 2) and the rule will be applied.
- Stock Item Status - this condition allows you to create the conditions based on the product stock status (In Stock / Out of Stock).
Cart Attributes¶
This set of the attributes allows you to create the conditions based on the customer's cart attributes:

Among Magento 2 standard cart attributes, the extension adds some specific ones:
-
Subtotal incl Tax - this condition allows you to apply a shipping rule based on a subtotal including a tax. This condition migiht be helpful if the subtotal in your Magento 2 includes the tax (STORES ⟶ Configuration ⟶ SALES ⟶ Tax ⟶ Shopping Cart Display Settings ⟶ Display Subtotal is set to Including tax). In this case if you create a rule with the condition by the Subtotal, Magento 2 will calculate the subtotal excluding tax. This condition allows using the subtotal with tax instead.
-
Subtotal with discount - this condition uses the subtotal after applying a discount. Thus, you can create the rules based on the final subtotal value. It might be helpful if you offer the free shipping for all orders above a specific value and you need to this total will be calculated after applying the discounts.
-
Coupon Code - this condition allows you to apply a shipping rule if a specific discount code is applied.
-
Shipping address parameters - these conditions allow you to apply a shipping rule if a specific shipping country, city, state/region, post code, street address or a city is entered by a customer.
-
Location Group (Shipping Zone) - this condition allows you to apply a shipping rule if a specific location group (shipping zone) created in our extension is used.
Customer Attributes¶
These attributes allow you to create the rules based on the specific customer attributes in your store. Example of the customer attributes:

You can hide some customer attributes from this list and set how these conditions work for the visitors who are not logged in. See the Customer Attributes settings.
3. Actions¶
The Actions section specifies what exact action(s) should be performed if the conditions are triggered.

The Stop Further Processing. allows the store owner to block all the other rules with lower priority when the current rule is triggered. If disabled, then the matching rules with a lower priority will be fulfilled.
The Type defines the action(s) you need to perform:
- Modify Shipping Cost
- Hide Shipping Method
- Change Data
- Show Shipping Method with Minimal Price
Modify Shipping Cost¶
This action allows you to modify the shipping cost using flexible rules and calculations, selected in the Modifier multi-select field:

The chosen actions are applied to the shipping methods, selected in the Apply to Shipping Methods box.

The full list of the Modifications:
| Shipping Cost (fixed/percent) (overwrite) | Shipping Surcharge (fixed/percent) (add) | Shipping Discount (fixed/percent) (deduct) |
| Shipping Cost Amount | Shipping Surcharge Amount | Shipping Discount Amount |
| Shipping Cost per Product | Shipping Surcharge per Product | Shipping Discount per Product |
| Shipping Cost Per Product Qty after X Qty | Shipping Surcharge per Product Qty after X Qty | Shipping Discount per Product Qty after X Qty |
| Shipping Cost Per Item | Shipping Surcharge Per Item | Shipping Discount Per Item |
| Shipping Cost Per Item after X Items | Shipping Surcharge Per Item after X Items | Shipping Discount Per Item after X Items |
| Shipping Cost Per 1 Unit of Weight | Shipping Surcharge Per 1 Unit of Weight | Shipping Discount Per 1 Unit of Weight |
| Shipping Cost Per 1 Unit of Weight after X Units of Weight | Shipping Surcharge Per 1 Unit of Weight after X Units of Weight | Shipping Discount Per 1 Unit of Weight after X Units of Weight |
| Shipping Cost Per X Unit of Weight | Shipping Surcharge Per X Unit of Weight | Shipping Discount Per X Unit of Weight |
| Shipping Cost Per X Unit of Weight After Y Units of Weight | Shipping Surcharge Per X Unit of Weight After Y Units of Weight | Shipping Discount Per X Unit of Weight After Y Units of Weight |
Shipping Cost totally replaces the initial price of this method. Shipping Surcharge adds the specified price to the initial price of the method. Shipping Discount deducts the specified price from the initial one.
All these available actions can be set as a fixed amount or as a percentage amount. If you specify a percent, the specified percent will be calculated from the products matching the conditions in the Apply to items section. If nothing is specified in that section, all the products added to the cart are used for the calculations.
Below we added the explanation for each action type, separated by the price mode: Overwrite, Surcharge and Discount.
Overwrite mode:
- Shipping cost Amount - this action overwrite a shipping cost on the checkout to a value specified in a rule.
Note
If you choose the percentage amount, it will be calculated from the initial shipping method price. Example: if a shipping price is $10 and the percentage shipping amount in the rule is 50%, then the final shipping price will be $5 (50% from $10).
- Shipping cost per Product - this action overwrite a shipping cost on the checkout to a value specified in a rule multiplied by the number of products in the cart. If you have any conditions in the "Apply to items" section, the products matching these conditions will be used only.
Example
"per Product" number is calculated as the number of products added to the cart multiplied to their quantities.
1) If there are 2 products in the cart: product A (qty 5) and product B (qty 3), then the specified shipping cost will be multiplied by 8 (if there are no any conditions in the "Apply to items" section).
2) If the product A from the case above matches the conditions from the "Apply to items" section only, then the specified shipping cost will be multiplied by 5, i.e. the product B will be ignored.
3) If you choose the percentage amount, it will be calculated from the prices of the products (multiplied by their quantities in the cart), which are matching the conditions in the "Apply to items" section.
- Shipping Cost Per Product Qty after X Qty - this action does quite the same as the previous one, but the multiplier will be calculated as the difference between the product quantity added to the cart and the X quantity, specified in this rule.
Example
1) If a customer added the product A in quantity of 6 to the cart and the X Qty is set as 4, then the specified shipping cost will be multiplied by 2 (6 - 4).
2) If a customer added the product A in quantity of 4 to the cart and the X Qty is set as 6, then the specified shipping cost won't be multiplied by anything since the X Qty amount is not reached (4 - 6).
The products are validated to match the conditions from the "Apply to items" section here as well.
3) If you choose the percentage amount, it will be calculated from the initial shipping method price.
- Shipping Cost Per Item - this action overwrite a shipping cost on the checkout to a value specified in a rule multiplied by the number of items in the cart.
Example
"per Item" uses each product row in the cart as multiplier (5 same products in one row and 3 same items in another one is 2 items). I.e. the product quantity is not used.
1) If a customer added the 4 different products to the cart (the number of items = 4), then the specified shipping cost will be multiplied by 4 (if there are no any conditions in the "Apply to items" section).
2) If a customer added 4 products to the cart (the number of items = 4) and only 2 items matches the conditions from the "Apply to items" section, then the specified shipping cost will be multiplied by 2.
3) If you choose the percentage amount, it will be calculated from the prices of the items (not multiplied by their quantities in the cart), which are matching the conditions in the "Apply to items" section.
- Shipping Cost Per Item after X Items - this action does quite the same as the previous one, but the multiplier will be calculated as the difference between the number of items in the cart and the X items number, specified in this rule.
Example
1) If a customer added the 4 different products to the cart (the number of items = 4) and the X Items is set as 2, then the specified shipping cost will be multiplied by 2 (4 - 2).
2) If a customer added 2 products to the cart (the number of items = 2) and the X Items is set as 4, then the specified shipping cost won't be multiplied by anything since the X Items number is not reached (2 - 4).
The products are validated to match the conditions from the "Apply to items" section here as well.
- Shipping Cost Per 1 Unit of Weight - this action calculates the shipping multiplier per each unit of the weight in your store. The unit of measurement defined for your locale in the configuration (can be pounds, grams etc).
Example
Let's assume the unit of weight in your store is lbs. The product A has the weight of 100 lbs. If you create a shipping rule with the action Shipping Cost Per 1 Unit of Weight and specify the shipping cost in this rule as $1, then the final shipping price on the checkout will be $ 100 ($ 1 x 100 lbs).
The products are validated to match the conditions from the "Apply to items" section here as well.
If you choose the percentage amount, it will be calculated from the initial shipping method rate, multiplied by the units of weight of the products, which are matching the conditions in the "Apply to items" section.
- Shipping Cost Per 1 Unit of Weight after X Units of Weight - this action does quite the same as the previous one, but the multiplier will be calculated as the difference between the X weight, specified in this rule, and the product weights in the cart.
Example
Let's assume the unit of weight in your store is lbs. The product A has the weight of 100 lbs. If you create a shipping rule with the action Shipping Cost Per 1 Unit of Weight and specify the shipping cost in this rule as $1 and set the X units of weight as 50 lbs, then the final shipping price on the checkout will be $50 ((100 lbs - 50 lbs) * $1).
The products are validated to match the conditions from the "Apply to items" section here as well.
If you choose the percentage amount, it will be calculated from the initial shipping method rate, multiplied by the units of weight of the products (total weight of the products - X weight), which are matching the conditions in the "Apply to items" section.
- Shipping Cost Per X Unit of Weight - this action allows you to specify the shipping cost per each X weight.
Example
Let's assume you need to increase the shipping cost per each 100lbs. In this case you can create a shipping rule with the Shipping Cost Per X Unit of Weight and set the X weight as 100 lbs. The shipping cost muliplier will be increased with each 100 lbs only. I.e. if your shipping cost in this rule is $1, the product A has the weight of 150 lbs, the shipping cost will be multiplied by 1 if this single product is added. However, if a customer adds 2 quantities of this product (the total weight is 300 lbs), the shipping cost will be multiplied by 3 (300 lbs / 100 lbs * $1 = $3).
The products are validated to match the conditions from the "Apply to items" section here as well.
- Shipping Cost Per X Unit of Weight After Y Units of Weight - this action allows you to specify the shipping cost per each X weight after certain weight value.
Example
Let's assume you need to increase the shipping cost per each 100lbs after the total of weight of 200lbs. In this case you can create a shipping rule with the Shipping Cost Per X Unit of Weight After Y Units of Weight and set the X weight as 100 lbs & Y to 200lbs. The shipping cost muliplier will be increased with each 100 lbs when the weight exceeds the 200lbs value. I.e. if your shipping cost in this rule is $1, the product A has the weight of 150 lbs. If a customer adds 2 quantities of this product (the total weight is 300 lbs), the shipping cost will be calculates as follows: (300 lbs - 200 lbs) / 100 lbs * $1 = $1).
The products are validated to match the conditions from the "Apply to items" section here as well.
Surcharge mode:
All actions, described above, are available as the surcharge as well. In this case, the calculated shipping cost will be added to the initial shipping price on the checkout and won't overwrite it. It can be useful if you need to add some shipping surcharges per specific items.
Discount mode:
All actions, described above, are available as the discounts as well. In this case, the calculated shipping cost will be deducted from the initial shipping price on the checkout and won't overwrite it. It can be useful if you need to apply some shipping discounts if specific products are added to the cart.
To select several methods, hold the Ctrl / Cmd key and click the items one by one.
To select a group, hold the Shift key and select the first and the last option.
The Sort Order setting allows you set the order, how the actions should be applied. The actions with higher priority are applied and calculated first. The actions with lower priority are applied after them and they use the shipping prices, calculated in the previous steps. I.e. if one shipping rule has the shipping overwrite (higher sort order) and the shipping surcharge (lower sort order), then the shipping final price will be calculated as shipping overwrite price + shipping surcharge.

If several rules have the same sort order (eg, 0), the rule that comes first on the multi select list will be applied first.
Use Cases
Click here to see the practical Use Cases of this functionality.
Hide Shipping Methods¶
This action allows to hide any specific shipping method(s) on the checkout and in the cart if the rule is triggered.

This table shows all the methods (including the default Magento ones like UPS, DHL etc and custom methods, created in our extension or in 3rd party extensions) that can be disabled at the checkout. To select several methods, hold the Ctrl/Cmd key and click the items one by one. To select a group, hold the Shift key and select the first and the last option.
If you select Display Error Message, the customer sees an error message instead of the hidden shipping method. Enter the text in the Error Message field. You can use the variables {{carrier_title}} and {{method_title}}: they are replaced with the titles of the hidden method. In a multi-store setup, you can also set the message for each store view.
Change Data¶
This action allows you to easily create the shipping rules that will change a shipping method title if specific conditions are met. It might be useful if you need to display different titles for the shipping methods based on the certain conditions without creating separate shipping methods for each case.

In order to change a title of a certain shipping method, you should choose the shipping method in the "Shipping method" drop-down and specify the necessary title in the "Default Title" field. If you need to specify the store-view title, you can do this in the fields for the store view values.
Show Shipping Method With Minimal Price¶
This action allows you to filter the shipping prices on the checkout dynamically for each customer's order and to keep the shipping method with the minimal price only, i.e. all other shipping methods will be hidden. The "Affected Shipping Methods" multi-select allows you to choose the shipping methods, which should be affected by this action.

By default, the one shipping method with the min price will be shown. If you need to display several shipping methods with the same min price (if such case occurs), then you should select the "Display all methods" check-box.
4. Apply to Items.¶
It lets you apply the rule to certain products in the cart using their various attributes. By default, the extension uses the rules for the whole cart. If you need to apply some rules to some particular products in the cart, you need to specify them in the apply to button tab.
Note that these rules are made only to filter the applying products. Therefore, you cannot disable some method, it just modifies the price/weight/quantity to be counted.

In this example, only the products with XS size will be counted.
Use Cases
Click here to see the practical Use Cases of this functionality.
Locations Groups¶
Location Groups refer to the geographical area that you want to ship to.
That may be important, for instance, to differentiate between the continental and non-continental part of the USA or in case you need to provide free shipping within the EU, you can create a custom shipping zone for that.
These zones can be later selected in the Condition Section of the Shipping Rules and Restrictions.

To configure the Location Group go to STORES ⟶ MageWorx Shipping Suite ⟶ Locations Groups (Shipping Zones).

Please note that during the initial setup this grid will be empty.
The columns can be sorted alphabetically by clicking the column title.
To create a new location group, click the Add New Location Group button.
Location Group configuration consists of 2 tabs.
1. Location Group Information¶

Location Group Name and Description allows the store owner to surface, sort out a certain group when it is needed.
Status can be changed to Inactive if the group is currently not needed.
Priority The bigger the number the higher the priority. Includes both positive and negative numbers.
The store owner can assign the group to some particular store view.
2. Conditions¶

Pop-up Zones¶
Frontend Experience¶
In the frontend, the extension adds the location block on the upper side of the website.
Note that if you do not observe the popup on the frontend, you need to enable it in the extension's configuration.

Clicking it opens the popup to specify the customer location.

First of all, the customer can select the desired zone. It contains the list of the countries that are configured as part of this zone

And the state/province as well

No more than 3 shipping zones are shown on the popup (less amount for mobile views). To select another zones the customer can use the buttons on the left/right corners or slide in case the device has the touchscreen.

To select the desired country and state, the user should click the Save Changes button. The X button is used to close the popup without saving.
Selecting the regions will allow to estimate the possible shipping costs in the product cart

Backend Experience¶
To configure Pop-up Zones, go to STORES ⟶ MageWorx Shipping Suite ⟶ Pop-up Zones.

Please note that during the initial setup this grid will be empty.
The columns can be sorted alphabetically by clicking the column title.
To create a new zone, click the Add New Zone button.
Zones configuration area consists of 2 tabs.
Pop-up Zone Information¶

Name. You can specify the name of the zone. It will be visible on frontend and on the backend in the grid in STORES ⟶ MageWorx Shipping Suite ⟶ Pop-up Zones..
Description. This information will be visible on the backend only.
Image. Uploading the image here will show it in the frontend. Not a required field

Active toggle enables/disables this zone. If disabled, it won't be visible on the frontend.
Sort Order. Sets the order of the zones in the popup.
Country. Select as many countries here as needed.
Store View. The zones can be enabled for a selected store view(-s) only.
Country Regions¶
Magento has the ability to select the states/provinces for the country.This comes important at the checkout step.
Unfortunately, in the default functionality, this feature is not available for all the countries (including such popular shipping destinations as the Netherlands or Italy).

The necessity to add the regions manually can cause many problems for the website visitors. The Country Regions option allows adding new regions and editing those provided out of the box.

Backend Configuration¶
To configure Country Regions, go to STORES ⟶ MageWorx Shipping Suite ⟶ Country Regions.

The regions that are provided out of the box can be temporary disabled or edited. To disable the region, click the Delete option, for editing, hit the Edit link.
To create a new region, click the Add New Region button.

Country specifies the country for the region.
Code provides the technical code for the region.
Is active toggle enables or disables this region, the Is Custom toggle is made to quickly filter the custom regions on the Regions grid on STORES ⟶ MageWorx Shipping Suite ⟶ Country Regions.
The Name field provides the name of the region. In most cases, the Default Name should be the same.
Shipping Methods Per Product¶
The extension provides the possibility to assign the shipping method for any particular product (or group of products). For this, log into the Magento Admin panel and go to CATALOG ⟶ Products. Choose the desired product to assign the corresponding shipping method.
This feature works only if the Enable Shipping per Products setting is enabled in the extension's configuration (enabled by default).

Here, in the Available Shipping Methods field, it is possible to select any shipping method that can be used for this particular product. If no shipping method is selected, the extension implements the scenario with all shipping methods enabled.
When the customer adds this product to the cart, only the selected shipping methods will be available for this order. If any other product with different methods is added to the cart, only those methods that are enabled for both products will be shown for this order. If the extension finds no overlapping shipping methods, it won't display any for this product selection on the checkout.
When the store owner saves the product, the selected shipping method/methods will be shown on the products grid.

Extension's Configuration¶
Extension’s configuration settings can be found under STORES ⟶ Configuration ⟶ MAGEWORX ⟶ Shipping Suite. The configuration itself consists of 7 tabs.
Shipping Suite Configuration¶

The Multiple rates price calculation feature is similar to the analogue one in the methods configuration setting, with the only difference that it works globally. This setting lets you manage the method price calculation if multiple rates can be applied to the same cart. It can be the rate with the min or max price, the rates can sum up or the rate with the highest priority only to be selected.
Enable Shipping per Products. If enabled, you can restrict the available shipping methods for each product. See Shipping Methods Per Product. Enabled by default.
Validation Settings¶

Advanced Postcode Validation: Is Enabled provides the ability to manage such complicated cases as the British Postcodes.

If the setting is enabled, the postcode itself is separated into several zones.
The zipcodes are compared with these parts acoordingly. If the area of the outward part (letters) is the same, then it checks the ditrict and so on. This allows to handle such postcodes correctly (even in the rules with the possibility to compare them in the less than/greater than format).
Possible poblems
Please note that though in most cases our extension parses the UK codes correctly, if the users themselves make the mistakes with the post code input, it may lead to the possible problems. E.g., the inward code on the image above consists of sector (9) and the unit (DN). Some post codes may be without the sector, so if the customer by mistake writes EH129 DN instead of EH12 9DN, it may cause the incorrect interpretation by means of our extension.
This setting is disabled by default as it is used only if the postcode type is alphanumeric.
Advanced Postcode Validation: excessive data means postcode is valid. If this setting is enabled, the store owner can use the partial postcodes, such as only the area in the outward part of the postcode. This allows to minify the number of the postcodes for the rules. For instance, in the picture provided, the store owner can use only the EH part to cover all the possible options of the postocode in this area.
One and only one zone can be set for the address in one time (most prioritized zone from available). The usage of the location groups may lead to the situation, when some country is used in several groups. If this setting is Enabled, then it uses only the zone with the max priority and won't use any other zone with this country. If it is Disabled, then it will be matched any time.
Enable extended country select in the rule conditions. If enabled, the countries by region will be added to the rules conditions section.

Enable advanced conditions for United Kingdom postcodes validation. If enabled, a bunch of new conditions (such as incode, outcode, area, district, sector, unit) will be added to the rules conditions section and to the conditions of the location groups.

Customer Attributes settings¶
Ignore the "customer attribute" conditions for visitors (not logged in). If set to Yes, all the conditions by customer attributes are regarded as true for the visitors who are not logged in. Disabled by default.
Attributes disabled in the customer conditions. The customer attributes selected here are not shown in the customer conditions of the rules.
Do not disable an attribute that you already use in the conditions. This may break the validation.
Shipping Methods Settings¶

- Rename Shipping Methods - this functionality allows you to rename any system shipping methods on the front-end.
- Sort Shipping Carriers - this setting enables the functionality to sort the shipping carriers on the front-end according to the sort orders added for them.
- Display the Cheapest Shipping Method at the Top. Other methods will be displayed next ascending by price from low to high. - if enabled, the shipping methods are sorted by price from low to high, so the cheapest one is the first. Disabled by default.
Rates Settings
- Include Tax in Subtotal during shipping rates validation - this setting allows including the tax in the subtotal in the rate's conditions.
- Max Countries Count (Rates Listing) - this setting allows you to limit the number of countries visible for the certain rates in the rates grid (12 by default).
- Max Regions Count (Rates Listing) - this setting allows you to limit the number of regions visible for the certain rates in the rates grid (12 by default).
Popup Configuration¶

Display Shipping Zones Popup If disabled, the popup will not be shown on the frontend.

Display Only Country & Region Fields If disabled, the region image won't be shown.
Import/Export Configuration¶
Use the ID field to bind fields during the import-export process. If enabled (default), the CSV file has the ID column and the extension uses it to find the existing carriers, methods and rates during the import. If disabled, only the code field is used to find the existing entities, while all the rates are created anew.
Countries by Region Configuration¶

The Rates Configuration section includes the possibility to select the Country. For the store owner, it may be useful to select the whole cluster of countries, which is especially useful for the overseas shipping. The Magento uses the standard continents names like Africa or Europe. Unfortunately, out of the box, these regions are not populated with the corresponding countries. These regions are supported for the Rates configuration as they can be found in the Country tab there.

In the Countries by Region Configuration tab, the store owner can change the default countries for this feature.

The tab has the following regions: Africa, North America, South America, Oceania, Western Africa, Central America, Eastern Africa, Northern Africa, Middle Africa, Southern Africa, Americas, Northern America, Caribbean, Eastern Asia, Southern Asia, Southeast Asia, Southern Europe, Australasia, Melanesia, Micronesian Region, Polynesia, Asia, Central Asia, Western Asia, Europe, Eastern Europe, Northern Europe, Western Europe and Latin America. Each of them is filled with its countries by default. To return the default list, use the Use system value checkbox.
More to come!
Though currently this functionality is provided only for the Rates and Rules configuration, we have plans to extend functionality to other settings as well.
Developer Settings¶
These settings help to find the issues with the extension in your store. Do not change them if you are not sure what they do. All of them are disabled by default.
Resolve Address Parameters from API Request. If enabled, the rules take the address parameters from the API request when they are missing in the address of the checkout session. It may be needed for the stores that send the checkout data through the API (for example, headless storefronts).
Enable shipping rules logger. Enables the shipping rules logger. Customers are not affected: the logger works only in a debug session started with the link below.
Debug session. Shown when the logger is enabled. The link Open the storefront with the logger (one link per website) opens the storefront in a debug session. The logger works only in the browser that opened this link, for 120 minutes. Save the configuration with the logger enabled before you click the link.
Enable SQL logger. If enabled, the extension writes the database queries used to load the shipping rates to the Magento log. It works only in the developer mode of Magento.
Default Shipping Method¶
The extension provides the ability to introduce dozens of Shipping Carriers and hundreds of Shipping Methods. However, it may be useful to do some tests before adding all this stuff.
For this purpose, the extension provides the default Shipping Method that can be edited in STORES ⟶ Configuration ⟶ SALES ⟶ Delivery Methods ⟶ MageWorx Shipping. It has the default price that can be modified by means of Shipping Rules and Restrictions.
The method is disabled by default. It has the standard Magento settings:
- Enabled, Title and Method Name - enable the method and set its names shown on the checkout (Example and MageWorx Shipping by default).
- Price - the price of the method (15.00 by default).
- Calculate Handling Fee and Handling Fee - add a fixed or a percent handling fee to the price.
- Displayed Error Message - the message shown when the method is not available.
- Ship to Applicable Countries and Ship to Specific Countries - limit the method to the selected countries.
- Show Method if Not Applicable - show the method with the error message when it can't be used for the customer's address.
- Sort Order - the position of the method on the checkout.
GeoIP Extension¶
GeoIP Extension is used for the Pop-up zones. After the installation of the extension it should be set up.
If you wish the more precise detection, change the Database Type to City. Note that in case you wish to use the Country type (Default one), you'll still need to update the DB.
Log into the Magento Admin panel and go to STORES ⟶ Configuration ⟶ MAGEWORX ⟶ GeoIP Extensions.

Due to new MaxMind policy, you should register an account at MaxMinde site and generate a new license key for GeoLite2 database and enter it in the "MaxMind License Key" field.
Note
You should use the following option, when generating the licence key: "Generate a license key and config file for use with geoipupdate versions older than 3.1.1. This key will be stored in an unhashed format."
Note: You should save the configuration after adding a license key first. If you click the Update Current Database button before saving the configuration, it will update the database of the previous type with the previous license key.
Product shipping cost calculator¶
The Shipping Suite has the functionality to display the Estimate Shipping block on the product page to give your customers the opportunity to estimate the shipping prices and see all available shipping methods right from the product page. See Shipping Cost Calculator guide for more details.
Import/Export Carriers/Methods/Rates¶
The extension has the possibility to export the carriers, methods, rates and to import them. Log into the Magento Admin panel and go to SYSTEM ⟶ Data Transfer ⟶ Express Import/Export Rates by MageWorx.

To import a file, choose it in the Import field and click the Import button. To check the structure of the CSV document, click the Export button or the Download link in the Download example CSV file row. The CSV may include all the three entities: Carriers, Methods and Rates in the single file. The column names in most cases may be logically assigned to these entities so we’ll observe them one by one.
csv
"IE Type","Name","Title","Carrier Code","Active","Price","Store Ids"
"carrier","Local Carrier","Local Carrier","localcarrier","1","0.00","[0]"
The IE Type determines the type of the full row, the values can be carrier, method or rate.
If the Use the ID field to bind fields during the import-export process setting is enabled (default), the file also has the ID column after the IE Type. See Import/Export Configuration.
The Name is the system name of the carrier made for your reference.
The Title is the actual name of the Shipping Carrier, Shipping Method or Shipping Rate that the customer will see during checkout.
The Carrier Code is the system code for the carrier name. This field should be populated for the method as well for the extension to detect that the method should be connected to this carrier.
The Active column checks whether the Shipping Carrier, Shipping Method or Shipping Rate should be enabled, put the 0 value for the disabled entity.
The Price is the initial price of the Shipping Method or Shipping Rate. Note that for the correct calculation you should use all the prices in the base currency.
The next group of columns are mostly populated for the Shipping Methods.
csv
"Replaceable Title","Code","Max Price Threshold","Min Price Threshold","Cost","Disabled Without Valid Rates","Multiple Rates Price","Allow Free Shipping"
"1","localdelivery","0.0000","0.0000","0.0000","1","0","1"
If the Replaceable Title value is 1, the Shipping Method’s name will replace the original Shipping Carrier name.
The Code is the system code for the Shipping Method name.
The Min and Max Price Threshold define the lowest and the highest possible shipping price values if multiple rates are applied.
The Cost is the actual cost of the shipping for the store owner.
The Disabled Without Valid Rates column checks whether the method should be hidden in case the shipping method doesn't contain any rates, put the 0 value to ignore this setting.
The Multiple Rates Price handles the situation when several rates are used at the same time. Put 0 for the rate with the max priority to be selected, 1 is for the rate with the max price, 2 states the rate with the min price and if you wish to sum up all the rates for the method, choose the 3.
The "Allow Free Shipping" column checks whether the method can rewrite the default free shipping rules (0) or not (1).
The next group of the values:
csv
"Estimated Delivery Time Min","Estimated Delivery Time Max","Replaceable Estimated Delivery Time","Estimated Delivery Time Display Type","Show Estimated Delivery Time","Estimated Delivery Time Message"
"1","2","1","0","1","Estimated delivery period is from {{min_days}} to {{max_days}}"
Bear in mind that the minimum and maximum time intervals can be set for the shipping rates as well. For the Estimated Delivery Time Display Type the values from the dropdown are matched as: 0 for the Days only (rounded); 1 for Hours only and 2 for Days with Hours.
The last group of columns should be populated for the rates.
csv
"Rate Code","Priority","Rate Method Price","Country Id","Region","Region Id","Zip From","Zip To","Price From","Price To","Qty From","Qty To","Weight From","Weight To","Price Per Product","Price Per Item","Price Percent Per Product","Price Percent Per Item","Item Price Percent","Price Per Weight","Method Code"
"heavyitems","0","0","US","MN","34","","","0","0","0","0","1","0","0","0","0","0","0","10","localdelivery"
The Rate Code is the technical name of the rate.
The bigger the number in the Priority column, the higher the priority. Includes both positive and negative numbers.
The Rate Method Price is allows either to overwrite the initial price of the metho(0) or to sum this value to the initial one(1).
To check the Country ID use this link and to detect the Region and Region ID you may use this method.
The next group of values are the conditional limits for Zip Codes, the price of the cart, the quantity and the weight of the products.
The prices rules and values have been explained prior in this manual.
B2B¶
The extension adds the extra attributes to the shipping rules available in Adobe Commerce B2B addon:
- company attributes
- company credits
In order to use these attributes you shoud install the following free compatiblity addons:
- for company attributes https://github.com/mageworx/module-shippingrules-company
- for company credits https://github.com/mageworx/module-shippingrules-company-credit
Hyvä theme¶
The extension out of the box has the integrations with Hyvä theme:
Note
The free compatibility addon must be installed. See this link for more details.
To install the Hyva compatibility module:
Installation via packagist.com
-
Install via composer
composer require hyva-themes/magento2-mageworx-shippingrules -
Enable module
bin/magento setup:upgrade
For developers¶
Logger usage¶
The logger shows, step by step, what the shipping rules do with every shipping method while you change the shipping address of a test order.
Start¶
-
Enable STORES ⟶ Configuration ⟶ MAGEWORX ⟶ Shipping Suite ⟶ Developer Settings ⟶ Enable shipping rules logger and save the configuration.
-
Click Open the storefront with the logger in the same section (one link per website). The link opens the cart and binds this browser to a debug session for 120 minutes. A new link starts a new debug session with an empty Story. If the session can't be started (the setting is disabled, the link has expired, the IP is not allowed), the storefront says why.
-
The cart opens with the Shipping rules panel in the bottom right corner. Change the address, the quantity or the coupon: the panel shows the last rates collection. The highlighted methods have changed since the previous record; click a method to see what every rule did with it. Buttons: ↻ check again, Δ show or hide the changes, ⌘ print the record to the console, – collapse, ✕ stop the debug session. A rule in the panel opens its edit page in the admin panel.
-
The same is available in the browser console. Run
mwxShippingRulesLogger.watch()to print every rates collection, andmwxShippingRulesLogger.stop()to leave the debug session.
Notes¶
-
Customers are not affected. Without the debug session, the logger collects nothing and its script is not loaded.
-
The logger does not need RequireJS and works on any theme. On the themes with RequireJS, the old entry point
require('uiRegistry').get('shippingRulesLogger')returns the same object. -
The allowed IPs from STORES ⟶ Configuration ⟶ ADVANCED ⟶ Developer ⟶ Developer Client Restrictions are checked too. An empty list allows everyone who has the link. In the production mode, Magento hides this section: set the list with
bin/magento config:set dev/restrict/allow_ips <ip>. -
A headless storefront sends the token in the
X-Mwx-Shipping-Loggerheader instead of the cookie. The token is the value of thetokenparameter of the link. The Story is returned byPOST mageworx_shippingrules/logger/indexwith both headers below:
curl -X POST https://example.com/mageworx_shippingrules/logger/index \
-H 'X-Mwx-Shipping-Logger: <token>' -H 'X-Requested-With: XMLHttpRequest'
-
The Story is kept in the Magento cache for 120 minutes after the last rates collection and is lost when the cache is flushed. It keeps the last 30 iterations and 256 KB at most; the oldest iterations are dropped first.
-
A failure of the logger never breaks the rates collection: the iteration is dropped and the reason is written to
var/log/mageworx/shippingrules/logger.log. -
stop()removes the cookies of this browser only. The token stays valid until it expires.
Entities¶
-
Story - array of Info, in the order the rates were collected.
-
Info - one rates request of a quote address (iteration), all the carriers included:
-
uid (string) - id of the iteration.
-
context (object) - what was calculated: time, area, url, store_id, customer_group_id, quote_id, address (
country_id,region_id,region_code,postcode,cityonly), package (qty,weight,value) and skipped_rules (the rules which did not take part: inactive, not assigned to the store view or the customer group, before or after their dates). -
error (object) -
classandmessageof the exception which broke the rates collection, if any. -
rules (object) - validation of the rules, the key is the rule id: rule_id, name, sort_order, valid, the reason (invalid_time, invalid_day_of_week, invalid_conditions) and validation_result (the checks of the conditions in the order they ran).
-
methods (object) - the key is the method code carrier_method. Each Method has carrier_title, method_title, carrier_price (the price before the rules) and the rules.
-
-
Rule inside a Method - what the rule did with this method:
-
index (int) - the rule application precedence. The first applied rule has 0.
-
rule_id (string|int) - the id of the corresponding rule, same as the key.
-
valid (boolean) - false when the rule was not applied because of the validation.
-
stop_processing (boolean) - the rule stopped the further rules.
-
processed (boolean) - the rule changed the method: disabled it, modified its cost, changed its title or added it to the min price filter.
-
disabled (boolean) - the rule has disabled the method.
-
cost_overwrote (boolean) - the rule has modified the method's cost.
-
changed_data (boolean) - the rule has changed the title of the method.
-
input_data (object) - the method before the rule: availability, price.
-
output_data (object) - the method after the whole rule: availability, price, title, detailed_actions (the actions of the rule with the details), rates_in_filter (min price filter).
-
The format of the Story has changed. Scripts written for the old format have to be updated.
Methods¶
All of them belong to mwxShippingRulesLogger, e.g. mwxShippingRulesLogger.getInfo(). i is the index of the Info in the Story or the beginning of its uid (printed by watch()); the last Info is used by default. The method code has the carriercode_methodcode structure, e.g. flatrate_flatrate.
| Method | Result |
|---|---|
watch(ms) |
prints every new iteration right after the rates are recalculated; keeps watching after the page reload |
unwatch() |
stops printing |
refresh() |
loads the Story from the server. refreshStory() is the old name. |
getStory() |
the loaded Story |
getInfo(i) |
the Info |
getContext(i) |
request, address and cart of the Info |
summarize(i) |
one row per method: title, carrier price, price after the rules, availability, applied and invalid rules. Try console.table(mwxShippingRulesLogger.summarize()) |
compare(i, j) |
what changed for the customer between two Info, the last two by default |
getRule(ruleId, i) |
validation of the rule |
getMethodInfoByCode('flatrate_flatrate', i) |
what the rules did with the method |
whenIsDisabled('flatrate_flatrate', i) |
the first rule which disabled the method |
explain('flatrate_flatrate', i) |
what every rule did with the method, in words |
getSkippedRules(i) |
the rules which did not take part and why |
getRuleUrl(ruleId) |
the admin page of the rule |
showDiff('flatrate_flatrate', 21, 24, i) |
how the price and the availability changed between the rules 21 and 24 |
stop() |
leaves the debug session |
help() |
this list in the console |
Got Questions?¶
Need help with the extensions? Feel free submit a ticket from https://www.mageworx.com/support/
MageWorx offers outstanding services developing custom-tailored solutions for Magento platform to attain your eCommerce objectives. Our professional impassioned team provides profound and custom oriented development of your project in a short timeframe.