Home / Forums / WoodMart support forum / Related Products is not displayed on the product page in the secondary language
Home › Forums › WoodMart support forum › Related Products is not displayed on the product page in the secondary language
Related Products is not displayed on the product page in the secondary language
- This topic has 10 replies, 2 voices, and was last updated 3 years, 2 months ago by
Elise Noromit.
-
AuthorPosts
-
August 4, 2022 at 11:14 am #395474
davi.silvaParticipantHello,
I use WPML to translate my site made with Woodmart.
On the product page (Single Product) the related products that are displayed after the description are only being displayed in the main language, in secondary languages they do not appear.
I already maked everything in the WPML and Woodmart documentation, but it didn’t solve the problem.
Attachments:
You must be logged in to view attached files.August 5, 2022 at 3:40 am #395629
Elise NoromitMemberHello,
Make sure you have translated all the product categories and all the products into all the languages, then clear the cache every time you add new translations.
If you have any questions please feel free to contact us.
Best Regards
August 5, 2022 at 12:19 pm #395724
davi.silvaParticipantHello,
I have all my products translated. And I have all the categories, attributes, tags, everything is translated.
(See attached image).I already cleared the cache.
But it still doesn’t show in Related Products.
Attachments:
You must be logged in to view attached files.August 6, 2022 at 2:27 am #395846
Elise NoromitMemberHello,
Please insert the site admin access into the Private content below the message area. We will take a closer look at the case.
Best Regards
August 8, 2022 at 10:44 am #396061
davi.silvaParticipantok.
August 9, 2022 at 3:48 am #396227
Elise NoromitMemberHello,
Please update the translation of the products as shown: https://gyazo.com/ced747f60a8a1072650cd3349b636957
If the problem remains, please deactivate the cache plugins and check again.
Best Regards
August 9, 2022 at 10:47 am #396277
davi.silvaParticipantHello,
I updated the translation in some products, but it didn’t solve the problem, see attached image.
I disabled my caching plugin, and the problem continues.I had already done these procedures before opening the ticket here.
Regards
Attachments:
You must be logged in to view attached files.August 10, 2022 at 12:55 pm #396530
davi.silvaParticipantI contacted WPML support, and they resolved my issue.
They said that this is because your code has an incompatibility in related products for secondary languages.They made a change to the products.php file (inc/shortcodes/products.php). Exactly on line 234:
The code was this:
$args[‘post__in’] = array_merge( array( 0 ), wc_get_related_products( $product->get_id(), $args[‘posts_per_page’], $product->get_upsell_ids() ) );Replaced for this:
$args[‘post__in’] = wc_get_related_products( $product->get_id());By doing this my problem was solved, and related products appear in all languages. (see attached image)
But WPML support said that you should include this change in the woodmart theme in the next update, otherwise when you update it will replace the code and the error will happen again.
Attachments:
You must be logged in to view attached files.August 11, 2022 at 1:39 am #396681
Elise NoromitMemberHello,
Thank you very much for the shared information. I will submit this case to our developers and they would include these changes.
If you have any questions please feel free to contact us.
Best Regards
August 12, 2022 at 1:31 pm #396967
davi.silvaParticipantOk, I’ll wait for the next update with this fix.
For now the problem is solved.
August 13, 2022 at 1:52 am #397052
Elise NoromitMemberThank you for patience.
Wish you a wonderful day!
-
AuthorPosts
The topic ‘Related Products is not displayed on the product page in the secondary language’ is closed to new replies.
- You must be logged in to create new topics. Login / Register