Commit 5450a848 authored by Varun Sridharan's avatar Varun Sridharan

Fixed issue

Fatal error: Call to a member function get_cart() on null in /home/#######/public_html/wp-content/plugins/woocommerce-quick-donation/woocommerce-quick-donation.php on line 96
parent 47e11936
...@@ -94,6 +94,7 @@ class WooCommerce_Quick_Donation { ...@@ -94,6 +94,7 @@ class WooCommerce_Quick_Donation {
public function check_donation_exists_cart(){ public function check_donation_exists_cart(){
global $woocommerce; global $woocommerce;
$found = false; $found = false;
if(empty($woocommerce)) {return;}
if( sizeof($woocommerce->cart->get_cart()) > 0){ if( sizeof($woocommerce->cart->get_cart()) > 0){
foreach($woocommerce->cart->get_cart() as $cart_item_key=>$values){ foreach($woocommerce->cart->get_cart() as $cart_item_key=>$values){
$_product = $values['data']; $_product = $values['data'];
...@@ -333,4 +334,4 @@ if(WC_QD_Dependencies()){ ...@@ -333,4 +334,4 @@ if(WC_QD_Dependencies()){
array('times' => 1)); array('times' => 1));
} }
?> ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment