• Resolved Peachyme

    (@peachyme)


    Hello, I’m new to using your plugin and I love the way I can configure pricing rules! It’s working great but we just noticed that customer credits created in WC Smart Coupons no longer work. The coupons show on the Cart page for customers, but when they apply the coupons the amount sets to $0 in the cart calculations. When I deactivate your plugin, WC Smart Coupons works normally again.

    Please let me know if this is a known issue and how to correct it, or if you will be updating the software to be compatible with WC Smart Coupons. Thank you so much.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hello

    Could you try this code ?
    https://pastebin.com/fTZBrhuy

    thanks, Alex

    Thread Starter Peachyme

    (@peachyme)

    Hugs, kisses, and high fives all around! Thank you so much for fixing this!

    The code worked perfectly. Thanks again!

    Plugin Author algol.plus

    (@algolplus)

    you’re very welcome

    if ( class_exists('WC_Smart_Coupons') ) {
        add_filter( 'wdp_calculate_totals_hook_priority', function( $prior ) {
            return $prior - 1;
        }, 10, 1 );
    
        add_action( 'wp_loaded', function() {
            if ( $priority = has_action(
                                'woocommerce_after_calculate_totals',
                                array( WC_Smart_Coupons::get_instance(), 'smart_coupons_after_calculate_totals' )
                            )
            ) {
                if (
                    remove_action(
                        'woocommerce_after_calculate_totals',
                        array( WC_Smart_Coupons::get_instance(), 'smart_coupons_after_calculate_totals' ),
                        $priority
                    )
                ) {
                    add_action( 'woocommerce_after_calculate_totals', array( WC_Smart_Coupons::get_instance(), 'smart_coupons_after_calculate_totals' ), PHP_INT_MAX );
                }
            }
        }, 50, 1 );
    }

    Hello.

    I am having the same issue on one of my sites – the plugin seems to be conflicting with the WC Smart Coupons and is setting the store credit to £0. I have tried adding in the above code to functions.php but it didn’t change anything.

    Thanks

    Hi, @virtualstudiouk,

    Please, send us a ticket in the helpdesk.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conflict with WC Smart Coupons’ is closed to new replies.