This refers to our “WooCommerce Minimum and Maximum Orders” plugin, found here, and not any other similarly-named plugin. This can be done using a code fragment. You should ask your PHP developer to adapt this code fragment to your particular situation. The example below will change the minimum purchase amount to £145 (assuming your store uses British pounds sterling) if the customer is not VAT exempt, and if the chosen shipping method has a WooCommerce identifier of legacy_local_pickup :
<?php
add_filter('woocommerce_minima_maxima_settings', function($settings, $for_frontend) {
// Only alter the settings when making front-end decisions
if (!$for_frontend) return $settings;
/**
* e.g.
*
* Array
* (
* [allowallexcluded] => 1
* [count_all_if_any_included] => 1
* [minamount] => Array
* (
* [default] => 15
* [flat_rate__I-2] => 40
* [flat_rate__I-3] => 30
* [flat_rate__I-6] => 15
* [free_shipping] => 15
* [local_pickup__I-5] => 20
* [legacy_international_delivery] => 100
* [legacy_local_pickup] => 15
* )
* ...
*/
$wc = WC();
$customer = $wc->customer;
if (!is_object($customer)) return $settings;
if (!$customer->is_vat_exempt()) {
foreach (array_keys($settings['minamount']) as $key) {
// On the following line, change the expression to match the shipping methods you are targetting. This uses the slugs, not the visible names in the user interface.
if (!preg_match('/^legacy_local_pickup$/', $key)) continue;
$settings['minamount'][$key] = 145;
}
}
return $settings;
}, 10, 2);
Posted in: WooCommerce European (EU/UK/Norway/Switzerland) VAT Compliance