• Resolved Jessie

    (@jcelestial047)


    Fatal error: Call to a member function get_cart() on a non-object in /home/website/public_html/wp-content/plugins/woocommerce-quick-donation/woocommerce-quick-donation.php on line 219

    Showing error in the backend, don’t know the cause of the issue, even though I disabled the WP_Debug option, the Error still showing can you help me on this thanks.

    https://www.ads-software.com/plugins/woocommerce-quick-donation/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Based on my experience, the error shown caused by WooCommerce Cart Class is not loaded on WP Admin pages.

    Below is modified method:

    /**
    	 * Check's For Donation Product Exist In Cart
    	 * @returns Boolean True|False
    	 */
    	public function donation_exsits(){
    		global $woocommerce;
    		$r=false;
    		if(is_object($woocommerce->cart)){
    			if(sizeof($woocommerce->cart->get_cart()) > 0){
    				foreach($woocommerce->cart->get_cart() as $cart_item_key => $values){
    					$_product = $values['data'];
    					if($_product->id == $this->donation_id){
    						$r= true;
    					}
    				}
    			}
    		}
    		else{
    			//# On WP Administration page (WC Cart Class is not loaded)
    			// stay return FALSE
    		}
    		return $r;
    	}

    Plugin Author Varun Sridharan

    (@varunms)

    Hi,

    I am just working on new version this plugin. so kindly download the latest version and test it. if you have any issue kindly report it in github.

    Download Link : https://github.com/technofreaky/woocomerce-quick-donation/tree/WCQD-V2.0—3.0

    if you need to get updated news (Newsletter) about plugin’s i release or update

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error in Backend’ is closed to new replies.