• Resolved andxres

    (@andxres)


    Hello,

    I’m getting these warnings on the Donations product when I’m adding a donation to the cart:

    Warning: A non-numeric value encountered in /wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php on line 234

    Warning: A non-numeric value encountered in /wp-content/plugins/woocommerce/includes/class-wc-discounts.php on line 85

    On the Cart page I’m getting this instead of the name of the product/donation:

    Fatal error: Uncaught Error: Call to a member function get_title() on boolean in /wp-content/plugins/yith-donations-for-woocommerce/includes/functions.yith-wc-donations.php:90 Stack trace: #0 /wp-content/plugins/yith-donations-for-woocommerce/includes/classes/class.yith-woocommerce-donations.php(646): ywcds_get_product_donation_title(false) #1 /wp-includes/class-wp-hook.php(286): YITH_WC_Donations->print_cart_item_donation(‘Donate to Inter…’, Array, ‘fccc64972a9468a…’) #2 /wp-includes/plugin.php(203): WP_Hook->apply_filters(‘Donate to Inter…’, Array) #3 /wp-content/plugins/woocommerce/templates/cart/cart.php(79): apply_filters(‘woocommerce_car…’, ‘Donate to Inter…’, Array, ‘fccc64972a9468a…’) #4 /wp-content/plugins/woocommerce/includes/wc-core-functions.php(210): include(‘/wp-content/plugins/woo…’) in /wp-content/plugins/yith-donations-for-woocommerce/includes/functions.yith-wc-donations.php on line 90

    I have WooCommerce 3.4.1 and YITH Donations for WooCommerce 1.0.17.

    Could you please help?

    Thanks!

    • This topic was modified 6 years, 5 months ago by andxres.
    • This topic was modified 6 years, 5 months ago by andxres.
    • This topic was modified 6 years, 5 months ago by andxres.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter andxres

    (@andxres)

    Is there something I can do to prevent this error on the Cart page?

    Fatal error: Uncaught Error: Call to a member function get_title() on boolean in /wp-content/plugins/yith-donations-for-woocommerce/includes/functions.yith-wc-donations.php:90 Stack trace: #0 /wp-content/plugins/yith-donations-for-woocommerce/includes/classes/class.yith-woocommerce-donations.php(646): ywcds_get_product_donation_title(false) #1 /wp-includes/class-wp-hook.php(286): YITH_WC_Donations->print_cart_item_donation(‘Donate to Inter…’, Array, ‘b5c37cd7bafbc4d…’) #2 /wp-includes/plugin.php(203): WP_Hook->apply_filters(‘Donate to Inter…’, Array) #3 /wp-content/plugins/woocommerce/templates/cart/cart.php(79): apply_filters(‘woocommerce_car…’, ‘Donate to Inter…’, Array, ‘b5c37cd7bafbc4d…’) #4 /wp-content/plugins/woocommerce/includes/wc-core-functions.php(210): include(‘/wp-content/plugi…’) in /wp-content/plugins/yith-donations-for-woocommerce/includes/functions.yith-wc-donations.php on line 90

    Please help. Thanks!

    • This reply was modified 6 years, 5 months ago by andxres.
    Plugin Author YITHEMES

    (@yithemes)

    Probalbly you’ve deleted the product donation.
    To avoid the fatal error change at file

    yith-donations-for-woocommerce/includes/classes/class.yith-woocommerce-donations.php

    line 643

    if ( $product_ass_id != - 1 ) {
    	$product = wc_get_product( $product_ass_id );
    	return ywcds_get_product_donation_title( $product );
     } 

    with this:

    if ( $product_ass_id != - 1 ) {
    	$product = wc_get_product( $product_ass_id );
    	if ( $product ) {
             return ywcds_get_product_donation_title( $product );
    	}
    }

    this check will be send in the next version of plugin.

    Thread Starter andxres

    (@andxres)

    Thanks a lot for the reply!!

    This removed the fatal error from the cart but it’s adding two products in the cart – one with $0 (zero) on the Price column and one with the correct value. Can this prevented? Thanks!!

    Note: I didn’t remove the donation product, but I changed its name and I deactivated/removed the plugin once and installed it again.. maybe this caused the issue.

    Plugin Author YITHEMES

    (@yithemes)

    This is the normal behavior. You pay for the product and the donation you entered. That’s why you see 2 products in the cart.

    Thread Starter andxres

    (@andxres)

    I understand your point, but from the user point of view it would be clearer to have a simplified and not confusing view, with just the donation (the end user doesn’t know the logic of WooCommerce and it may puzzle them a bit..) It would be great if a simplified view of the cart could be implemented.. but maybe that’s too complicated..

    Thanks a lot for your help!

    Plugin Author YITHEMES

    (@yithemes)

    Thank you very much, we really appreciate this kind of feedback in order to improve our plugins.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WooCommerce warnings’ is closed to new replies.