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

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #395474

    davi.silva
    Participant

    Hello,

    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.
    #395629

    Hello,

    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

    #395724

    davi.silva
    Participant

    Hello,

    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.
    #395846

    Hello,

    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

    #396061

    davi.silva
    Participant

    ok.

    #396227

    Hello,

    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

    #396277

    davi.silva
    Participant

    Hello,

    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.
    #396530

    davi.silva
    Participant

    I 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.
    #396681

    Hello,

    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

    #396967

    davi.silva
    Participant

    Ok, I’ll wait for the next update with this fix.

    For now the problem is solved.

    #397052

    Thank you for patience.

    Wish you a wonderful day!

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Related Products is not displayed on the product page in the secondary language’ is closed to new replies.