Commit 382c8613 authored by Brian Gallagher's avatar Brian Gallagher

Fix issue where donation_exists() throws an error due to NULL value when...

Fix issue where donation_exists() throws an error due to NULL value when viewing donations in admin area.
parent ceedeef6
...@@ -216,7 +216,7 @@ class wc_quick_donation{ ...@@ -216,7 +216,7 @@ class wc_quick_donation{
*/ */
public function donation_exsits(){ public function donation_exsits(){
global $woocommerce; global $woocommerce;
if( sizeof($woocommerce->cart->get_cart()) > 0){ if(is_object($woocommerce->cart) && 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'];
if($_product->id == $this->donation_id){ if($_product->id == $this->donation_id){
......
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