Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:

The following error occurs, and it is impossible to complete a translation.

Call to undefined function wc_get_default_product_type_options() /public_html/wp-content/plugins/woocommerce/includes/tracks/events/class-wc-products-tracking.php:242

Solution:

I can see this error when I go to WPML -> Support -> Advanced Translation Editor Error Logs. Please see the screenshot at the following link.

https://app.screencast.com/Tcm804YxP0Hp4?commentId=TATzGq2wSs6AdaMih6PhUG&conversation=IFUN2ItAKFQOBHt2OVwcwC&tab=Details

This is a known issue. We explain and provide a workaround for it at the following link.

https://wpml.org/errata/woocommerce-php-fatal-error-uncaught-error-call-to-undefined-function-wc_get_default_product_type_options/

Please apply the suggested workaround.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 12 replies, has 2 voices.

Last updated by majaR 1 year, 11 months ago.

Assisted by: Itamar.

Author Posts
June 28, 2023 at 5:13 pm #13912529

majaR

I am trying to: I have reached you back regarding this issue in this post: https://wpml.org/forums/topic/translations-does-not-appear-online/

We have changed host and we have increased the site memory limit and the PHP and WP limit. Therefore the translations for the products are still not appearing on the front end. It seems 100% done in automatic translation and when you click save the translation just doesn't appear on the site like it used to.

Link to a page where the issue can be seen:hidden link
(this product is translated already but does not appear in catalan language)

I expected to see:
Translation, as per image uploaded

Instead, I got:
Nothing appears

Screen-translation-done.PNG
June 29, 2023 at 5:33 pm #13920005

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I can see that switching to the Catalan language is still impossible.

Please ensure that the Catalan page is not pending review. You can read about reviewing the translation here.

https://wpml.org/documentation/automatic-translation/how-to-review-automatic-translations-on-your-site/

There is also a possibility that the translated Catalan page is in draft mode. You can check it by switching to the Catalan editing screen with the Language Switcher in the top admin bar. There on the editing screen should be able to change the status of the Catalan page to published.

Regards,
Itamar.

June 29, 2023 at 5:47 pm #13920017

majaR

I have checked and the products doesn't seem to be draft neither pending the review.

1) They don't appear att on the list of the products in catalan language (neither as draft)
2) In wocommerce multilingual it still seems like they need translation (although it is all done automatically)

no-draf.png
Screenshot 2023-06-29 194247.png
June 29, 2023 at 5:50 pm #13920071

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Thanks for checking my suggestions.

Could it be that you trashed that page by mistake, and it is in the trash section?

If so, please recover the page from the trash section and check again.

June 30, 2023 at 9:00 am #13921825

majaR

Hello, thanks for your suggestions.

We have checked the trash and there is just 1 product (in spanish) nothing in catalan.

The issue seems to be elsewhere. As after automatic translation when the product should be saved and publish (it worked in most of the cases) it just doesn't appear on the catalan list of products. No matter how many times we try to save it.

Capture.PNG
June 30, 2023 at 2:51 pm #13924613

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, and thanks for trying my suggestions.

If you need further help, please share the access details to your site and tell me the steps to see the issue there. I'm enabling a private message for the following reply.
Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

June 30, 2023 at 7:59 pm #13925829

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, and thanks for the access details.

I can see the problem on your site. I checked the "Pack vermut rojo, blanco y eco Cisa" product. In WPML -> Translation Management and on the Jobs tab, I can see that the translation is complete. Please see the attached screenshots Translation-Management.jpg and Translation-Management-Jobs .jpg. When I go to the editing screen of the product, I can see that the plus icon is showing. Please see the attached screenshot Pack vermut rojo, blanco y eco Cisa.jpg. But I can see the translations when I edit the translation with the Translation Editor. Please see the attached screenshot Translation-Editor-ok.jpg. Please try WPML's troubleshooting screen.

Please, try the troubleshooting section.

1. Take a backup of the DB of your site.

2. Go to WPML -> Support -> Troubleshooting (link)

3. Once on the troubleshooting screen, press the following buttons and check if it helps. Press each button at a time and wait for the process to complete.

- 'Disable cache for language switcher templates'

- 'Clear language information and repopulate languages' button (if it is showing)

- 'Synchronize posts taxonomies' for 'Products'

- 'Clear the cache in WPML'

- 'Remove ghost entries from the translation tables'

- 'Fix element_type collation'

- 'Fix WPML tables collation'

- 'Assign translation status to duplicated content'

- Synchronize local job ids with ATE jobs

- Synchronize translators and translation managers with ATE

- 'Set language information'

- 'Reset languages' Press this button only if you didn't add a custom language!

- 'Fix terms count'

- 'Fix post type assignment for translations'

- 'Cleanup and optimize string tables'

*** Please backup your database before using this.***

Does it help to solve the problem?

Translation-Management.jpg
Translation-Management-Jobs .jpg
Pack vermut rojo, blanco y eco Cisa.jpg
Translation-Editor-ok.jpg
July 2, 2023 at 1:00 pm #13929211

majaR

Thank you for those suggestions.

I went one by one but I still can't solve the issue. The translations still doesn't appear. Except reset languages button which I didn't press due to your note (as we have catalan as additional language to spanish)

We have daily backups automatically set up. Would you be able to try it with the admin access?

Thank you in advance for your support.

July 2, 2023 at 8:27 pm #13929697

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I discovered that this problem occurred because of the following fatal error.

Call to undefined function wc_get_default_product_type_options() /public_html/wp-content/plugins/woocommerce/includes/tracks/events/class-wc-products-tracking.php:242

I could see the error in WPML -> Support -> Advanced Translation Editor Error Logs. Please see the screenshot.

hidden link

This is a known issue that we explain and provide a workaround for at the following link.

https://wpml.org/errata/woocommerce-php-fatal-error-uncaught-error-call-to-undefined-function-wc_get_default_product_type_options/

Please apply the workaround. Cancel the translation job of this product from the Translation Management and translate the product. You will find the translation of the product in the Advanced Translation Editor because it has translation memory. Complete the translation; it should now be downloaded to the site and work on the front end.

Can you please try it?

If you want me to apply the workaround, please provide the FTP access details to your site. You can edit the previous private message to insert the FTP details.

Regards,
Itamar.

July 3, 2023 at 1:25 pm #13933159

majaR

Hello,

I have provided you the access to files too.

I think I have implemented it, thus not sure how to make it work - how to cancel it in translation management?

Could you check this out for me? And let me know the steps, as the same issue appears on the all CISA products from the list

Thanks a lot for your help

Cisa-translation.PNG
workaround.PNG
July 3, 2023 at 5:07 pm #13935357

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I couldn't access your site with FTP. It seems you shared the wrong details. But I can see the problem with this product is solved.

hidden link

I can see that now it is translated into Catalan.

hidden link

Also, please see the attached screenshot pack-vermut-vermell-blanc-eco-cisa.jpg.

According to your screenshot, you implemented the workaround from the errata correctly.

I also checked a few of the Cisa products; they are all untranslated. It is also possible to see in WPML -> Translation Management. If they have the brownish icon, then it means they are untranslated. Translated products show with the green icon. It is also possible to see it in the screenshot you shared in your last reply. For example, I specifically checked the "Pack vermut rojo y blanco Cisa" product. And I can see that next to Catalan, the plus icon shows. Please see the attached screenshot Pack-vermut-rojo-y-blanco-Cisa.jpg.

So what you need to do now is to translate those products. Since you implemented the workaround, the translation should work.

Please let me know if any further questions.

pack-vermut-vermell-blanc-eco-cisa.jpg
Pack-vermut-rojo-y-blanco-Cisa.jpg
July 3, 2023 at 5:23 pm #13935431

majaR

My issue is resolved now. Thank you for your support and checking everything! All works and appears correctly!