Magento 2 Shipping Per Category

Magento 2 Shipping per Category by Meetanshi allows charging shipping rates based on the product categories for effective shipping management.

 

Table of Content

  1. Extension Installation Guide
  2. Configuration
  3. Adding Shipping Rates for Category
  4. Shipping Per Category in Frontend
  5. Shipping Per Category in Backend

 

  1. Extension Installation
  • For Magento Marketplace Customers
  • Create a folder structure in Magento root as app/code/Meetanshi/ShippingPerCategory
  • Download and extract the zip folder and upload our extension files to the app/code/Meetanshi/ShippingPerCategory 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

 

  • 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

 

  1. Configuration
    For configuring the extension, login to Magento 2, move to Sales à Shipping Methods à Shipping Per Category where you can find various settings to enable the extension.
  • Enabled: Set “YES” to enable Shipping Per Category extension.
  • Title: Enter title for the shipping method.
  • Shipping Rate: Select how you want to calculate the shipping rate.
    • Per Item: Rate will be calculated item wise.
    • Per Order: Rate will be calculated order wise.
  • 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 the method name for the shipping method.
  • Default Category Shipping Cost: Select YES to charge the default shipping rate.
  • Default Rate per Category: Enter the default shipping rate to charge per category.
  • Handling Fee: Add handling fee if you want to apply on orders.
  • Ship to applicable countries: Select all allowed countries to enable Shipping Per Category for.
  • Ship to specific countries: Select countries to enable Shipping Per Category for.
  • Displayed error message: Set error message to show for the unavailability of the shipping method.
  • Show method only for admin: Set “Yes” to enable Shipping Per Category for admin only.
  • Minimum Order Amount: Specify the minimum order amount to enable Shipping Per Category.
  • Maximum Order Amount: Specify the maximum order amount to enable Shipping Per Category.
  • Sort Order: Add sort order of the shipping method.

  1. Adding Shipping Rates for Category
    To set the individual shipping rate for each category, go to Catalog à Categories and select the category for which you want to set the shipping rate. Edit it and you can find the Shipping rate option to add rate as per your requirement.

 

  1. Shipping Per Category in Frontend
    Once you have set shipping rates per category and default shipping rate, you can see shipping rates per category extension enabled in frontend. After adding products to cart from the categories, the Shipping Per Category method is seen on the cart page. Once it’s selected, it gets applied to order.
  • Shipping Per Category on Cart Page – Per Order
    When the shipping method is set up Per Order and calculation method is set to Sum of Rate, and if 2 items from the same category is added to the cart, shipping rate is charged as shown in the table.

Shipping Rate per Category 1

Shipping Rate per Category 2

Products added to cart (1 Quantity)

Shipping Method

Calculation Type

Handling Fee

Total Shipping Rate

10

20

From Category 1

Per Order

Sum of Rate

5

15

10

20

From Category 2

Per Order

Sum of Rate

5

25

10

20

Category 1 and 2

Per Order

Sum of Rate

5

35

10

20

Category 1 and 2

Per Item

Sum of Rate

5

35

10

20

Category 1 and 2

Per Order

Maximum Value

5

25

10

20

Category 1 and 2

Per Item

Maximum Value

5

25

10

20

Category 1 and 2

Per Order

Minimum Value

5

15

10

20

Category 1 and 2

Per Item

Minimum Value

5

15

 

 

  • Shipping Per Category on Cart Page – Per Item
    When the shipping method is set up Per Item and calculation method is set to Sum of Rate, and if 2 items from the same category is added to the cart, shipping rate is charged as shown in the image.

 

  • Shipping Per Category on Checkout Page
    Shipping Per Category shipping method applied on order at the checkout page.

 

  • Shipping Per Category in “My Account” page
    Once the order is placed using Shipping Per Category shipping method, under the “My Orders” tab, shipping details are seen with the name of the shipping method.

 

  1. Shipping Per Category in Backend
    Apart from the frontend, the Shipping Per Category method details can also be seen from the backend under Sales à Orders. The below image shows the order view where Shipping Per Category shipping details are visible.