Magento 2 Shipping Per Product allows you charging different Flat Shipping Rates for each products on your Magento 2 stores.
Table of Content
- Extension Installation Guide
- Configuration
- Set Shipping Rates for Individual Product
- Shipping Per Product in Frontend
- Shipping Per Product Details in Backend
- For Marketplace Customers:
Find the extension’s Composer name and version in its composer.json file.
- Login to your SSH and run:
- composer require meetanshi/module-shippingperitem
- Enter your authentication keys. Your public key is your username; your private key is your password.
- Wait for Composer to finish updating your project dependencies and make sure there aren’t any errors.
- To verify that the extension is installed properly, run the command:
- php bin/magento module:status Meetanshi_Shippingperitem
- By default, the extension is probably disabled. Enable the extension and clear static view files:
- php bin/magento module:enable Meetanshi_Shippingperitem --clear-static-content
- php bin/magento setup:upgrade
- For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
- For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
- php bin/magento cache:flush
- For Meetanshi Customers:
- Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
- Login to your SSH and run below commands step by step:
- php bin/magento setup:upgrade
- For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
- For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
- php bin/magento cache:flush
- Configuration
For configuring the extension, login to Magento 2, move to Sales à Shipping Methods à Shipping Per Product where you can find various settings to enable the extension.
- Enabled: Set “YES” to enable shipping per product extension.
- Title: Enter title for the shipping method.
- Shipping Rate: Select how you want to calculate the shipping rate.
- Shipping Rate Calculation: Select one of the calculation methods for the shipping rate.
- Sum of Rate: Charges sum of shipping rate per item/order.
- Maximum Value: Charges the maximum calculated rate per item/order.
- Minimum Value: Charges the minimum calculated rate per item/order.
- Method Name: Enter method name for the shipping method
- Default Product Shipping Cost: Select YES to set default shipping rate when unassigned to individual product.
- Default Rate per Item: Enter default shipping rate to charge per product
- Handling Fee: Add handling fee if you want to apply on orders.
- Ship to applicable countries: Select all allowed countries to enable shipping per product for
- Ship to specific countries: Select countries to enable shipping per product for.
- Displayed error message: Set error message to show for unavailability of the shipping method
- Show method only for admin: Set “Yes” to enable shipping per product for admin only.
- Minimum Order Amount: Specify minimum order amount to enable shipping per product.
- Maximum Order Amount: Specify maximum order amount to enable shipping per product.
- Sort Order: Add sort order of the method
- Set Shipping Rates for Individual Product
To set individual shipping rate for each product, go to Catalog à Products and select the product for which you want to set shipping rate. Edit it and you can find Shipping rate option to add rate as per your requirement.
- Shipping Per Product in Frontend
Once you have set individual shipping rates and default rate, you can see shipping rates extension enabled in frontend. After adding products to cart, shipping per product method is calculated and charged as shown in the below table.
Shipping Rate per Product 1 | Shipping Rate per Product 2 | Quantity for product 1 added to cart | Quantity for product 2 added to cart | Shipping Method | Calculation Type | Handling Fee | Total Shipping Rate |
10 | 20 | 2 | 2 | Per Order | Sum of Rate | 5 | 35 |
10 | 20 | 2 | 2 | Per Item | Sum of Rate | 5 | 65 |
10 | 20 | 2 | 2 | Per Order | Maximum Value | 5 | 25 |
10 | 20 | 2 | 2 | Per Item | Maximum Value | 5 | 45 |
10 | 20 | 2 | 2 | Per Order | Minimum Value | 5 | 15 |
10 | 20 | 2 | 2 | Per Item | Minimum Value | 5 | 25 |
- Shipping per Product on Cart Page – per Order – Sum of Rates
When the shipping method is set up Per Order and calculation method is set to Sum of Rate, and if 2 quantities for 2 products with different individual shipping rates is added to the cart, shipping rate is charged as shown below.
- Shipping per Product on Cart Page – per Item – Sum of Rates
When the shipping method is set up Per Item and calculation method is set to Sum of Rate, and if 2 quantities for 2 products with different individual shipping rates is added to the cart, shipping rate is charged as shown below.
- Shipping Per Product on Checkout Page
Shipping Per Product shipping method applied on order at checkout page.
- Shipping Per Product in “My Account” Section
Once the order is placed using shipping per product shipping method, under “My Orders” tab, shipping details is seen with the name of the shipping method.
- Shipping Per Product Details in Backend
Apart from the frontend, the Shipping Per Product method details can also be seen from the backend under Sales à Orders. The below image shows Order View where shipping per product shipping details are visible.