Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rody 80 posts 280 karma points
    Feb 14, 2022 @ 10:57
    Rody
    0

    IUmbracoProductNameExtractor - languageIsoCode always en-us in multilingual shop

    We have a multi lingual shop where we are overriding the logic to generate the productname using IUmbracoProductNameExtractor.

    We implemented the following method with our own logic:

    ExtractProductName(IPublishedContent content, string languageIsoCode)
    

    However, we notice a lot of products are now always saved in English language, however they are added using the Dutch or German shop.

    We debugged the code, and the languageIsoCode passed into this method is almost always "en-us", and sometimes it is the correct langauge.

    Where does this languageIsoCode originate from? We cannot seem to find out the logic behind this.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 14, 2022 @ 11:14
    Matt Brailsford
    100

    Hey Rody

    This will be the order.LanguageIsoCode that is used, so you need to ensure the orders language ISO code is set should the language change.

    Vendr will look this up from the current thread when it creates the order, but it can't know if this is ever changed, so if the culture of the website gets changed, you need to change it on the order too, calling order.SetLanguage(languageIsoCode)

    NB We don't currently re-translate order lines though so any order lines added using the previous culture will still be in that cultures language

    Hope this helps

    Matt

  • Rody 80 posts 280 karma points
    Feb 14, 2022 @ 11:16
    Rody
    0

    Hi Matt,

    That definetely helps. This is exactly what's going on. We do a SetLanguage after adding the article to the cart, so that's clear why :-)

    Thanks again!

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 14, 2022 @ 11:21
    Matt Brailsford
    0

    No problem.

    Glad it helped 😁

Please Sign in or register to post replies

Write your reply to:

Draft