Commit 1469941b authored by Varun Sridharan's avatar Varun Sridharan

Merge pull request #6 from bgallagh3r/master

Fix issue where donation_exists() throws an error due to NULL value
parents ceedeef6 382c8613
......@@ -216,7 +216,7 @@ class wc_quick_donation{
*/
public function donation_exsits(){
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){
$_product = $values['data'];
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