Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save xlplugins/c2feaf4eb20c3b16b38fa9e1005b21e9 to your computer and use it in GitHub Desktop.

Select an option

Save xlplugins/c2feaf4eb20c3b16b38fa9e1005b21e9 to your computer and use it in GitHub Desktop.
Funnelkit Cart : Free Shipping min amount set based on the currency
add_filter( 'fkcart_free_shipping', function ( $options ) {
// Ensure $options is an array.
if ( false === $options ) {
$options = [];
}
// Get current store/order currency (works with multi-currency plugins that hook into WooCommerce).
$currency = get_woocommerce_currency();
// Set min amount based on currency.
if ( 'USD' === $currency ) {
// Example for USD.
$options['method_id'] = '';
$options['min_amount'] = 30;
} elseif ( 'EUR' === $currency ) {
// Example for Euro.
$options['method_id'] = '';
$options['min_amount'] = 60;
}elseif ( 'GBP' === $currency ) {
// Example for Great Britain Pound.
$options['method_id'] = '';
$options['min_amount'] = 90;
} else {
// Default for all other currencies.
$options['method_id'] = '';
$options['min_amount'] = 100;
}
return $options;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment