• Hi folks. Our free shipping is set up if the total is over $150. We offer a number of coupons on the site and the Free Shipping is looking at the total BEFORE the coupons are applied. I really need the Free Shipping to look at the price AFTER the coupons are applied. As it currently stands, a customer is getting free shipping if the price before coupons was $160 but after coupons $140. Please advise.

    https://www.ads-software.com/plugins/woocommerce-advanced-free-shipping/

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Thanks for the question ??

    The subtotal is used as this makes the most sense. Using the total is pretty hard, because that is including shipping for example. When you have free shipping above $150, a person has $148 in the cart + $5 shipping, it will be above $150, so you can choose Free shipping, but then the total will be $148 again, and free shipping is not available ??

    Wow, thats probably pretty hard to read/understand, but basically it could cause some weird situations.

    —–
    It may be interesting to have the subtotal minus the cart discount, instead of the total. The best way I can recommend doing this is by adding a new condition through some filters/hooks.
    I’ve got a bunch of extra scripts available, but not something that would work for you unfortunately. If you have/know someone that has the knowledge to create that, I can send you an example script that can be used as a guide…

    For that, please contact me via https://jeroensormani.com/contact

    Please let me know if there is anything else I can help you with.

    Cheers,
    Jeroen Sormani

    I have the same issue

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi lajd,

    Thanks for mentioning it ??

    I’ve made note of it, if there seems to be a bigger interest in this I may make a ready-to-go solution for this.

    If you require this on short tem my previous reply applies ??
    Still would love to hear from you too if the reply above would fit your needs (subtotal – discount).

    Thanks,
    Jeroen

    The solution wint subtotal- discount will be perfect. It is importent to be able go give free shipping from the amount the customer must pay instead of the subtotal. If you also can make it possible to add the fee as well it will be perfect (the best way is to have both solutions ??

    Thanks Helle

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi Helle,

    Thanks for the comment ??

    Please get in touch if you require this in short term, this requires some custom code. So far I have made no plans (till there is more demand) to include this in the plugin.

    Cheers ??
    Jeroen

    I got this working by doing the following…

    in /includes/admin/settings/conditions/class-wafs-match-conditions.php:

    add (where the matching ones are):

    add_filter( 'wafs_match_condition_total', 				    array( $this, 'wafs_match_condition_total' ), 10, 3 );

    also add (again where the functions are):

    /**
    	 * Total.
    	 *
    	 * Match the condition value against the cart Total.
    	 *
    	 * @since 1.0.0
    	 *
    	 * @param 	bool 	$match		Current match value.
    	 * @param 	string 	$operator	Operator selected by the user in the condition row.
    	 * @param 	mixed 	$value		Value given by the user in the condition row.
    	 * @return 	BOOL 				Matching result, TRUE if results match, otherwise FALSE.
    	 */
    	public function wafs_match_condition_total( $match, $operator, $value ) {
    
    		if ( ! isset( WC()->cart ) ) return;
    
    		if ( '==' == $operator ) :
    			$match = ( WC()->cart->cart_contents_total == $value );
    		elseif ( '!=' == $operator ) :
    			$match = ( WC()->cart->cart_contents_total != $value );
    		elseif ( '>=' == $operator ) :
    			$match = ( WC()->cart->cart_contents_total >= $value );
    		elseif ( '<=' == $operator ) :
    			$match = ( WC()->cart->cart_contents_total <= $value );
    		endif;
    		return $match;
    	}

    now in the /includes/admin/settings/conditions/condition-conditions.php file:

    add (above subtotal):

    'total' 					=> __( 'Total', 'woocommerce-advanced-free-shipping' ),

    now in /includes/admin/settings/conditions/condition-values.php

    add (above subtotal):

    case 'total' :
    
    			$values['field'] = 'number';
    
    		break;
    Plugin Author Jeroen Sormani

    (@sormano)

    Hi lee.shalako

    Thanks for posting the code.

    I do want to note that it is not recommended to modify a plugin directly, as those changes will be gone as soon as you update the plugin. Instead changes like this are recommended to put in your (child) themes functions.php

    Cheers,
    Jeroen Sormani

    I have the same issue
    Is any other solutions except editing php code above in child theme?
    thank you

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Currently there is no simple solution available for the WAFS plugin. There is one way you can do so, but that may be a bit hard to setup.

    That is by creating two separate shipping rates (in a basic setup), and checking if a coupon code is applied to the cart with the ‘coupon’ condition. When the coupon is applied, you’d need to setup a higher threshold for the free shipping VS. the threshold which does not have a discount coupon applied.

    For example, with a coupon for $10 off, you’d want to setup a threshold of subtotal – greater or equal to – 110,
    while without a coupon you may want to setup a threshold like – subtotal – greater equal – 100

    I do have a experimental ‘total’ condition extension script available that can be installed, but that one is for the WooCommerce Advanced Shipping plugin (note without the ‘Free’). That way you can setup a condition that does not deduct the discount from the subtotal.. Depending on your exact needs that road may be interesting for you ??
    (If so, I can send over the extension script)

    Hope that helps ??

    Have a great weekend,
    Jeroen Sormani

    Thread Starter alteraweb

    (@alteraweb)

    Hi Jeroen. My client is asking about this again. I do have the Advanced plugin. Where can I get the extension you mentioned. Thanks!

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Can you reach out to me via this form? https://jeroensormani.com/woocommerce-advanced-shipping/support/

    Thank you ??

    Jeroen

    Thread Starter alteraweb

    (@alteraweb)

    Hi Jeroen. Looks like I am using the free version, not the one on Themeforest. I’d be more than happy to purchase it if it included what I am looking for. But it looks like it does not allow the free shipping to be applied AFTER discounts. Please advise. Thanks.

    I need this too.

    Free shipping calculated on sub-total before discount.

    Thanks

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    So to clarify things:
    The WooCommerce Advanced Shipping doesn’t support this feature by default, but I do have an extension script available based on that plugin. This extensions script will add a custom ‘subtotal minus discount’ condition, that will allow you to setup conditions based on that.

    If you’d like that extension script, just reach out to me via this form with your purchase code, and I’ll send over that extension script to you: https://jeroensormani.com/woocommerce-advanced-shipping/support/

    Thanks,
    Jeroen

    We need this too! I’m glad to see it’s a popular request.

    Just some background. We’re a USA company that ships to Canada.

    So we have a $49 free shipping situation.

    However, if a Canadian customer uses a 20% coupon, the free shipping is calculated BEFORE the coupon is applied, so it really cuts into our margins. We need the free shipping calculated AFTER the coupon is applied, since shipping to Canada is expensive.

    Jeroen, thanks for having such great support, I’ll contact you for that extension ??

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Need free shipping applied to TOTAL cart…not subtotal.’ is closed to new replies.