WC error from updated PHP templates

Hello,

I recently updated to PRO 3.2.1. I was excited the the woocommerce templates would be updated, however after I updated I noticed they were still quite a few outdated as I was getting the notice on the dashboard. So I went to investigate and saw this:

  • pro-child/woocommerce/emails/customer-refunded-order.php version 2.5.0 is out of date. The core version is 3.7.0

  • pro-child/woocommerce/emails/customer-reset-password.php version 2.0.0 is out of date. The core version is 3.7.0

  • pro-child/woocommerce/emails/email-addresses.php version 2.4.0 is out of date. The core version is 3.5.4

So I went to update them myself from the woocommerce Github branch for templates. After I did. I decided to test it by resending a notification email to myself from an existing order. That is when I got the following message:

There has been a critical error on your website. Please check your site admin email inbox for instructions.

I checked my error log and got the following message:

[04-Mar-2020 16:16:01 UTC] id was called incorrectly. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WC_REST_CRUD_Controller->get_items, WC_REST_Orders_V2_Controller->prepare_object_for_response, WC_REST_Orders_V2_Controller->get_formatted_item_data, WC_Order->get_data, WC_Order->get_order_number, apply_filters('woocommerce_order_number'), WP_Hook->apply_filters, ov_iw_woocommerce_order_number, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong. This message was added in version 3.0.

So I am unsure what I did but I unfortunately do not have the previous PHP templates for those.

I got on chat with Woocommerce and they had me install the following plugin: https://wordpress.org/plugins/health-check/

Once I did, I used troubleshooting mode with the pro theme and just woocommerce and still got the error, but when I switched back to a default theme such as twenty twenty, the email went through just fine. They said that due to it not being a plugin issue but a theme issue, I would need to get in touch with you to fix the problem.

Please Help me as now none of my emails will send!

It looks like it has to do with the email-styles.php file that I had changed and then changed back. The emails are now going through but it is still outdated. can you help me asses why the 3.7 version from github errors with the theme?

Hello Joseph,

Thanks for writing in!

All of the errors were coming from the child theme:

pro-child/woocommerce/emails/customer-refunded-order.php version 2.5.0 is out of date. The core version is 3.7.0
pro-child/woocommerce/emails/customer-reset-password.php version 2.0.0 is out of date. The core version is 3.7.0
pro-child/woocommerce/emails/email-addresses.php version 2.4.0 is out of date. The core version is 3.5.4

pro-child/woocommerce/emails/ these files were added by you or by your developers. You will need to update these files. Perhaps this documentation might be able to help you resolve this issue:

Hope this helps. Kindly let us know.

Hello Ruenel,

Thank you for the clarification. In order to use the templates provided by the PRO theme, do I just delete a template for it to revert back?

Thanks,

Hi Joseph,

Yes, that is correct, but the templates (pro-child/woocommerce/emails/) mentioned above does not exist on the parent theme so it will fall back all the way to the Woocommerce original email templates (/plugins/woocommerce/templates/emails).

Thanks,

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.