Errors and Notices
-
Hello!
I’m getting the following errors in my error logs:
PHP Notice: Undefined index: ywcds_amount in /wp-content/plugins/yith-donations-for-woocommerce/includes/classes/class.yith-woocommerce-donations.php on line 549 PHP Notice: Undefined index: ywcds_product_id in /wp-content/plugins/yith-donations-for-woocommerce/includes/classes/class.yith-woocommerce-donations.php on line 652
I’ve looked into some of these a bit and it appears that
woocommerce_add_cart_item
filter hook may run multiple times during a session, which in turnadd_cart_donation_item
also gets run multiple times – a few of which will run before the customywcds_amount
has been added which may be why these errors appear. I think additional checks may need to be put in place to ensure that the indices exist before processing.Additionally, another topic has brought up the same issue but I feel it may need to be touched on once more. The
get_title()
fatal error:PHP Fatal error: Uncaught Error: Call to a member function get_title() on boolean in /wp-content/plugins/yith-donations-for-woocommerce/includes/classes/class.yith-woocommerce-donations.php:657
Our product is attached as a donation and a regular price of
0.00
has been added. We can consistently replicate this issue by simply not adding a price to the donation field. It may be worth to hook into the add to cart ajax or simply adding custom JS to prevent the user from adding the donation to cart without an entered price.These errors seem common ( at least in my install ) and it would be awesome to see an update to address the above points. Let me know if there’s anything I can do to help or anything that needs further clarification.
- The topic ‘Errors and Notices’ is closed to new replies.