Warning adding products to
-
I am getting the following error when adding a product to the cart that has been set up with a coupon:
Warning: count(): Parameter must be an array or an object that implements Countable in /wp-content/plugins/wt-smart-coupons-for-woocommerce/admin/exclude-product/class-wt-exclude-product-for-coupon.php on line 108
Here is line 108 of the source code:
if( ! count( $this->get_disabled_product() ) > 0 ) return $valid;It looks like the $this->get_disabled_product() is not an array by default and so the count() function does not work.
If I change the code to:
if( is_null( $this->get_disabled_product() ) ) return $valid;then I do not get the error. However, I haven’t taken the time to go through all of the code to see what this might cause to break elsewhere.
The coupon is set up so that if you add 4 or more to the cart the code is automatically added to take 10% off the purchase. to get the warning please add 4 of the item in the link to the shopping cart. The warnings will show after the item is added to the cart as well as on the cart page itself.
The page I need help with: [log in to see the link]
- The topic ‘Warning adding products to’ is closed to new replies.