# JRO – PackagingWeight Magento 2 extension This extension is written really specifically with my use-case in mind. * It plugs into the Shipper HQ [MatrixRate](https://commercemarketplace.adobe.com/webshopapps-module-matrixrate.html) shipping module. * It chooses packaging based on the number of items in the cart, without distinguishing which items. * There are 3 choices of packaging, and only 3, for 1-5, 6-10 and 11+ items. This extension could be forked, either to alter those limitations to other store-specific requirements, or to generalise. So this extension is unlikely to be useful, as it is, to anyone but me. However it could be a base for many uses. It is therefore available as a public git repository, but is not available from Packagist. ## Download There are 3 ways to download the extension 1. `cd` to wherever you want to place the code (possibly in `app/code`) then download the latest `.tar.gz` release from `https://git.oakleys.org/JamesOakley-MagentoDev/magento-packagingweight/releases` 2. `cd` to wherever you want to place the code (possibly in `app/code`) then `git clone https://git.oakleys.org/JamesOakley-MagentoDev/magento-packagingweight` 3. Add `https://git.oakleys.org/JamesOakley-MagentoDev/magento-packagingweight` to the `repositories` section of your project's `composer.json`, then add `Jro/PackagingWeight` to the require section. ## Installation Enable the extension, and recompile dependency injection: ``` php bin/magento module:enable Jro_PackagingWeight php/bin/magento setup:upgrade php bin/magento setup:di:compile ``` Go to the admin area for your store > Sales > Delivery Methods > WebShopApps Matrirx Rate. There you'll see additional settings to enter the weight and cost of each type of packaging. ## Features * The plugin works out which kind of packaging would be used to fulfil this order. * It then looks up the weight of that packaging, and adds that to the cart weight before the shipping price is calculated. * It then looks up the cost of that packaging, and adds that to the shipping price before it is returned to the cart. ## Licence The extension is licensed under GNU GPLv3. See the COPYING file for details. ## Author James Oakley magentodev@m3.oakleys.org https://git.oakleys.org https://www.oakleys.org.uk ## Homepage The homepage of this extension is https://git.oakleys.org/JamesOakley/magento-packagingweight. Please use the issue queue there for any support requests, although this extension is provided “as-is” so support is on a goodwill and best-effort basis.