• Resolved jchristopherb

    (@jchristopherb)


    After updating to the latest version of WooCommerce Smart Coupons, we encountered a fatal error when viewing a WooCommerce order in the admin panel. The error stems from the plugin trying to call methods on a null $cart object.

    Here’s the stack trace:

    Fatal error: Uncaught Error: Call to a member function get_subtotal() on null in /plugins/woocommerce-smart-coupons/includes/class-wc-sc-display-coupons.php:1531

    We reviewed the source and found the issue at around line 1531 in class-wc-sc-display-coupons.php. The relevant code looks like this:

    $cart = is_object( WC() ) && isset( WC()->cart ) ? WC()->cart : null;
    $subtotal = ( wc_prices_include_tax() && $cart->display_prices_including_tax() ) ? $cart->get_subtotal() + $cart->get_subtotal_tax() : $cart->get_subtotal();

    Thank you,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @jchristopherb,

    Thanks for sharing the details.

    From the file path and function reference you provided (class-wc-sc-display-coupons.php), it appears that the error may be coming from the StoreApps Smart Coupons plugin, not the one developed by WebToffee.

    Could you please confirm whether you’re using the WebToffee Smart Coupons for WooCommerce plugin? This will help us ensure you’re in the right support channel and assist you more accurately.

    I have the same critical error in the same plugin. Deactivating WooCommerce Smart Coupons was the only way to have orders continue until there is a fix for this plugin update.

    Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @tiggerific,

    Thanks for your input!

    It seems like both of you are using the Smart Coupons plugin developed by StoreApps, whereas this support forum is for the WebToffee Smart Coupons for WooCommerce plugin.

    Since the issue does not relate to our plugin, we’ll go ahead and mark this thread as resolved. For further assistance, we recommend reaching out to the support team for the StoreApps plugin directly.

    Thanks for your understanding!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Critical Error in Admin Order View After Plugin Update’ is closed to new replies.