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.
This is a known issue. We explain and provide a workaround for it at the following link.
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.
Tagged: Bug, Documentation request
This topic contains 10 replies, has 2 voices.
Last updated by mhd-eiadA 1 year, 11 months ago.
Assisted by: Itamar.
Author | Posts |
---|---|
June 28, 2023 at 6:11 pm #13912973 | |
mhd-eiadA |
Dear WPML Support Team Good Day I have a problem in translation, please note the home page : hidden link This is in the English page: (Image-1) This how it looks in Arabic page: Those are our product categories as they look in English version : (Image-2) And this is how they look in Arabic language: Please note the last item, also the order of the categories One more thing: The second item have no photo, in fact this item is cancelled (draft) in English version, but still appear here in Arabic version Please help me to solve those problems Thank you |
June 29, 2023 at 6:04 pm #13920089 | |
mhd-eiadA |
Now it is not showing the translation at all, Today I added this item and translated it, but It is not working the second language version : hidden link |
June 30, 2023 at 9:25 am #13921977 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, I can see the problem with the images on the homepage of your site in Arabic. To try and correct it, please go to WPML -> Settings and scroll down to the Media Translation section. There, please ensure that all the options for existing media are checked (they are checked by default). And press the 'Start' button and wait for the process to finish. Then go to the original product and press the Update button. And then update the translation of the product (with missing image). Check if it fixes the issue. Please read about the Media translation options here. https://wpml.org/documentation/getting-started-guide/media-translation/#id5 I do not see a problem with this product. hidden link When I switch to Arabic, I can see the translation. hidden link Please see the attached screenshot. Have you fixed this problem? Regards, |
June 30, 2023 at 10:35 am #13922885 | |
mhd-eiadA |
Hi |
June 30, 2023 at 7:28 pm #13925559 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
HI, Eiad. If you haven't done so, please check our guide on Media translation. You can learn how to translate images and replace an image to be different in other languages. https://wpml.org/documentation/getting-started-guide/media-translation/ Have you followed our guide about this? If you need further help with this, please share the access details to your site with me. Please explain to me which product to edit and which image you have the problem with. I'm enabling a private message for the following reply. Privacy and Security Policy |
July 1, 2023 at 4:46 pm #13927837 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Eiad, and thanks for the access details. You made a small mistake in the username. But I realized it was a misspelling of the email address, and eventually, I could log into your site. I'm sorry if I was not clear enough before about the following. In our support forum, we handle one issue per ticket. Since you brought up several issues, I want to ask you to open a separate ticket for each issue. Dealing with one issue pet ticket helps us, the supporters, to give you better support. Dealing with many issues in a ticket might also be confusing for you. In this answer, I'll give you tips about the other issues and tell you the issue we will focus on in this ticket. The main issue we will focus on in this ticket is the fatal error on your site. The fatal error is: 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 can see this error when I go to WPML -> Support -> Advanced Translation Editor Error Logs. Please see the screenshot at the following link. hidden link This is a known issue. We explain and provide a workaround for it at the following link. Please apply the suggested workaround. You should also increase the WP Memory Limit. I can see that your server's WP Memory Limit is set to 40M. Our recommendations are to have the following as minimal requirements: - PHP 5.6 and above (this OK with your installation) with a WP Memory Limit of at least 128MB while 256MB is recommended. MySQL 5.6 and above. Please follow this link for detailed documentation: https://wpml.org/home/minimum-requirements/ Is it possible for you to change those to the minimum requirement? You may need to contact your hosting provider for that. Meeting those baseline requirements is critical before debugging and sometimes solves issues you experience. The most important thing is to raise the WP Memory Limit. Please try to raise it before you contact your hosting company. You can do it from the wp-config.php file in your WordPress installation. Insert this code in that file: /** Memory Limit */ define('WP_MEMORY_LIMIT', '256M'); define( 'WP_MAX_MEMORY_LIMIT', '256M' ); Add it before this line: /* That's all, stop editing! Happy blogging. */
Please let me know once you completed the above, and I'll check your site again. The product in Arabic is not showing the translation (3) hidden link The following message in the admin (6)
The above two issues might be related to the fatal error. So please proceed with my suggestions; we will check this issue after you add the correction. ------------------------------------------------- Translating images When we say translating images, we mean using a different image for the translated product. Let's say that you have a product, and this product has different packages—a package in English for English-speaking customers and a package in Arabic for Arabic-speaking customers. So if you need to display the image with the package in Arabic for the translation of the product into Arabic, you can use WPML's Media translation. If you don't need to do this for any of your products or posts, it is better that you deactivate the Media translation add-on. If you need further help with this issue, please open a separate ticket in our support forum. The direction of the menu on the homepage (1) This is probably not a WPML issue but a Right-to-left issue coming from your theme or a plugin. If you need further help or explanations about this issue, please open a separate ticket in our support forum. Images not showing in the slider (2) This might be because of the same reason as the above issue. If you need further help or explanations about this issue, please open a separate ticket in our support forum. Language Switcher in the mobile mode is not working (4) If you need further help or explanations about this issue, please open a separate ticket in our support forum. The message about cache and multi-currency in the admin (5) In the settings of your caching plugin, you should be able to set not to cache pages for visitors with a cookie set in their browser. If you need further help or explanations about this issue, please open a separate ticket in our support forum. Regards, |
July 1, 2023 at 10:20 pm #13928229 | |
mhd-eiadA |
Dear ITMAR, hidden link I answered in red color |
July 2, 2023 at 8:06 am #13928585 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Eiad, and thanks a lot for the detailed answers. Out of the ordinary, I work this weekend. Thanks for following my suggestions. I can see it helped to solve problems on your site. I also confirm that I see that the product is now translated. This solved the major problem. I also solved the missing images from the "Our Products Categories" problem. Please see the attached screenshot Our-Products-Categories-images-ok.jpg. I went to WPML -> Settings -> Media translation, ensured that all the options were selected, and pressed the "Start" button. I then waited for the process to finish. There were thousands of images to handle, which took a few minutes. Please see the attached screenshot duplicate-media-runing.jpg. When the process finished, I could see the images on the homepage. Again, if you are not switching any images on the Arabic products to be different than the images on the English products, I suggest that you deactivate the WPML Media add-on. I also solved the issue with the admin message about some taxonomies in your site being forced to be untranslatable. I went to WPML -> Settings -> Taxonomy Translation and changed all the untranslated taxonomies I knew should be set to "Translateable". Please see the attached screenshot Taxonomy-Translation-ok.jpg. Now the message does not show. Please confirm that the issues of this ticket are solved now. Please open new tickets for each issue that is not solved yet. I can give you a tip regarding the "The direction of the menu on the homepage" issue. I found out that the following CSS directive causes it. .nasa-rtl .nasa-menu-item-icon { margin-right: auto; } When I cancel this directive, the menu is aligned to the right. Please see the attached screenshot menu-aligned-to-right.jpg. This CSS directive is coming from your theme. If you know how you can try and overwrite it with custom CSS. Please get in touch with the support of your theme on this RTL issue. It is not related to WPML. The problem will be there even if WPML is not installed and Arabic is the only language of your site. Best Regards, |
July 2, 2023 at 10:00 am #13928913 | |
mhd-eiadA |
Dear Mr. Itmar, I also solved the missing images from the "Our Products Categories" problem. I also solved the issue with the admin message I can give you a tip regarding the "The direction of the menu on the homepage" issue. By the way, I did not see your screenshots, looks like it was not attached, but any way, the results are clear now, thank you again Best Regards, |
July 2, 2023 at 12:02 pm #13929101 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Eiad. You asked: "How can I deactivate the WPML Media add-on? Please note that I want to use the same images for both languages, so which setting is I should know to do this?" You can deactivate it in Plugins -> All Plugins. You can do it the same way as you deactivate any WordPress plugin. I have already deactivated the WPML Media for you. The settings that you now have in WPML -> Settings -> Media translation are correct for duplicating the posts for new and existing media. I can see the screenshots I attached in my previous message. It is weird that you cannot see them. Please see this screenshot. hidden link Regards, |