{"id":7236,"date":"2017-05-31T14:16:16","date_gmt":"2017-05-31T14:16:16","guid":{"rendered":"https:\/\/blog.mageworx.com\/?p=7236"},"modified":"2022-11-09T12:13:38","modified_gmt":"2022-11-09T12:13:38","slug":"magento2-using-shipping-action-types-and-their-combinations","status":"publish","type":"post","link":"https:\/\/www.mageworx.com\/blog\/magento2-using-shipping-action-types-and-their-combinations","title":{"rendered":"Shipping Suite Extension for Magento 2 \u2014  Shipping Actions &#038; Their Combinations"},"content":{"rendered":"\n<!-- SEO Ultimate (http:\/\/www.seodesignsolutions.com\/wordpress-seo\/) - Code Inserter module -->\n<!-- Google Tag Manager (noscript) -->\r\n<noscript><iframe src=\"https:\/\/www.googletagmanager.com\/ns.html?id=GTM-5DTCW7B8\"\r\nheight=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"><\/iframe><\/noscript>\r\n<!-- End Google Tag Manager (noscript) -->\n<!-- \/SEO Ultimate -->\n\n<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> 5<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><p><strong><a href=\"https:\/\/www.mageworx.com\/magento-2-shipping-suite.html\">Shipping Suite extension for Magento 2<\/a><\/strong> is equipped with a bunch of actions, action types and calculation methods. All these elements are interconnected, they can create various types of combinations that let you modify your shipping methods in any way.<\/p>\n<p>Basically, when a shipping rules is activated, it executes the following scenario:<\/p>\n<ol>\n<li>Select products that correspond to the conditions defined in the &#8220;Apply to Items\u201d section (if this aspect is ignored, all products are selected automatically).<\/li>\n<li>Calculate the basic (default) shipping cost for any valid product.<\/li>\n<li>Calculate the basic cost of an active shipping method.<\/li>\n<li>Perform shipping cost calculation according to the set conditions.<\/li>\n<\/ol>\n<p><!--more--><\/p>\n<p><strong><a href=\"https:\/\/www.mageworx.com\/magento-2-shipping-suite.html\">Shipping Suite<\/a> <\/strong>extension 2 lets you choose among three shipping actions. These are: <strong>overwrite, surcharge<\/strong> and <strong>discount<\/strong>.<\/p>\n<p>Each of these actions has 4 action types:<\/p>\n<ul>\n<li><em>Shipping Cost<\/em><\/li>\n<li><em>Shipping Cost Per Item<\/em><\/li>\n<li><em>Shipping Cost per Qty of Item<\/em><\/li>\n<li><em>Shipping Cost per 1 unit of Weight &nbsp;<\/em><\/li>\n<\/ul>\n<p>Each action type, in turn, has 2 calculation methods: <strong>fixed<\/strong> and <strong>percent<\/strong>.<\/p>\n<p>In this article, we\u2019ll slice and dice how shipping actions\/ their types and calculation methods work in our extension, and tell you how to tweak these settings according to your requirements.<\/p>\n<p><em><strong>As a Side Note<\/strong> <\/em><\/p>\n<p>In the examples below, we\u2019re going to use these 2 products:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-7241\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-1.png\" alt=\"Actions 1\" width=\"1783\" height=\"500\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-1.png 1783w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-1-600x168.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-1-1200x337.png 1200w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-1-768x215.png 768w\" sizes=\"auto, (max-width: 1783px) 100vw, 1783px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-7242 size-full\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-2.png\" alt=\"Actions 2\" width=\"382\" height=\"490\"><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Note, that if no shipping rules are set, you\u2019ll get somewhat like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7243\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-3.png\" alt=\"Actions 3\" width=\"1274\" height=\"789\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-3.png 1274w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-3-600x372.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-3-1200x743.png 1200w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-3-768x476.png 768w\" sizes=\"auto, (max-width: 1274px) 100vw, 1274px\" \/><\/p>\n<h3><\/h3>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>1. Setting a Shipping Cost as Percentage of the Cart Total.<\/h2>\n<p>If you need to set a shipping cost as a percentage of the cart total, you should use the &#8220;<strong>Shipping Cost per Qty of Item<\/strong>\u201d action type. Below is how to.<\/p>\n<p><strong><em>Given:<\/em> <\/strong><\/p>\n<p>In the shopping cart, there\u2019re 3 red shirts ($10 each) and a pair of green gloves (for $5).<br \/>\nThe cart Subtotal is $35 ($10 * 3 + $5 * 1).<br \/>\nThe default shipping cost is $7.5<\/p>\n<p><em><strong>Required :<br \/>\n<\/strong><\/em><\/p>\n<p>To set a shipping cost as 11% of the cart Total.<\/p>\n<p><em><strong>Solution:&nbsp;<\/strong> <\/em><\/p>\n<p>Using the action <em>&#8220;Shipping Cost per Qty of Item &#8211; Overwrite Amount (Percent)\u201d<\/em> (<span style=\"text-decoration: underline;\">Stores&nbsp; \u2014Shipping Rules &amp; Restrictions \u2014 Rule \u2014 Actions<\/span>) with the value set to \u201911\u2019, you can change the default shipping price calculation model to: \u2028\u2028(10 * 3 + 5 * 1) * 0.11 = 3.85 $ (that is 11 % of each item added to cart).<\/p>\n<p><strong><em>Actions:&nbsp; &nbsp;<\/em><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7245\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-4.png\" alt=\"Actions 4\" width=\"1179\" height=\"761\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-4.png 1179w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-4-600x387.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-4-768x496.png 768w\" sizes=\"auto, (max-width: 1179px) 100vw, 1179px\" \/><\/p>\n<p><strong><em>Cart:<\/em><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7246\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-5.png\" alt=\"Actions 5\" width=\"1023\" height=\"681\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-5.png 1023w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-5-600x399.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-5-768x511.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>2. Setting a Fixed Shipping Cost for Each Item Added to Cart<\/h2>\n<p>With the help of the next &#8220;<strong>Shipping Cost per Qty of Item &#8211; Overwrite Amount (Fixed)<\/strong>\u201d action type, and its value set to \u201911\u2019, you can modify a shipping price calculation model and define a shipping cost as a fixed amount for each items put into the shopping cart.<br \/>\n(3 + 1) * 11 = 44 $ ($11 for each item added to cart).<\/p>\n<p><em><strong>Actions:<\/strong><\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7250\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-6.png\" alt=\"Actions 6\" width=\"1179\" height=\"747\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-6.png 1179w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-6-600x380.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-6-768x487.png 768w\" sizes=\"auto, (max-width: 1179px) 100vw, 1179px\" \/><\/p>\n<p><em><strong>Cart:<\/strong> <\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7251\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-7.png\" alt=\"Actions 7\" width=\"1019\" height=\"674\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-7.png 1019w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-7-600x397.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-7-768x508.png 768w\" sizes=\"auto, (max-width: 1019px) 100vw, 1019px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>NOTE <\/strong><\/p>\n<p>For all your rules in this example, the \u2018Conditions\u2019 and \u2018Apply to Items\u2019 sections will be empty, which means that all shipping carts and added items are valid.<\/p>\n<p><em><strong>Conditions:<\/strong> <\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7254\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-8.png\" alt=\"Actions 8\" width=\"1172\" height=\"338\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-8.png 1172w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-8-600x173.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-8-768x221.png 768w\" sizes=\"auto, (max-width: 1172px) 100vw, 1172px\" \/><\/p>\n<p><em><strong>Apply to items:<\/strong><\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7255\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-9.png\" alt=\"Actions 9\" width=\"1138\" height=\"297\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-9.png 1138w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-9-600x157.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-9-768x200.png 768w\" sizes=\"auto, (max-width: 1138px) 100vw, 1138px\" \/><\/p>\n<p>These sections should be set according to your requirements, you can find more details on how to do that <strong><a href=\"https:\/\/support.mageworx.com\/manuals\/shipping_suite\/\">here.<\/a><\/strong><\/p>\n<h2>3. Setting a New Shipping Cost as a Percentage from the Default One<\/h2>\n<p>If you select the action &#8220;<strong>Shipping Cost &#8211; Overwrite Amount (Percent)<\/strong>\u201d, your shipping cost will be calculated on the base of the default one.<\/p>\n<p><em><strong>Given:<\/strong> <\/em><\/p>\n<p>In a shopping cart, there\u2019re 3 red shirts ($10 each) and a pair of green gloves (for $5).<br \/>\nThe cart Subtotal is $35 ($10 * 3 + $5 * 1).<br \/>\nThe default shipping cost is $7.50<\/p>\n<p><em><strong>Required:<\/strong><\/em><\/p>\n<p>To calculate a shipping amount as a percentage of the default shipping cost.<\/p>\n<p><em><strong>Solution:&nbsp;<\/strong> <\/em><\/p>\n<p>This is how to tweak the extension\u2019s settings to do that: enable the action &#8220;<strong>Shipping Cost &#8211; Overwrite Amount (Percent)<\/strong>\u201d (<span style=\"text-decoration: underline;\">Stores&nbsp; \u2014Shipping Rules &amp; Restrictions \u2014 Rule \u2014 Actions<\/span>) and set its value to \u201911\u2019.<\/p>\n<p>Thus, the extension will calculate a shipping cost as 11% from the default shipping amount.<\/p>\n<p>7.5 * 0.11 = 0.825 $ (or 0.83$ after round-up)<\/p>\n<p><em><strong>Actions:<\/strong><\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7257\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-10.png\" alt=\"Actions 10\" width=\"1186\" height=\"760\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-10.png 1186w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-10-600x384.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-10-768x492.png 768w\" sizes=\"auto, (max-width: 1186px) 100vw, 1186px\" \/><\/p>\n<p><em><strong>Cart:<\/strong> <\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7258\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-11.png\" alt=\"Actions 11\" width=\"1022\" height=\"698\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-11.png 1022w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-11-600x410.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-11-768x525.png 768w\" sizes=\"auto, (max-width: 1022px) 100vw, 1022px\" \/><\/p>\n<div class=\"page\" title=\"Page 8\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>&nbsp;<\/p>\n<h2>4. Setting a Fixed Shipping Cost<\/h2>\n<div class=\"page\" title=\"Page 8\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>With the help of the action &#8220;<strong>Shipping Cost &#8211; Overwrite Amount (Fixed)<\/strong>&#8220;, and setting its value to \u201911\u2019, you can set a fixed shipping fee amount. In our example it is $11.<\/p>\n<\/div>\n<p><em><strong>Actions:<\/strong><\/em><\/p>\n<div class=\"column\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7259\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-12.png\" alt=\"Actions 12\" width=\"1181\" height=\"702\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-12.png 1181w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-12-600x357.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-12-768x457.png 768w\" sizes=\"auto, (max-width: 1181px) 100vw, 1181px\" \/><\/p>\n<p><em><strong>Cart:&nbsp;<\/strong> <\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7260\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-13.png\" alt=\"Actions 13\" width=\"1023\" height=\"673\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-13.png 1023w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-13-600x395.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-13-768x505.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/p>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 9\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>&nbsp;<\/p>\n<h2>4. Setting a Shipping Amount for Each Order Row<\/h2>\n<div class=\"page\" title=\"Page 9\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Next two methods work quite similar to the &#8220;<strong>Shipping Cost per Qty of Item<\/strong>&#8221; action (with the exception of <em>the multiplier<\/em> used for calculating shipping costs).<\/p>\n<p>For the &#8220;<strong>Shipping Cost per Item<\/strong>\u201d action, the item added to cart acts as a multiplier (regardless of the quantity of products and their order).<\/p>\n<p><em><strong>Given:<\/strong><\/em><\/p>\n<p>In the shopping cart, there\u2019re 3 red Shirts ($10 each) and a pair of green gloves (for $5)<br \/>\nThe Cart Subtotal is $35 ($10 * 3 + $5 * 1)<br \/>\nThe default shipping cost is $7.50<\/p>\n<p><em><strong>Required:<\/strong><\/em><\/p>\n<p>To calculate a shipping amount as a percentage for each order row (regardless of how many items each row contains).<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 10\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><em><strong>Solution:<\/strong><\/em><\/p>\n<p>Using the action &#8220;<strong>Shipping Cost per Item &#8211; Overwrite Amount (Percent)<\/strong>&#8221; (<span style=\"text-decoration: underline;\">Stores \u2014Shipping Rules &amp; Restrictions \u2014 Rule \u2014 Actions<\/span>) and setting its value to \u201911\u2019, you can define a shipping cost as 11% of the item(s) that are on the 1st position in the cart.<\/p>\n<p>(10 * 1 + 5 * 1) * 0.11 = 1.65 $ (that is 11 % from the cost of the 1st item in cart, the total quantity of all products in cart is not taken into account).<br \/>\n<em><strong>Actions:<\/strong> <\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7261\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-14.png\" alt=\"Actions 14\" width=\"1172\" height=\"764\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-14.png 1172w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-14-600x391.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-14-768x501.png 768w\" sizes=\"auto, (max-width: 1172px) 100vw, 1172px\" \/><\/p>\n<\/div>\n<p><em><strong>Cart:<\/strong> <\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7262\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-15.png\" alt=\"Actions 15\" width=\"1023\" height=\"681\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-15.png 1023w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-15-600x399.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-15-768x511.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/p>\n<div class=\"page\" title=\"Page 11\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Using the action &#8220;<strong>Shipping Cost per Item &#8211; Overwrite Amount (Fixed)<\/strong>&#8221; (<span style=\"text-decoration: underline;\">Stores \u2014Shipping Rules &amp; Restrictions \u2014 Rule \u2014 Actions<\/span>) and setting its value to \u201911\u2019, you can define a shipping cost as $11 of each position in a shopping cart (note, the number of items in each position is not taken into account).<\/p>\n<p>(1 + 1) * 11 = 22 $ (that is 11 $ for each item in cart, regardless of the quantity of products in each item).<\/p>\n<p><em><strong>Actions:<\/strong> <\/em><\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7263\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-16.png\" alt=\"Actions 16\" width=\"1172\" height=\"769\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-16.png 1172w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-16-600x394.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-16-768x504.png 768w\" sizes=\"auto, (max-width: 1172px) 100vw, 1172px\" \/><\/p>\n<p><em><strong><br \/>\nCart:<\/strong> <\/em><\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7264\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-17.png\" alt=\"Actions 17\" width=\"1022\" height=\"678\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-17.png 1022w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-17-600x398.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-17-768x509.png 768w\" sizes=\"auto, (max-width: 1022px) 100vw, 1022px\" \/><\/p>\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>&nbsp;<\/p>\n<h2>6. Setting Shipping Cost that Depends on Weight<\/h2>\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>What concerns &#8220;<strong>Shipping Cost Per 1 Unit of Weigh<\/strong>t\u201d, calculations for this action will be the same as for &#8220;<strong>Shipping Cost per Qty of Item<\/strong>\u201d with the only exception: the weight (not the quantity) of all valid products will act as a multiplier.<\/p>\n<p><em><strong>Given:<\/strong><\/em><\/p>\n<p>In the shopping cart, there\u2019re 3 red shirts ($10 each) and a pair of green gloves (for $5). The Cart Subtotal is $35 ($10 * 3 + $5 * 1).<br \/>\nThe default shipping cost is $7.50<br \/>\nThe weight of a red shirt is 0.5 kg, green gloves weigh 0.1 kg<\/p>\n<p><em><strong>Required:<\/strong><\/em><\/p>\n<p>Set shipping costs that depend on the weight of items added to cart.<\/p>\n<p><em><strong>Solution:<br \/>\n<\/strong><\/em><\/p>\n<p>Using the action &#8220;<strong>Shipping Cost Per 1 Unit of Weight &#8211; Overwrite Amount <\/strong><strong>(Percent)<\/strong>&#8221; (<span style=\"text-decoration: underline;\">Stores \u2014Shipping Rules &amp; Restrictions \u2014 Rule \u2014 Actions<\/span>) and setting its value to \u201911\u2019, you can define the shipping cost this way:<\/p>\n<p>(0.5 * 3 + 0.1 * 1) * 7.5 * 0.11 = 1.32 $ (where 11% of the default shipping cost is multiplied by the total weight of all product Weight).<\/p>\n<p><em><strong>Actions:<br \/>\n<\/strong><\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7265\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-18.png\" alt=\"Actions 18\" width=\"1175\" height=\"767\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-18.png 1175w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-18-600x392.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-18-768x501.png 768w\" sizes=\"auto, (max-width: 1175px) 100vw, 1175px\" \/><\/p>\n<\/div>\n<p><em><strong>Cart:&nbsp;<\/strong> <\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7266\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-19.png\" alt=\"Actions 19\" width=\"1031\" height=\"692\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-19.png 1031w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-19-600x403.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-19-768x515.png 768w\" sizes=\"auto, (max-width: 1031px) 100vw, 1031px\" \/><\/p>\n<\/div>\n<div class=\"page\" title=\"Page 13\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Also, using the &#8220;<strong>Shipping Cost Per 1 Unit of Weight &#8211; Overwrite Amount (Fixed)<\/strong>\u201d with the set value \u201911\u2019, you can create a fixed shipping cost for each weight unit added to cart.<\/p>\n<p>(0.5 * 3 + 0.1 * 1) * 11 = 17.6 $ (in this case, $11 for each weight unit of every valid product in the shopping cart).<\/p>\n<p><em><strong>Actions:<\/strong> <\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7267\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-20.png\" alt=\"Actions 20\" width=\"1173\" height=\"768\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-20.png 1173w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-20-600x393.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-20-768x503.png 768w\" sizes=\"auto, (max-width: 1173px) 100vw, 1173px\" \/><\/p>\n<p><strong><em>Cart:<\/em> <\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7268\" src=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-21.png\" alt=\"Actions 21\" width=\"1031\" height=\"680\" srcset=\"https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-21.png 1031w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-21-600x396.png 600w, https:\/\/www.mageworx.com\/blog\/wp-content\/uploads\/2017\/05\/Actions-21-768x507.png 768w\" sizes=\"auto, (max-width: 1031px) 100vw, 1031px\" \/><\/p>\n<div class=\"page\" title=\"Page 14\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>&nbsp;<\/p>\n<h2><strong>Bottom Line<\/strong><\/h2>\n<p>As you can see, using <a href=\"https:\/\/marketplace.magento.com\/mageworx-module-shippingrulesmeta.html\"><strong>Magento 2&nbsp;Shipping Suite<\/strong><\/a> rules, their combinations with different sets of actions and their types, you can create different variations for your shipping method costs.<\/p>\n<p>Also, in a shipping rule, you can create any number of different actions that will be applied according to the set sort order.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> 5<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>Shipping Suite extension for Magento 2 is equipped with a bunch of actions, action types and calculation methods. All these elements are interconnected, they can create various types of combinations that let you modify your shipping methods in any way. Basically, when a shipping rules is activated, it executes the following scenario: Select products that [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":7237,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[426],"tags":[397],"class_list":{"0":"post-7236","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-extensions-tips-and-tricks","8":"tag-shipping-suite-ultimate"},"_links":{"self":[{"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/posts\/7236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/comments?post=7236"}],"version-history":[{"count":24,"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/posts\/7236\/revisions"}],"predecessor-version":[{"id":13765,"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/posts\/7236\/revisions\/13765"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/media\/7237"}],"wp:attachment":[{"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/media?parent=7236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/categories?post=7236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mageworx.com\/blog\/wp-json\/wp\/v2\/tags?post=7236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}