Title: Uncaught Error when update order
Last modified: August 25, 2025

---

# Uncaught Error when update order

 *  Resolved [kartiksadadiya](https://wordpress.org/support/users/kartiksadadiya/)
 * (@kartiksadadiya)
 * [9 months, 2 weeks ago](https://wordpress.org/support/topic/uncaught-error-when-update-order/)
 * I am getting this error when try to update the order from admin
 *     ```wp-block-code
       Uncaught Error: Call to a member function get_price() on nullin /public_html/wp-content/plugins/wt-smart-coupons-for-woocommerce/public/modules/bogo/bogo.php on line 1689Call stack:Wbte_Smart_Coupon_Bogo_Public::exclude_giveaway_from_other_discounts()wp-includes/class-wp-hook.php:324WP_Hook::apply_filters()wp-includes/plugin.php:205apply_filters()wp-content/plugins/woocommerce/includes/class-wc-coupon.php:931WC_Coupon::is_valid_for_product()wp-content/plugins/woocommerce/includes/class-wc-discounts.php:332WC_Discounts::get_items_to_apply_coupon()wp-content/plugins/woocommerce/includes/class-wc-discounts.php:265WC_Discounts::apply_coupon()wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php:1439WC_Abstract_Order::recalculate_coupons()wp-content/plugins/woocommerce/includes/admin/wc-admin-functions.php:460wc_save_order_items()wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-items.php:53WC_Meta_Box_Order_Items::save()wp-includes/class-wp-hook.php:326WP_Hook::apply_filters()wp-includes/class-wp-hook.php:348WP_Hook::do_action()wp-includes/plugin.php:517do_action()wp-content/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php:262WC_Admin_Meta_Boxes::save_meta_boxes()wp-includes/class-wp-hook.php:326WP_Hook::apply_filters()wp-includes/class-wp-hook.php:348WP_Hook::do_action()wp-includes/plugin.php:517do_action()wp-includes/post.php:5110wp_insert_post()wp-includes/post.php:5212wp_update_post()wp-admin/includes/post.php:453edit_post()wp-admin/post.php:227
       ```
   
 * The scenario is when user tried do the payment and it failed due to payment gateway
   issue in that case order fall in to the failed order, Now I want to manually 
   change the status of the order from fail to processing but when I try to do so
   I get this error.
 * Temporary I have add this solution but not sure if it will perfect and not affect
   other areas
 *     ```wp-block-code
       public static function exclude_giveaway_from_other_discounts( $valid, $product, $coupon, $values ) {        /*        // disabled this code        if ( self::is_a_free_item( $values ) && 0 >= $values['data']->get_price() ) {               return false;        }        */        // Added this code	if ( self::is_a_free_item( $values ) 		&& isset( $values['data'] ) 		&& is_object( $values['data'] ) 		&& method_exists( $values['data'], 'get_price' ) 		&& 0 >= $values['data']->get_price() ) {					return false;	}	if ( self::is_bogo( $coupon->get_id() ) ) {		return true;	}	return $valid;}
       ```
   
    -  This topic was modified 9 months, 2 weeks ago by [kartiksadadiya](https://wordpress.org/support/users/kartiksadadiya/).
    -  This topic was modified 9 months, 2 weeks ago by [kartiksadadiya](https://wordpress.org/support/users/kartiksadadiya/).

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

 *  Plugin Support [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * (@webtoffeesupport)
 * [9 months, 2 weeks ago](https://wordpress.org/support/topic/uncaught-error-when-update-order/#post-18612188)
 * Hi [@kartiksadadiya](https://wordpress.org/support/users/kartiksadadiya/),
 * Thank you for sharing the error details and the temporary solution you’ve applied.
   To help us investigate further and ensure no other areas are affected, could 
   you please share the following:
    1. A **screenshot of the order edit page** where the issue occurs.
    2. A copy of your site’s **System Status Report** (_WooCommerce > Status > Get 
       system report_).
 * You can securely upload these details [via this link.](https://www.webtoffee.com/contact/)
 *  Thread Starter [kartiksadadiya](https://wordpress.org/support/users/kartiksadadiya/)
 * (@kartiksadadiya)
 * [9 months, 2 weeks ago](https://wordpress.org/support/topic/uncaught-error-when-update-order/#post-18612412)
 * Here is the screenshot of the error – [https://prnt.sc/TdVfgo0Ity3b](https://prnt.sc/TdVfgo0Ity3b)
   Also I am not able to submit the request first I got this error – [https://prnt.sc/YDh86PobXu5I](https://prnt.sc/YDh86PobXu5I)
   then got this error on your website – [https://prnt.sc/U16KF5ojieKd](https://prnt.sc/U16KF5ojieKd)
   when copy and pasted the system report.
 *  Plugin Support [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * (@webtoffeesupport)
 * [9 months, 2 weeks ago](https://wordpress.org/support/topic/uncaught-error-when-update-order/#post-18613491)
 * Hi [@kartiksadadiya](https://wordpress.org/support/users/kartiksadadiya/),
 * Thank you for sharing the screenshot of the error and also for letting us know
   about the issue you faced while submitting the system report. I’ll check this
   further with our team and get back to you shortly with an update.
 *  Plugin Support [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * (@webtoffeesupport)
 * [9 months, 1 week ago](https://wordpress.org/support/topic/uncaught-error-when-update-order/#post-18619186)
 * Hi [@kartiksadadiya](https://wordpress.org/support/users/kartiksadadiya/),
 * Thanks for waiting. We wanted to let you know that the issue you experienced 
   has been addressed in the **latest release of the plugin**.
 * Could you please update to the newest version and check if the error no longer
   occurs when updating orders? If you still notice any problems after updating,
   feel free to share the details here and we’ll be glad to take another look.

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

The topic ‘Uncaught Error when update order’ is closed to new replies.

 * ![](https://ps.w.org/wt-smart-coupons-for-woocommerce/assets/icon-128x128.gif?
   rev=3248429)
 * [Smart Coupons For WooCommerce Coupons](https://wordpress.org/plugins/wt-smart-coupons-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wt-smart-coupons-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wt-smart-coupons-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/wt-smart-coupons-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wt-smart-coupons-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wt-smart-coupons-for-woocommerce/reviews/)

## Tags

 * [uncaught error](https://wordpress.org/support/topic-tag/uncaught-error/)

 * 4 replies
 * 2 participants
 * Last reply from: [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * Last activity: [9 months, 1 week ago](https://wordpress.org/support/topic/uncaught-error-when-update-order/#post-18619186)
 * Status: resolved