Home › Forums › WoodMart support forum › The problem of translating categories through the plugin WPML
The problem of translating categories through the plugin WPML
- This topic has 17 replies, 3 voices, and was last updated 1 year, 3 months ago by Luke Nielsen.
-
AuthorPosts
-
August 9, 2023 at 12:46 pm #487600
SupershevaParticipantHello
The site uses a translation plugin WPML.
Problem with translating Product Categories, each has its own layout.
Translation of Product Categories layouts could not be completed due to a fatal error:[08-Aug-2023 12:12:47 UTC] PHP Fatal error: Uncaught Error: Call to undefined function wc_print_notices() in /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/woocommerce/includes/wc-template-functions.php:3860
Stack trace:
#0 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/themes/woodmart/inc/modules/layouts/elementor/woocommerce/class-notices.php(113): woocommerce_output_all_notices()
#1 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/controls-stack.php(2243): XTS\Modules\Layouts\Notices->render()
#2 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/widget-base.php(609): Elementor\Controls_Stack->render_by_mode()
#3 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/widget-base.php(673): Elementor\Widget_Base->render_content()
#4 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/db.php(202): Elementor\Widget_Base->render_plain_content()
#5 /sata2/home/users/grandmas/www/www.steli.ua/wp-con in /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 3860For this reason, the translation cannot be completed.
Plugin developers recommended to contact you.
On the WordPress site, theme Woodmart and all plugins are updated to the latest versions.Please help.
August 9, 2023 at 4:40 pm #487695
Luke NielsenKeymasterHello,
May I request you send me access to the admin dashboard so I will check that issue on your side?
Thank you in advance.
Kind Regards
August 9, 2023 at 11:06 pm #487754
SupershevaParticipantYes.
Please check Extra information:August 10, 2023 at 5:37 pm #487975
Luke NielsenKeymasterHello,
Please add the below code to the functions.php file in your child theme and then clear the cache and recheck the issue.
add_action( 'woocommerce_before_template_part', function () { global $product; if ( wp_is_json_request() && ! $product ) { $random_product = new WP_Query( array( 'posts_per_page' => '1', 'post_type' => 'product', ) ); while ( $random_product->have_posts() ) { $random_product->the_post(); $product_id = get_the_ID(); } wp_reset_postdata(); $product = wc_get_product( $product_id) ; } } );
Let me know the result.
Kind Regards
August 10, 2023 at 11:48 pm #488009
SupershevaParticipantThe page with a translation into Russian has ceased to load constantly.
But the translation problem remains. The banner and thumbnails of subcategories are not displayed in the translation. Screenshot is attached.
And in the admin panel, the translation icon is constantly spinning. This means it’s not finished. Screenshot is attached.Attachments:
You must be logged in to view attached files.August 11, 2023 at 12:23 pm #488147
Artem TemosKeymasterWe understand that the issue you are experiencing is likely related to the WPML due to an incorrect translation of a custom field. The field in question, which needs to be translated, contains an array with 3 keys (https://monosnap.com/file/Rw2fGnD68uvNOuwT3djUQta2FN3mw2), while WPML is displaying only an array with 2 keys (https://monosnap.com/file/uqqpswxPOohXVwrFWp96VtMKpVyzK6). Therefore, could you please contact the technical support of WPML to resolve this issue?
August 15, 2023 at 1:32 am #488695
SupershevaParticipantPlease check answer from WPML developers:
Thanks for the update.I checked again, the translation still can’t be loaded, as there is still an error on the site that does not allow the translation to be completed:
[14-Aug-2023 18:57:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined function wc_print_notices() in /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/woocommerce/includes/wc-template-functions.php:3878
Stack trace:
#0 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/themes/woodmart/inc/modules/layouts/elementor/woocommerce/class-notices.php(113): woocommerce_output_all_notices()
#1 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/controls-stack.php(2243): XTS\Modules\Layouts\Notices->render()
#2 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/widget-base.php(609): Elementor\Controls_Stack->render_by_mode()
#3 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/widget-base.php(673): Elementor\Widget_Base->render_content()
#4 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/db.php(202): Elementor\Widget_Base->render_plain_content()
#5 /sata2/home/users/grandmas/www/www.steli.ua/wp-con in /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 3878
[14-Aug-2023 18:57:12 UTC] PHP Fatal error: Uncaught Error: Call to undefined function wc_print_notices() in /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/woocommerce/includes/wc-template-functions.php:3878
Stack trace:
#0 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/themes/woodmart/inc/modules/layouts/elementor/woocommerce/class-notices.php(113): woocommerce_output_all_notices()
#1 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/controls-stack.php(2243): XTS\Modules\Layouts\Notices->render()
#2 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/widget-base.php(609): Elementor\Controls_Stack->render_by_mode()
#3 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/base/widget-base.php(673): Elementor\Widget_Base->render_content()
#4 /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/elementor/includes/db.php(202): Elementor\Widget_Base->render_plain_content()
#5 /sata2/home/users/grandmas/www/www.steli.ua/wp-con in /sata2/home/users/grandmas/www/www.steli.ua/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 3878Can the theme developers remove it so we can continue with the translation issue? I understand the idea of what the theme developer is writing about, but in order to check this, you need to complete the translation. As far as I can see, the Woodmart theme overwrites some templates and an error occurs somewhere at this stage.
August 15, 2023 at 12:57 pm #488832
Luke NielsenKeymasterHello,
Could you please share the link when transitioning to which the error is displayed or how you see this error as it should not be there?
Kind Regards
August 16, 2023 at 12:28 pm #489053
SupershevaParticipantYou need to follow these steps:
– Activate debug.log error log
– Open the page
https://steli.ua/wp-admin/edit.php?post_type=woodmart_layout&wd_layout_type_tab=shop_archive– This fatal error will be added to the error log
August 16, 2023 at 2:16 pm #489068
Luke NielsenKeymasterHello,
Please add the below custom code to the child theme and then recheck the issue.
add_action('init', function () { if ( ! empty( $_SERVER['REQUEST_URI'] ) && false !== strpos( $_SERVER['REQUEST_URI'], trailingslashit( rest_get_url_prefix() ) ) && function_exists( 'wc_load_cart' ) && ! function_exists( 'wc_print_notices' ) ) { wc_load_cart(); } }, 1000);
Kind Regards
August 17, 2023 at 2:00 pm #489312
SupershevaParticipantYour code didn’t help. Problem still exists.
August 17, 2023 at 2:20 pm #489319
Luke NielsenKeymasterHello,
This code fixed the error from this response: https://xtemos.com/forums/topic/the-problem-of-translating-categories-through-the-plugin-wpml/#post-488695
And checking the logs on the site, we do not see that error.
Kind Regards
August 22, 2023 at 2:13 pm #490440
SupershevaParticipantNow category layout pages have different addresses and they don’t open. More precisely redirected to the main page.
Category layout page example:
https://steli.ua/woodmart_layout/steli/
A page translation
https://steli.ua/ru/woodmart_layout_ru/potolky/
leads to a 404 error pageAugust 22, 2023 at 2:33 pm #490461
Luke NielsenKeymasterHello,
Sorry, we have fixed that, please recheck the issue and let me know.
In the meantime, feel free to ask me any questions you may have.
Kind Regards
August 22, 2023 at 7:52 pm #490559
SupershevaParticipantProblem still exists.
August 23, 2023 at 12:31 pm #490700
Luke NielsenKeymasterHello,
At the moment there is no error about which you wrote https://xtemos.com/forums/topic/the-problem-of-translating-categories-through-the-plugin-wpml/#post-490440 could you clarify which error still remains?
Kind Regards
August 23, 2023 at 3:15 pm #490755
SupershevaParticipantThis problem still exists:
Now category layout pages have different addresses and they don’t open. More precisely redirected to the main page.
Category layout page example:
https://steli.ua/woodmart_layout/steli/
A page translation
https://steli.ua/ru/woodmart_layout_ru/potolky/
leads to a 404 error pageAugust 25, 2023 at 3:44 pm #491305
Luke NielsenKeymasterHello,
Category page: https://steli.ua/product-category/steli-uk/
A page translation: https://steli.ua/ru/product-category/steli-ru/
As you can see, the translation works.
Kind Regards
- This reply was modified 1 year, 3 months ago by Luke Nielsen.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register