• Resolved iamkashifnadeem

    (@kashifkiduniya)


    I am using this woocommerce filter in my function file

    add_filter ('add_to_cart_redirect', 'redirect_to_checkout');
    
    function redirect_to_checkout() {
        global $woocommerce;
        $checkout_url = $woocommerce->cart->get_checkout_url();
        return $checkout_url;
    }

    How can i get on/off system to this filter with redux framework. I already created Option in redux. But i am not sure how can i use redux option in function file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Kev Provance

    (@kprovance)

    You would have to recall the option inside the function using the global variable of whatever you set as your $opt_name. Do and if/else on that and execute code as necessary.

    Thread Starter iamkashifnadeem

    (@kashifkiduniya)

    I asked the same question 14 ago on the Github.
    And you answer this This is our issue tracker for bugs and other related things. What you want is premium support.
    Then i tried so many tricks and at the end i got solution. And i would love to share with you

     add_filter ('add_to_cart_redirect', 'redirect_to_checkout');
            function redirect_to_checkout() {
             global $xpanel;   if ( isset( $xpanel['woo-option'] ) && $xpanel['woo-option'] == TRUE ) {
            global $woocommerce;
            $checkout_url = $woocommerce->cart->get_checkout_url();
            return $checkout_url;
    
            }
        } 

    This is Worpdress.Stackexchange link
    On stackoverflow a developer having the same issue. I also help him and share my solution.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to on/off woocommerce filter with redux framework’ is closed to new replies.