{"id":12443,"date":"2017-02-21T14:19:12","date_gmt":"2017-02-21T11:19:12","guid":{"rendered":"http:\/\/blog.belvg.com\/?p=12443"},"modified":"2025-06-26T22:01:38","modified_gmt":"2025-06-26T20:01:38","slug":"creating-a-shipping-module-for-magento-2","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html","title":{"rendered":"Creating a Shipping Module for Magento 2"},"content":{"rendered":"\n<p>In this new article I&rsquo;m going to show you how to create a custom shipping module for Magento 2 platform. Here below you can see the structure of the module:<\/p>\n<p><!--more--><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter wp-image-12447 size-full\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/02\/newShipping-structure.png\" alt=\"Creating a Shipping Module for Magento 2\" width=\"465\" height=\"288\" title=\"Creating a Shipping Module for Magento 2\"><\/p>\n<p>1. At first let&rsquo;s register our module in the system. In order to get that done we should create the following files:<\/p>\n<p><i><span style=\"font-weight: 400;\">app\/code\/BelVG\/NewShipping\/etc\/module.xml<\/span><\/i><\/p>\n<pre class=\"lang:xml decode:true\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"..\/..\/..\/..\/..\/lib\/internal\/Magento\/Framework\/Module\/etc\/module.xsd\"&gt;\r\n   &lt;module name=\"BelVG_NewShipping\" setup_version=\"1.0.0\"&gt;\r\n   &lt;\/module&gt;\r\n&lt;\/config&gt;\r\n<\/pre>\n<p>and <i><span style=\"font-weight: 400;\">app\/code\/BelVG\/NewShipping\/registration.php<\/span><\/i><\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\r\n   \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\r\n   'BelVG_NewShipping',\r\n   __DIR__\r\n);\r\n<\/pre>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/magento-custom-development\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/magento-custom-development.png\" width=\"120\" height=\"120\" alt=\"magento custom development\" class=\"module_image\" title=\"Creating a Shipping Module for Magento 2\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Custom Development<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento Custom Development<\/p><a href=\"https:\/\/belvg.com\/magento-custom-development\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n<p>2. We should provide an ability for users to configure the new shipping method. That&rsquo;s why we must create new fields in admin panel (<i><span style=\"font-weight: 400;\">Stores-&gt;Configuration-&gt;Sales-&gt;Shipping Methods<\/span><\/i><span style=\"font-weight: 400;\">). And that is what will help us: <\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">app\/code\/BelVG\/NewShipping\/etc\/adminhtml\/system.php<\/span><\/i><\/p>\n<pre class=\"lang:xml decode:true\">&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"..\/..\/..\/..\/Magento\/Config\/etc\/system_file.xsd\"&gt;\r\n   &lt;system&gt;\r\n       &lt;section id=\"carriers\" translate=\"label\" type=\"text\" sortOrder=\"320\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\"&gt;\r\n           &lt;group id=\"belvg_newshipping\" translate=\"label\" type=\"text\" sortOrder=\"0\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\"&gt;\r\n               &lt;label&gt;BelVG New Shipping&lt;\/label&gt;\r\n               &lt;field id=\"active\" translate=\"label\" type=\"select\" sortOrder=\"1\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"0\"&gt;\r\n                   &lt;label&gt;Enabled&lt;\/label&gt;\r\n                   &lt;source_model&gt;Magento\\Config\\Model\\Config\\Source\\Yesno&lt;\/source_model&gt;\r\n               &lt;\/field&gt;\r\n               &lt;field id=\"title\" translate=\"label\" type=\"text\" sortOrder=\"3\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\"&gt;\r\n                   &lt;label&gt;Title&lt;\/label&gt;\r\n               &lt;\/field&gt;\r\n               &lt;field id=\"name\" translate=\"label\" type=\"text\" sortOrder=\"3\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\"&gt;\r\n                   &lt;label&gt;Method Name&lt;\/label&gt;\r\n               &lt;\/field&gt;\r\n               &lt;field id=\"price\" translate=\"label\" type=\"text\" sortOrder=\"4\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"0\"&gt;\r\n                   &lt;label&gt;Shipping Cost&lt;\/label&gt;\r\n                   &lt;validate&gt;validate-number validate-zero-or-greater&lt;\/validate&gt;\r\n               &lt;\/field&gt;\r\n               &lt;field id=\"sallowspecific\" translate=\"label\" type=\"select\" sortOrder=\"7\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"0\"&gt;\r\n                   &lt;label&gt;Ship to Applicable Countries&lt;\/label&gt;\r\n                   &lt;frontend_class&gt;shipping-applicable-country&lt;\/frontend_class&gt;\r\n                   &lt;source_model&gt;Magento\\Shipping\\Model\\Config\\Source\\Allspecificcountries&lt;\/source_model&gt;\r\n               &lt;\/field&gt;\r\n               &lt;field id=\"specificcountry\" translate=\"label\" type=\"multiselect\" sortOrder=\"91\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"0\"&gt;\r\n                   &lt;label&gt;Ship to Specific Countries&lt;\/label&gt;\r\n                   &lt;source_model&gt;Magento\\Directory\\Model\\Config\\Source\\Country&lt;\/source_model&gt;\r\n                   &lt;can_be_empty&gt;1&lt;\/can_be_empty&gt;\r\n               &lt;\/field&gt;\r\n               &lt;field id=\"showmethod\" translate=\"label\" type=\"select\" sortOrder=\"92\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"0\"&gt;\r\n                   &lt;label&gt;Show Method if Not Applicable&lt;\/label&gt;\r\n                   &lt;source_model&gt;Magento\\Config\\Model\\Config\\Source\\Yesno&lt;\/source_model&gt;\r\n               &lt;\/field&gt;\r\n               &lt;field id=\"specificerrmsg\" translate=\"label\" type=\"textarea\" sortOrder=\"95\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\"&gt;\r\n                   &lt;label&gt;Displayed Error Message&lt;\/label&gt;\r\n               &lt;\/field&gt;\r\n               &lt;field id=\"sort_order\" translate=\"label\" type=\"text\" sortOrder=\"100\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"0\"&gt;\r\n                   &lt;label&gt;Sort Order&lt;\/label&gt;\r\n               &lt;\/field&gt;\r\n           &lt;\/group&gt;\r\n       &lt;\/section&gt;\r\n   &lt;\/system&gt;\r\n&lt;\/config&gt;\r\n<\/pre>\n<p>3. Here we create configuration file of our new module:<\/p>\n<p><i><span style=\"font-weight: 400;\">app\/code\/BelVG\/NewShipping\/etc\/config.php<\/span><\/i><\/p>\n<pre class=\"lang:xml decode:true\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"..\/..\/..\/Magento\/Store\/etc\/config.xsd\"&gt;\r\n   &lt;default&gt;\r\n       &lt;carriers&gt;\r\n           &lt;belvg_newshipping&gt;\r\n               &lt;active&gt;0&lt;\/active&gt;\r\n               &lt;model&gt;BelVG\\NewShipping\\Model\\Carrier\\Shipping&lt;\/model&gt;\r\n               &lt;title&gt;BelVG New Shipping&lt;\/title&gt;\r\n               &lt;name&gt;Custom Shipping&lt;\/name&gt;\r\n               &lt;price&gt;0&lt;\/price&gt;\r\n               &lt;sallowspecific&gt;0&lt;\/sallowspecific&gt;\r\n               &lt;specificerrmsg&gt;This shipping method is not available. Please contact us, to use this method.&lt;\/specificerrmsg&gt;\r\n           &lt;\/belvg_newshipping&gt;\r\n       &lt;\/carriers&gt;\r\n   &lt;\/default&gt;\r\n&lt;\/config&gt;\r\n<\/pre>\n<p>4. The next step is creating a model of shipping method, where we can describe the logical circuitry of <i><span style=\"font-weight: 400;\">app\/code\/BelVG\/NewShipping\/Model\/Carrier\/Shipping.php. <\/span><\/i><span style=\"font-weight: 400;\">And here it is necessary to implement these two methods: <\/span><i><span style=\"font-weight: 400;\">collectRates<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">getAllowedMethods.<\/span><\/i><\/p>\n<pre class=\"lang:php decode:true\">use Magento\\Framework\\App\\Config\\ScopeConfigInterface;\r\nuse Magento\\Framework\\DataObject;\r\nuse Magento\\Shipping\\Model\\Carrier\\AbstractCarrier;\r\nuse Magento\\Shipping\\Model\\Carrier\\CarrierInterface;\r\nuse Magento\\Shipping\\Model\\Config;\r\nuse Magento\\Shipping\\Model\\Rate\\ResultFactory;\r\nuse Magento\\Store\\Model\\ScopeInterface;\r\nuse Magento\\Quote\\Model\\Quote\\Address\\RateResult\\ErrorFactory;\r\nuse Magento\\Quote\\Model\\Quote\\Address\\RateResult\\Method;\r\nuse Magento\\Quote\\Model\\Quote\\Address\\RateResult\\MethodFactory;\r\nuse Magento\\Quote\\Model\\Quote\\Address\\RateRequest;\r\nuse Psr\\Log\\LoggerInterface;\r\nuse Magento\\Customer\\Model\\Session;\r\nuse Magento\\Framework\\App\\RequestInterface;\r\n\r\nclass Shipping extends AbstractCarrier implements CarrierInterface\r\n{\r\n   \/**\r\n    * Carrier's code\r\n    *\r\n    * @var string\r\n    *\/\r\n   protected $_code = 'belvg_newshipping';\r\n\r\n   \/**\r\n    * Whether this carrier has fixed rates calculation\r\n    *\r\n    * @var bool\r\n    *\/\r\n   protected $_isFixed = true;\r\n\r\n   \/**\r\n    * @var ResultFactory\r\n    *\/\r\n   protected $_rateResultFactory;\r\n\r\n   \/**\r\n    * @var MethodFactory\r\n    *\/\r\n   protected $_rateMethodFactory;\r\n\r\n   public $_productRepo;\r\n\r\n   protected $checkoutSession;\r\n\r\n   protected $quoteIdMaskFactory;\r\n\r\n   \/**\r\n    * @param ScopeConfigInterface $scopeConfig\r\n    * @param ErrorFactory $rateErrorFactory\r\n    * @param LoggerInterface $logger\r\n    * @param ResultFactory $rateResultFactory\r\n    * @param MethodFactory $rateMethodFactory\r\n    * @param array $data\r\n    *\/\r\n\r\n   public function __construct(\r\n       ScopeConfigInterface $scopeConfig,\r\n       ErrorFactory $rateErrorFactory,\r\n       LoggerInterface $logger,\r\n       \\Magento\\Framework\\App\\Helper\\Context $context,\r\n       \\Magento\\Checkout\\Model\\Session $checkoutSession,\r\n       \\Magento\\Customer\\Model\\Session $customerSession,\r\n       \\Magento\\Framework\\App\\Http\\Context $httpContext,\r\n       \\Magento\\Quote\\Model\\QuoteIdMaskFactory $quoteIdMaskFactory,\r\n       \\Magento\\Store\\Model\\StoreManagerInterface $storeManager,\r\n       \\Magento\\Catalog\\Model\\ProductRepository $productRepo,\r\n       ResultFactory $rateResultFactory,\r\n       MethodFactory $rateMethodFactory,\r\n       array $data = []\r\n   ){\r\n       $this-&gt;_rateResultFactory = $rateResultFactory;\r\n       $this-&gt;_rateMethodFactory = $rateMethodFactory;\r\n       $this-&gt;_productRepo = $productRepo;\r\n       $this-&gt;checkoutSession = $checkoutSession;\r\n       $this-&gt;customerSession = $customerSession;\r\n       $this-&gt;_storeManager = $storeManager;\r\n       $this-&gt;scopeConfig = $scopeConfig;\r\n       $this-&gt;quoteIdMaskFactory = $quoteIdMaskFactory;\r\n       parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);\r\n   }\r\n\r\n   public function collectRates(RateRequest $request)\r\n   {\r\n       if(!$this-&gt;getConfigFlag('active')){\r\n           return false;\r\n       }\r\n       \/** @var \\Magento\\Shipping\\Model\\Rate\\Result $result *\/\r\n       $result =  $this-&gt;_rateResultFactory-&gt;create();\r\n       \/** @var \\Magento\\Quote\\Model\\Quote\\Address\\RateResult\\Method $method *\/\r\n       $method = $this-&gt;_rateMethodFactory-&gt;create();\r\n       $method-&gt;setCarrier($this-&gt;_code);\r\n       $method-&gt;setCarrierTitle($this-&gt;getConfigData('title'));\r\n       $method-&gt;setMethod($this-&gt;_code);\r\n       $method-&gt;setMethodTitle($this-&gt;getConfigData('name'));\r\n       $shippingPrice = $this-&gt;getConfigData('price');\r\n       $method-&gt;setPrice($shippingPrice);\r\n       $method-&gt;setCost($shippingPrice);\r\n\r\n       $result-&gt;append($method);\r\n       return $result;\r\n   }\r\n\r\n   \/**\r\n    * Get allowed shipping methods\r\n    *\r\n    * @return array\r\n    *\/\r\n   public function getAllowedMethods()\r\n   {\r\n       return [$this-&gt;_code =&gt; $this-&gt;getConfigData('name')];\r\n   }\r\n}\r\n<\/pre>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/store.belvg.com\/\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/06\/Magento-store.belvg_.com_.png\" width=\"481\" height=\"480\" alt=\"Magento store.belvg.com\" class=\"module_image\" title=\"Creating a Shipping Module for Magento 2\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Extensions<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento extensions<\/p><a href=\"https:\/\/store.belvg.com\/\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the store<\/span><\/a><\/div><\/div><\/div>\n<p><span style=\"font-weight: 400;\">Whereafter we should enable the module by running the following commands:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\"> php bin\/magento module:enable -c BelVG_NewShipping<\/span><\/i><\/p>\n<p><i><span style=\"font-weight: 400;\"> php bin\/magento setup:upgrade<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">And here in admin panel we are able to configure the shipping method:<\/span><\/p>\n<p><em>Stores-&gt; Configuration-&gt; Sales-&gt; Shipping Methods<\/em><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter wp-image-12444 size-belvg-post-content\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/02\/admin-shipping-850x434.png\" alt=\"Creating a Shipping Module for Magento 2\" width=\"850\" height=\"434\" title=\"Creating a Shipping Module for Magento 2\"><\/p>\n<div class=\"content_sales_info\" style=\"background-image: url(https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/03\/Sales_background.png\"><img width=\"65\" height=\"65\" src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2015\/11\/Andrey_Dubina.png\" alt=\"Andrey_Dubina\" title=\"Creating a Shipping Module for Magento 2\"><div class=\"content_part\"><h3 class=\"title\">Partner With Us <\/h3><span class=\"sales_content_text\">Let's discuss how to grow your business. Get a Free Quote.<\/span><\/div> <a class=\"call-to-action\" href=\"https:\/\/belvg.com\/contact?utm_source=blog&amp;utm_campaign=sales_block&amp;utm_content=middle\" target=\"_blank\" rel=\"noopener\">Talk to Andrey<\/a><\/div>\n<p><span style=\"font-weight: 400;\">And what concerns the frontend, during the order placement process a user can simply select our new shipping method.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter wp-image-12446 size-belvg-post-content\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/02\/checkout-shipping-850x243.png\" alt=\"Creating a Shipping Module for Magento 2\" width=\"850\" height=\"243\" title=\"Creating a Shipping Module for Magento 2\"><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter wp-image-12445 size-belvg-post-content\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/02\/shoppingcart-shipping-850x536.png\" alt=\"Creating a Shipping Module for Magento 2\" width=\"850\" height=\"536\" title=\"Creating a Shipping Module for Magento 2\"><\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/migration-to-magento-2\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/06\/migration-to-magento-2.png\" width=\"100\" height=\"100\" alt=\"migration to magento 2\" class=\"module_image\" title=\"Creating a Shipping Module for Magento 2\"><div class=\"module_content_part\"><h3 class=\"title\">Magento 2 Migration<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento 2 Migration<\/p><a href=\"https:\/\/belvg.com\/migration-to-magento-2\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"In this new article I&#8217;m going to show you how to create a custom shipping &#8230;","protected":false},"author":58,"featured_media":12448,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,389],"tags":[],"class_list":["post-12443","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-magento","category-magento2-development","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"In this new article I\u2019m going to show you how to create a custom shipping module for Magento 2 platform. Here below you can see the structure of the module:\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Aleksander Kutseika\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#article\",\"name\":\"Creating a Shipping Module for Magento 2 | BelVG Blog\",\"headline\":\"Creating a Shipping Module for Magento 2\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/^71C97B36589987677836C4EF569FCFE298ED0819E634A30610^pimgpsh_fullsize_distr.jpg\",\"width\":770,\"height\":209,\"caption\":\"Creating a Shipping Module for Magento 2\"},\"datePublished\":\"2017-02-21T14:19:12+02:00\",\"dateModified\":\"2025-06-26T22:01:38+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#webpage\"},\"articleSection\":\"Magento, Magento 2 Development, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"position\":2,\"name\":\"Magento\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#listItem\",\"name\":\"Creating a Shipping Module for Magento 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#listItem\",\"position\":3,\"name\":\"Creating a Shipping Module for Magento 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika\",\"name\":\"Aleksander Kutseika\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/20dcba617ca05952a14d36e3f30fc6a632094549decebf7a03ba790095042cd3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Aleksander Kutseika\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html\",\"name\":\"Creating a Shipping Module for Magento 2 | BelVG Blog\",\"description\":\"In this new article I\\u2019m going to show you how to create a custom shipping module for Magento 2 platform. Here below you can see the structure of the module:\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/^71C97B36589987677836C4EF569FCFE298ED0819E634A30610^pimgpsh_fullsize_distr.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html\\\/#mainImage\",\"width\":770,\"height\":209,\"caption\":\"Creating a Shipping Module for Magento 2\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/creating-a-shipping-module-for-magento-2.html#mainImage\"},\"datePublished\":\"2017-02-21T14:19:12+02:00\",\"dateModified\":\"2025-06-26T22:01:38+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Creating a Shipping Module for Magento 2 | BelVG Blog","description":"In this new article I\u2019m going to show you how to create a custom shipping module for Magento 2 platform. Here below you can see the structure of the module:","canonical_url":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#article","name":"Creating a Shipping Module for Magento 2 | BelVG Blog","headline":"Creating a Shipping Module for Magento 2","author":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/02\/^71C97B36589987677836C4EF569FCFE298ED0819E634A30610^pimgpsh_fullsize_distr.jpg","width":770,"height":209,"caption":"Creating a Shipping Module for Magento 2"},"datePublished":"2017-02-21T14:19:12+02:00","dateModified":"2025-06-26T22:01:38+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#webpage"},"articleSection":"Magento, Magento 2 Development, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","position":2,"name":"Magento","item":"https:\/\/belvg.com\/blog\/category\/magento","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#listItem","name":"Creating a Shipping Module for Magento 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#listItem","position":3,"name":"Creating a Shipping Module for Magento 2","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author","url":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika","name":"Aleksander Kutseika","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/20dcba617ca05952a14d36e3f30fc6a632094549decebf7a03ba790095042cd3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Aleksander Kutseika"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#webpage","url":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html","name":"Creating a Shipping Module for Magento 2 | BelVG Blog","description":"In this new article I\u2019m going to show you how to create a custom shipping module for Magento 2 platform. Here below you can see the structure of the module:","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/02\/^71C97B36589987677836C4EF569FCFE298ED0819E634A30610^pimgpsh_fullsize_distr.jpg","@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html\/#mainImage","width":770,"height":209,"caption":"Creating a Shipping Module for Magento 2"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html#mainImage"},"datePublished":"2017-02-21T14:19:12+02:00","dateModified":"2025-06-26T22:01:38+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"12443","title":"Creating a Shipping Module for Magento 2 | #site_title","description":"In this new article I\u2019m going to show you how to create a custom shipping module for Magento 2 platform. Here below you can see the structure of the module:","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:22","updated":"2026-11-03 18:37:22"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento\" title=\"Magento\">Magento<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCreating a Shipping Module for Magento 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento","link":"https:\/\/belvg.com\/blog\/category\/magento"},{"label":"Creating a Shipping Module for Magento 2","link":"https:\/\/belvg.com\/blog\/creating-a-shipping-module-for-magento-2.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/12443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=12443"}],"version-history":[{"count":5,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/12443\/revisions"}],"predecessor-version":[{"id":29633,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/12443\/revisions\/29633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/12448"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=12443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=12443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=12443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}