Magento 2 how convert package weight to Kilogram (KG) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Change weight based on custom optionUPS is not working for heavy weight productsWhat kind of weight does default UPS and USPS take in consideration?How to get the value of custom field checkout address in Carrier Model Magento 2Check if free shipping method is active programmatically in Magento 2How to add Magento shipping method extra details?Magento 2 - Dimensional Weight ConfusionHow to add shipping rate according to weight?How Can I Use the module-dhl programmatic to collect rates?Shipping rate calculation in Table rate Shipping method Magento 2

What was Apollo 13's "Little Jolt" after MECO?

Married in secret, can marital status in passport be changed at a later date?

Why I cannot instantiate a class whose constructor is private in a friend class?

What does the black goddess statue do and what is it?

Are these square matrices always diagonalisable?

What happened to Viserion in Season 7?

SQL Server placement of master database files vs resource database files

Will temporary Dex penalties prevent you from getting the benefits of the "Two Weapon Fighting" feat if your Dex score falls below the prerequisite?

Can gravitational waves pass through a black hole?

Test if all elements of a Foldable are the same

Raising a bilingual kid. When should we introduce the majority language?

How to keep bees out of canned beverages?

What is ls Largest Number Formed by only moving two sticks in 508?

RIP Packet Format

Why aren't road bicycle wheels tiny?

How to translate "red flag" into Spanish?

Is there a possibility to generate a list dynamically in Latex?

false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'

What do you call an IPA symbol that lacks a name (e.g. ɲ)?

Was Objective-C really a hindrance to Apple software development?

Preserving file and folder permissions with rsync

Simulate round-robin tournament draw

Was there ever a LEGO store in Miami International Airport?

Is Bran literally the world's memory?



Magento 2 how convert package weight to Kilogram (KG)



Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Change weight based on custom optionUPS is not working for heavy weight productsWhat kind of weight does default UPS and USPS take in consideration?How to get the value of custom field checkout address in Carrier Model Magento 2Check if free shipping method is active programmatically in Magento 2How to add Magento shipping method extra details?Magento 2 - Dimensional Weight ConfusionHow to add shipping rate according to weight?How Can I Use the module-dhl programmatic to collect rates?Shipping rate calculation in Table rate Shipping method Magento 2



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a custom shipping method in Magento 2, i successfully got the package weight by using this code in Model/Carrier.php :



$weight = $request->getPackageWeight();


but the default system measurement is not in KG or grams,is there any way to detect the type of measurement for package weight and convert it to KG?










share|improve this question
















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.





















    0















    I have a custom shipping method in Magento 2, i successfully got the package weight by using this code in Model/Carrier.php :



    $weight = $request->getPackageWeight();


    but the default system measurement is not in KG or grams,is there any way to detect the type of measurement for package weight and convert it to KG?










    share|improve this question
















    bumped to the homepage by Community 2 days ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      0












      0








      0


      1






      I have a custom shipping method in Magento 2, i successfully got the package weight by using this code in Model/Carrier.php :



      $weight = $request->getPackageWeight();


      but the default system measurement is not in KG or grams,is there any way to detect the type of measurement for package weight and convert it to KG?










      share|improve this question
















      I have a custom shipping method in Magento 2, i successfully got the package weight by using this code in Model/Carrier.php :



      $weight = $request->getPackageWeight();


      but the default system measurement is not in KG or grams,is there any way to detect the type of measurement for package weight and convert it to KG?







      magento-2.1 shipping-methods






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 30 '17 at 6:46







      simple guy

















      asked Jan 30 '17 at 6:36









      simple guysimple guy

      1,07921542




      1,07921542





      bumped to the homepage by Community 2 days ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 days ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















          2 Answers
          2






          active

          oldest

          votes


















          0














          The weight unit is whatever is being used for shipping. You can sometimes control it in Stores> Configuration > Sales > Shipping Methods. For example UPS has a choice of Lbs or Kgs;



          For custom shipping method you need to check UPS code,






          share|improve this answer
































            0














            By default the weight is abstract in Magento. It does not have a measuring unit. You can consider it what you want.

            There are some shipping methods like UPS (as Yogesh mentioned ) where you can state the measuring unit, but this does not autodetect anything. You are just telling UPS that you use LBS or KG, but you still have to be careful at what you input in for the products.

            If you have mixed units there is no out of the box way to determine which is which.

            You may need to add an attribute for the products to determine the measuring unit, and then you need to change the method MagentoShippingModelShipping::composePackagesForCarrier to take into account your measuring unit when retrieving the weight from a products. Convert everything to KG or what ever unit you need.






            share|improve this answer

























              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "479"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f156955%2fmagento-2-how-convert-package-weight-to-kilogram-kg%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              The weight unit is whatever is being used for shipping. You can sometimes control it in Stores> Configuration > Sales > Shipping Methods. For example UPS has a choice of Lbs or Kgs;



              For custom shipping method you need to check UPS code,






              share|improve this answer





























                0














                The weight unit is whatever is being used for shipping. You can sometimes control it in Stores> Configuration > Sales > Shipping Methods. For example UPS has a choice of Lbs or Kgs;



                For custom shipping method you need to check UPS code,






                share|improve this answer



























                  0












                  0








                  0







                  The weight unit is whatever is being used for shipping. You can sometimes control it in Stores> Configuration > Sales > Shipping Methods. For example UPS has a choice of Lbs or Kgs;



                  For custom shipping method you need to check UPS code,






                  share|improve this answer















                  The weight unit is whatever is being used for shipping. You can sometimes control it in Stores> Configuration > Sales > Shipping Methods. For example UPS has a choice of Lbs or Kgs;



                  For custom shipping method you need to check UPS code,







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 12 '17 at 10:13









                  Jai

                  3,60183163




                  3,60183163










                  answered Jan 30 '17 at 7:22









                  YogeshYogesh

                  362211




                  362211























                      0














                      By default the weight is abstract in Magento. It does not have a measuring unit. You can consider it what you want.

                      There are some shipping methods like UPS (as Yogesh mentioned ) where you can state the measuring unit, but this does not autodetect anything. You are just telling UPS that you use LBS or KG, but you still have to be careful at what you input in for the products.

                      If you have mixed units there is no out of the box way to determine which is which.

                      You may need to add an attribute for the products to determine the measuring unit, and then you need to change the method MagentoShippingModelShipping::composePackagesForCarrier to take into account your measuring unit when retrieving the weight from a products. Convert everything to KG or what ever unit you need.






                      share|improve this answer





























                        0














                        By default the weight is abstract in Magento. It does not have a measuring unit. You can consider it what you want.

                        There are some shipping methods like UPS (as Yogesh mentioned ) where you can state the measuring unit, but this does not autodetect anything. You are just telling UPS that you use LBS or KG, but you still have to be careful at what you input in for the products.

                        If you have mixed units there is no out of the box way to determine which is which.

                        You may need to add an attribute for the products to determine the measuring unit, and then you need to change the method MagentoShippingModelShipping::composePackagesForCarrier to take into account your measuring unit when retrieving the weight from a products. Convert everything to KG or what ever unit you need.






                        share|improve this answer



























                          0












                          0








                          0







                          By default the weight is abstract in Magento. It does not have a measuring unit. You can consider it what you want.

                          There are some shipping methods like UPS (as Yogesh mentioned ) where you can state the measuring unit, but this does not autodetect anything. You are just telling UPS that you use LBS or KG, but you still have to be careful at what you input in for the products.

                          If you have mixed units there is no out of the box way to determine which is which.

                          You may need to add an attribute for the products to determine the measuring unit, and then you need to change the method MagentoShippingModelShipping::composePackagesForCarrier to take into account your measuring unit when retrieving the weight from a products. Convert everything to KG or what ever unit you need.






                          share|improve this answer















                          By default the weight is abstract in Magento. It does not have a measuring unit. You can consider it what you want.

                          There are some shipping methods like UPS (as Yogesh mentioned ) where you can state the measuring unit, but this does not autodetect anything. You are just telling UPS that you use LBS or KG, but you still have to be careful at what you input in for the products.

                          If you have mixed units there is no out of the box way to determine which is which.

                          You may need to add an attribute for the products to determine the measuring unit, and then you need to change the method MagentoShippingModelShipping::composePackagesForCarrier to take into account your measuring unit when retrieving the weight from a products. Convert everything to KG or what ever unit you need.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Mar 8 '18 at 9:57









                          Teja Bhagavan Kollepara

                          2,99241950




                          2,99241950










                          answered Jan 30 '17 at 7:40









                          MariusMarius

                          168k28324693




                          168k28324693



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Magento Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f156955%2fmagento-2-how-convert-package-weight-to-kilogram-kg%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                              Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                              Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form