• Resolved fotske

    (@fotske)


    Hi,

    I have made those settings in WooCommerce for the shipping to France:
    – In: WooCommerce > Settings > Shipping > Select a Shipping Zone (France)
    – Free Shipping is activated and requires a minimum order amount OR a coupon
    – The minumum order amount is set to 79€ (if this minimum amount is not reached, the shipping to France costs 10,50€)
    – Checkbox “Apply minimum order rule before coupon discount” is checked

    Now, when I make a test order with a product which costs 79,90€.
    I put it in the basket, choose France as shipping country and OK the shipping is free.
    BUT if then I add a 10% coupon code, the product price is 79,90 – 7,99 = 71,91€ and the shipping to France should still be free because I checked “Apply minimum order rule before coupon discount” but it’s not the case and WooCommerce adds 10,50€ for the delivery!
    There is a problem with the functioning of this checkbox in WooCommerce.
    Could you please solve this problem asap?

    Thank you very much in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Rodrigo Primo

    (@rodrigosprimo)

    Hi @fotske,

    I’m afraid I’m unable to reproduce the problem that you are having when following the steps you provided using the latest version of WooCommerce (4.7.1) and no other plugin installed to avoid potential conflicts.

    Below are the screenshots showing the settings that I used and showing that the option “Apply minimum order rule before coupon discount” seems to be working as expected in my installation. Free shipping is still available even after the coupon is applied. Please let me know if I missed something.

    The coupon that I’m using in the test:

    Screenshot from 2020 11 27 11 18 00

    My shipping settings:

    Screenshot from 2020 11 27 11 18 27
    Screenshot from 2020 11 27 11 18 42
    Screenshot from 2020 11 27 11 18 57

    My cart with a product that costs 79,90€, address set to France and showing the free shipping option:

    Screenshot from 2020 11 27 11 25 02

    The same cart but with the coupon applied still showing the free shipping option:

    Screenshot from 2020 11 27 11 25 23

    Thread Starter fotske

    (@fotske)

    Hi @rodrigosprimo,

    I have exactly all the same settings as you but it doesn’t work for me.
    The only difference that I have is that the “Flat rate” disappears when the amount for the free shipping is reached (which seems logical to me).
    But when the 10% coupon is added, the free shipping option disappears and the flat rate appears again.
    It is very annoying and I don’t see which plugin could interfere with that?!?

    Could you please help?

    Thank you very much in advance.

    Plugin Contributor Rodrigo Primo

    (@rodrigosprimo)

    One thing that you could do is a conflict test to rule out the possibility that another plugin is interacting with WooCommerce in some unexpected way and is causing this problem.

    Thread Starter fotske

    (@fotske)

    Dear @rodrigosprimo

    Can my problem maybe be due to the fact that I have the following code added to the functions.php file of my Child Theme?
    add_filter( ‘woocommerce_adjust_non_base_location_prices’, ‘__return_false’ ) ;

    Code found here: https://github.com/woocommerce/woocommerce/wiki/How-Taxes-Work-in-WooCommerce
    See ? Prices including tax – Experimental Behavior ?.

    Thank you again for your help.

    Plugin Contributor Rodrigo Primo

    (@rodrigosprimo)

    I’m afraid I won’t have time to test it to confirm if the code is related or not. But I suggest you try removing the code to see if it fixes the issue for you. I don’t remember off the top of my head what this filter does.

    Thread Starter fotske

    (@fotske)

    Hi @rodrigosprimo

    The code that I gave you has nothing to do with that, sorry, it is a code concerning the tax behavior.

    I made a full conflict test (I deactivated all the plugins except for WooCommerce and I switched to the TwentyTwenty theme) and the problem persists!

    I really need your help to solve this problem.

    I suspected another code which is in the fucntions.php of My Child Theme to be responsible of the problem.
    I use this code to hide the shipping rates from the checkout when free shipping is available. It’s an official code from WooCommerce found here: https://docs.woocommerce.com/document/hide-other-shipping-methods-when-free-shipping-is-available/

    The code is:

    /**
     * Hide shipping rates when free shipping is available.
     * Updated to support WooCommerce 2.6 Shipping Zones.
     *
     * @param array $rates Array of rates found for the package.
     * @return array
     */
    function my_hide_shipping_when_free_is_available( $rates ) {
    	$free = array();
    	foreach ( $rates as $rate_id => $rate ) {
    		if ( 'free_shipping' === $rate->method_id ) {
    			$free[ $rate_id ] = $rate;
    			break;
    		}
    	}
    	return ! empty( $free ) ? $free : $rates;
    }
    add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 );

    Can my problem be due to this code?
    I don’t think so because I deleted this code from the functions.php file and made another test and the problem persists…

    Could you please help me solve this problem? I really need your help.

    Thank you very much in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘“Apply minimum order rule before coupon discount” does not work’ is closed to new replies.