• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2966

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Subscriptions
  • Access
  • Log in

Minimum Quantity Based on Shipping Method in WooCommerce

The PHP code in this download folder displays a error notice and prevents checkout when the quantity is below a set minimum based on the shipping method selected on the cart page.

In this example, we set a minimum quantity of 20 when any local pickup point method is selected and a minimum of 10 when the delivery method is checked.

Local Pickup Shipping Method
Local Pickup Shipping Method 2
Flat Rate Shipping Method

When you click the above gallery images, you’ll find the error notice added based on the chosen shipping method changes the minimum quantity from 10 to 20.

Note : You can use this code with multiple shipping methods, multiple minimum quantities and any shipping plugin.

Installation

There’s 2 simple steps :

1. Copy and paste the PHP code to the end of your child themes functions.php file or custom functionality plugin.

2. Swap out the shipping method id’s on lines 32, 35 and 38 and also swap out the minimum quantities on lines 33, 36, 39 and 42.

Find Shipping Method ID’s

You can inspect each shipping method to find the id for each.

Find Shipping Method ID's

Download Folder

WooCommerce

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Code written by Brad Dalton specialist for Genesis & WooCommerce.

Advertise · WPEngine · Genesis · Log in

  • Account
  • Consulting
  • Post Tags
  • Contact
  • Terms
  • Monthly Membership
  • Yearly Subscriptions
  • Log in
 

Loading Comments...