Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Not working correctly since Woo v4 #15339
    Phil Whitwell
    Participant

    Thanks for the workaround.
    The only thing now is it does not show the notification that the coupon is being applied but only minor and can live with that.

    in reply to: Not working correctly since Woo v4 #15327
    Phil Whitwell
    Participant

    I found this code which is setting the total to £0

    // Must be AFTER hook of Auto Coupon (5) but BEFORE WC_Cart_Session::set_session (10)
    WJECF()->safe_add_action( ‘woocommerce_after_calculate_totals’, array( $this, ‘update_free_products_in_cart’ ), 8 );

    //Set price to 0.00 for free products
    add_filter( ‘woocommerce_add_cart_item’, array( $this, ‘filter_woocommerce_add_cart_item’ ), PHP_INT_MAX, 6 ); // mark the free products as such
    add_filter( ‘woocommerce_get_cart_item_from_session’, array( $this, ‘filter_woocommerce_get_cart_item_from_session’ ), PHP_INT_MAX, 3 ); // mark the free products as such

    // overwrite values (price 0.00) if it’s a free product
    add_filter( ‘woocommerce_product_get_price’, array( $this, ‘filter_woocommerce_product_get_price’ ), PHP_INT_MAX, 2 );
    add_filter( ‘woocommerce_product_variation_get_price’, array( $this, ‘filter_woocommerce_product_get_price’ ), PHP_INT_MAX, 2 );

    // overwrite subtotal of 0.00
    add_filter( ‘woocommerce_coupon_discount_amount_html’, array( $this, ‘filter_woocommerce_coupon_discount_amount_html’ ), 8, 2 );

    //A free product coupon always has a value (for Auto coupon)
    add_filter( ‘wjecf_coupon_has_a_value’, array( $this, ‘filter_wjecf_coupon_has_a_value’ ), 10, 2 ); // if coupon grants free products, it has a value! Required for Auto Coupons
    add_filter( ‘woocommerce_coupon_is_valid_for_product’, array( $this, ‘filter_woocommerce_coupon_is_valid_for_product’ ), 10, 4 ); //don’t count the free items for coupon restrictions

    add_action( ‘woocommerce_cart_emptied’, array( $this, ‘woocommerce_cart_emptied’ ) );

    in reply to: Not working correctly since Woo v4 #15326
    Phil Whitwell
    Participant

    I can understand if it was a random plugin but Woo Subscriptions is a core plugin.
    The issue is not related to the coupon being removed it is that it sets the Total to £0, so subscribers get it for free!
    This is a bug not something that can be worked around.

    in reply to: Not working correctly since Woo v4 #15323
    Phil Whitwell
    Participant

    That’s giving up a bit easily.
    It is only since v4, unless you fix it, you cannot say that it is compatible with v4 of WooCommerce.
    It was the WooCommerce support team that pointed me in your direction.

    We rely on your plugin and subscriptions so would like a fix

    in reply to: Not working correctly since Woo v4 #15321
    Phil Whitwell
    Participant

    Not sure if you have checked credentials yet but should be added now.

    in reply to: Not working correctly since Woo v4 #15320
    Phil Whitwell
    Participant

    Ok,
    i have sent you credentials to have a look.
    To recreate the problem
    https://stagingbatch2.wpengine.com/become-a-member/
    Click sign up for either 6 month or 12 month products

    Note checkout total does not include signup fee.
    I had a quick look at the debug
    It is something to do with call to woocommerce_after_calculate_totals
    I guess it appears as a free product but it is not free just with sign up cost only

Viewing 6 posts - 1 through 6 (of 6 total)