• 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 turn add_cart_donation_item also gets run multiple times – a few of which will run before the custom ywcds_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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    Thanks for your reporting!
    Do you have delete the “YITH Donations” product that the plugin has created automatically?

    Thread Starter Howdy_McGee

    (@howdy_mcgee)

    I’m not sure, there doesn’t seem to be a way to tell if the current product is the one created automatically. I’ve “Reset Defaults” on the donations page and re-selected my product that I want the donation to be on. The errors still appear.

    Thread Starter Howdy_McGee

    (@howdy_mcgee)

    It looks like the other issues have been fixed with the current updates. I am still receiving the following index error, also described above:

    PHP Notice: Undefined index: ywcds_amount in /plugins/yith-donations-for-woocommerce/includes/classes/class.yith-woocommerce-donations.php on line 537

    The donation form is being added to a page via the [product] shortcode and the input has a name of amount_single_product which is accounted for in the plugin. I think that method just needs a check against the index.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Errors and Notices’ is closed to new replies.