0
votes

i built a site with wordpress and woocommerce (www.jescesole.eu). because of the site sells in germany, i had to install an additional plugin, woocommerce germanized (together with polylang, to view contents in german and italian) in the latest days i upgraded both wp and all the plugins but when a customer submits the order, a message of Internal server error appears. i read the server error logs and a long error message was reported:

Thu, 13 Apr 2017 21:53:37 GMT [error] [client 87.13.188.180] - www.jescesole.eu - AH01215: payment_method was called incorrectly. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_AJAX::do_wc_ajax, do_action('wc_ajax_checkout'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->process_order_payment, WC_Gateway_COD->process_payment, WC_Order->update_status, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_pending_to_processing'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_Emails::send_transactional_email, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_GZD_Email_Customer_Paid_For_Order->trigger, WC_Email->get_content, WC_GZD_Email_Customer_Paid_For_Order->get_content_html, wc_get_template_html, wc_get_template, include('/plugins/woocommerce-germanized/templates/emails/customer-paid-for-order.php'), do_action('woocommerce_email_order_details'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_Emails->order_details, wc_get_template, include('/plugins/woocommerce/templates/emails/email-order-details.php'), do_action('woocommerce_email_before_order_table'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, Hyyan\WPI\Gateways\GatewayBACS->email_instructions, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong. This message was added in version 3.0.: /php-wrapper/php-cgi, referer http://www.jescesole.eu/it/checkout/

what can e happened? may be some plugins are not compatible each other or with the theme? thanx in advance

2
Try to go back to the situation from before this error. Then do the updates again, one by one, and every time you update something, WP or a plugin, test the whole site. This way you will find out quick enough which plugin causes the issue or that installed plugins are not compatible with the latest version of Wordpress. It can be a tedious undertaking. But finding out what pluging causes the problem is 90% of solving the issue. After you've found out the cause, you can find a solution.Kevinvhengst
This error is caused by WooCommerce mega major version 3.0.x. update You should better revert back to version 2.6.x as a lot of things have changed. Here the problem is around a payment gateway (plugin) tha is calling $order object properties. now this properties can't be called directly like before. Instead it has to use the new setters and getters methods… So The problem is certainly a payment gateway plugin (not compatible with WC 3.0+) or some custom code around payment gatewaysLoicTheAztec
"Order properties should not be accessed directly. " Order, coupon, product, and order item properties must now be accessed via getter functions. So $order->payment_gateway is now $order->get_payment_gateway().helgatheviking

2 Answers

0
votes

I had the same problem and found the "Hyyan WooCommerce Polylang Integration" plugin causing the error. Disabled it and the internal server error disappeared. Woocommerce Germanized works perfectly with Polylang. No need (any more) for this plug.

-1
votes

WooCommerce 3.0 revamped their code to restrict the direct access of property, you can either change your code like below.

 $OrderID= ( WC()->version < '2.7.0' ) ? $order->id : $order->get_id();
    $shipping_country   = (  WC()->version < '2.7.0' ) ? $order->shipping_country : $order->get_shipping_country();

Or Update your plugins to WC3 compatible.

$order->property : $order->get_property();