Product price error on PHP8.0
-
Hi team,
We got this error while trying to get the product price when the customer clicked “Place Order”. It looks like related to the >=PHP8.0.
I checked with PHP7.4 and it works well.Can you check and fix it on PHP version >=8.0?
Thanks
[07-Jun-2022 01:51:14 UTC] PHP Warning: Undefined array key “active_discounts” in /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woo-advanced-discounts/includes/class-wad-discount.php on line 786
[07-Jun-2022 01:51:14 UTC] PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woo-advanced-discounts/includes/class-wad-discount.php:786
Stack trace:
#0 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woo-advanced-discounts/includes/class-wad-discount.php(786): in_array(322, NULL)
#1 /shared/httpd/my-woocomerce/wordpress/wp-includes/class-wp-hook.php(307): WAD_Discount->get_sale_price(5000, Object(WC_Product_Simple))
#2 /shared/httpd/my-woocomerce/wordpress/wp-includes/plugin.php(191): WP_Hook->apply_filters(‘10000’, Array)
#3 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php(797): apply_filters(‘woocommerce_pro…’, ‘10000’, Object(WC_Product_Simple))
#4 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php(270): WC_Data->get_prop(‘price’, ‘view’)
#5 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woocommerce-wp-plugin-va/libs/class-wc-xendit-helper.php(46): WC_Product->get_price()
#6 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woocommerce-wp-plugin-va/libs/class-wc-xendit-invoice.php(661): WC_Xendit_PG_Helper::generate_items_and_customer(Object(WC_Order), ‘22500’)
#7 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(982): WC_Xendit_Invoice->process_payment(332)
#8 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1206): WC_Checkout->process_order_payment(332, ‘xendit_bniva’)
#9 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(461): WC_Checkout->process_checkout()
#10 /shared/httpd/my-woocomerce/wordpress/wp-includes/class-wp-hook.php(307): WC_AJAX::checkout(”)
#11 /shared/httpd/my-woocomerce/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(”, Array)
#12 /shared/httpd/my-woocomerce/wordpress/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#13 /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(90): do_action(‘wc_ajax_checkou…’)
#14 /shared/httpd/my-woocomerce/wordpress/wp-includes/class-wp-hook.php(307): WC_AJAX::do_wc_ajax(”)
#15 /shared/httpd/my-woocomerce/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(false, Array)
#16 /shared/httpd/my-woocomerce/wordpress/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#17 /shared/httpd/my-woocomerce/wordpress/wp-includes/template-loader.php(13): do_action(‘template_redire…’)
#18 /shared/httpd/my-woocomerce/wordpress/wp-blog-header.php(19): require_once(‘/shared/httpd/m…’)
#19 /shared/httpd/my-woocomerce/wordpress/index.php(17): require(‘/shared/httpd/m…’)
#20 {main}
thrown in /shared/httpd/my-woocomerce/wordpress/wp-content/plugins/woo-advanced-discounts/includes/class-wad-discount.php on line 786
- The topic ‘Product price error on PHP8.0’ is closed to new replies.