• Resolved wimkreatix

    (@wimkreatix)


    Hi

    We’re using this plugin for canceling orders, but at the same time we’re using the Woocommerce Subscriptions plug-in.

    When going to My Account – My subscriptions we get a nice overview of our subscriptions as a user, but when we click on View Subscription, we get an Uncaught Error. This errors leads to wp-content/plugins/wc-cancel-order-pro/wc-cancel-order-pro.php. (Uncaught Error: Call to a member function has_status() on boolean in)

    This is the code that gives the error, specifically this line: ‘if($order->get_status()==’cancel-request’) {‘

    function subscription_status_name($status_name,$status){
    	    global $wp;
    	    if(isset($wp->query_vars['view-subscription']) && $wp->query_vars['view-subscription']){
    		    $subscription_id = $wp->query_vars['view-subscription'];
    		    $subscription = new WC_Subscription($subscription_id);
    		    $order_id = $subscription->get_parent_id();
    		    $order = wc_get_order($order_id);
    		    if($order->get_status()=='cancel-request'){
    			    $status_name =  __('Pending Cancellation','wc-cancel-order');
    		    }
            }
    	    return $status_name;
        }

    Is there any possibility to fix this error or give some additional information about this?

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error with Woocommerce Subscriptions’ is closed to new replies.