All Collections
Integration
Shipping Module
WooCommerce - Delivery method based on the items in the shopping cart
WooCommerce - Delivery method based on the items in the shopping cart

Set up your WooCommerce to show delivery methods at checkout based on the items in the shopping cart.

Nicklas Nguyen avatar
Written by Nicklas Nguyen
Updated over a week ago

If you need to exclude/deactivate a certain delivery method or in other way manage which delivery methods are being shown in the checkout, based on which product the customer buys, then this can be done with WooCommerce plugin WooCommerce Conditional Shipping Pro (developed by WP trio), which is compatible with Shipmondo's freight module for WooCommerce

Please take a look at the example below, showing one way of setting up the module. 

Note! The setup is tested with WooCommerce Conditional Shipping Pro v2.2.5. 

Example

Let's say that we want to deactivate/exclude the delivery method GLS Parcel Shop at the check out, if the customer places an order for a "Gray Couch".

1. Create a shipment class under WooCommerce > Settings > Shipping > Shipping classes.

In this example we have named our shipment class "Exclude GLS ParcelShop". 

2. Open the item card for the "Gray Couch".

Chose the shipment class "Exclude GLS ParcelShop" under Shipping and save/update the setup.

3. Now you are ready to set up the rules that should exclude/deactivate the delivery method GLS Parcel Shop at the check out, when the shopping cart contains products with a shipment class "Exclude GLS ParcelShop". 

Go to WooCommerce > Settings > Shipping > Conditions and click on Add ruleset. 

Give the ruleset a name (Ruleset name). 

Set the Conditions by setting Shipping Classes to includes and filling out "Exclude GLS ParcelShop"

Set Disable shipping methods under Actions and add "GLS PakkeShop (Denmark)" to the input field (delivery code for the delivery method GLS Parcel Shop.)

Click on Save changes.

Pro tip: The input field can contain multiple delivery methods. E.g. if you offer delivery with different carriers and wish to exclude/deactivate delivery through a service point, it is possible to include all of the service point delivery methods in the same ruleset. 

The above mentioned setup will give the following result:

  • If the shopping cart contains the item "Gray Couch", delivery method GLS ParcelShop will not be visible during checkout. 

  • If the shopping cart contains the item "Gray Couch" and another random product, delivery method GLS ParcelShop will not be visible during checkout.

  • If the shopping cart contains any item but the "Gray Couch", delivery method GLS ParcelShop will be visible during checkout.

Note! Test thoroughly the entire checkout process to make sure that the desired setup has been achieved and that there are no other plugins that might conflict with the solution.

Did this answer your question?