• Resolved downsdesign

    (@downsdesign)


    Upon upgrading to Woocomerce Version 4.3.1 we are getting the following error when adding products to the card

    ( ! ) Warning: A non-numeric value encountered in /Users/ericdowns/Local Beta Sites/spcindustrialcom/app/public/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php on line 227

    We do not have prices for our products. Rather a customer adds items to their carts, submits the order with no payment and our customer service reps reach out with a quote.

    Is there a workaround for this or do we need to make all of our products have a price of $0? Ideally, there is something we can drop-in functions.php to address this.

    Thanks for looking!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support John Coy a11n

    (@johndcoy)

    Automattic Happiness Engineer

    Hi @downsdesign

    We do not have prices for our products. Rather a customer adds items to their carts, submits the order with no payment and our customer service reps reach out with a quote.

    Is a plugin managing this? WooCommerce.com has a paid plugin that does this:

    https://woocommerce.com/products/catalog-visibility-options/

    Based on how core manages this, my only thought would be to set a default price.

    Thread Starter downsdesign

    (@downsdesign)

    Hi John,

    A plugin is not managing this, seems like the price is now required with version 4.3.1.

    Sounds like our best option might be to just mark everything as $0.

    Thanks for the assistance!

    Plugin Support mouli a11n

    (@mouli)

    Hi there,
    I tested this out on my staging site and found that I can leave the price field blank for a product without throwing any errors.
    Interestingly, when a product has no price defined, it is not available by default to add to the cart. The Add to Cart button is hidden.
    Reading your question I understand that this error is occurring when you add the product to the cart, which, as discussed above, should not be possible without pricing on the product.
    This leads me to suspect that there is some customization working here.
    Have you added anything to your themes functions.php file that might be working to achieve this.

    I suggest that a conflict test might highlight the source of this behaviour as well.
    You can read more about plugin and theme conflicts in the documentation here: https://docs.woocommerce.com/document/woocommerce-self-service-guide/

    I hope that helps you to figure it out.
    Feel free to get back to us if you have further questions.

    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please feel free to start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘A non-numeric value encountered (class-wc-cart-totals)’ is closed to new replies.