• Hi,

    First of all, thanks for the plugin. It is very useful.

    I would like to ask if it’s possible to add support for WPML. I have a website with 3 languages and I can translate the strings with Loco Translate except the ones that are not static (like “Pending Order Text” in Settings).

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author James Golovich

    (@jamesgol)

    You’re the first person that has asked about having multiple languages active on a site. Let me see what I can come up with and I’ll get back to you

    Thread Starter Gerard Blanco

    (@sixaxis)

    There is a first time for everything ??
    I’ll wait.

    Thank you,

    Plugin Author James Golovich

    (@jamesgol)

    I just committed a wpml-config.xml file to the github repository. It was easy to setup, but took a while to test it out since I’ve never done this kind of translation with WPML. It does appear to work. The file will be in the next release I make, but you can grab it from https://raw.githubusercontent.com/jamesgol/woocommerce-cart-stock-reducer/5a29ab989ac73e5af006176cf6c5cad7c96c7086/wpml-config.xml and install it in your woocommerce-cart-stock-reducer directory. With WPML I had to hit a button to rescan the plugin for files and then was able to translate the ‘admin_texts_woocommerce_woocommerce-cart-stock-reducer_settings’ strings.

    The file is pretty simple so I included a copy here.

    
    <wpml-config>
        <admin-texts>
            <key name="woocommerce_woocommerce-cart-stock-reducer_settings">
                <key name="stock_pending" />
                <key name="stock_pending_expire_time" />
                <key name="stock_pending_include_cart_items" />
            </key>    
        </admin-texts>   
    </wpml-config>
    

    Please let me know if this works for you.

    • This reply was modified 7 years, 8 months ago by James Golovich. Reason: URL text was missing
    Thread Starter Gerard Blanco

    (@sixaxis)

    Hey James,

    Thanks a lot for taking the time to do it.
    But, unfortunately, it looks like it doesn’t work completely. Now I can see the three strings in the WPML menu to translate them, but there are two weird issues:

    1) The “Append Expiration Time to Pending Order Text” and “Append Included Items to Pending Order Text” gets translated to Spanish but not to Catalan (I have Catalan, Spanish and English). I press the save button but once I refresh the WPML String Translation menu, the Catalan translation is back to English.

    2) It seems like the sessions are not synchronised between all the languages.
    I’ve been with 3 different browsers with a private session and with my cache plugin deactivated, just in case.
    Then, I add one item to the cart and I get the “not available” message, but if I change the language, I can add again the product.
    If I change the browser, usually one language will have the “not available” message but the other 2 languages won’t have it. I haven’t been able to find a regular pattern.

    By the way, my case is this “edge” case where I have 1 unit of each product.

    Feel free to test it by yourself. The website is https://www.naikare.es/botiga, and from there you can change to Spanish or English.

    Thanks again, and if you have any question just let me know.

    Plugin Author James Golovich

    (@jamesgol)

    Regarding your first issue, I’m not sure what that could be. I did a test on my local setup using English, German and Italian and all of the strings were able to be translated.

    The second issue would likely require some modification to my plugin. This is the first time I’ve looked into multilingual WooCommerce, but it appears that each translated item is stored as a separate post ID. It appears that the woocommerce-multilingual plugin provided by WPML has some code in place to keep the inventory synced up between different translated products.

    When I have some time I will try to look into their code deeper to see if I can figure out a method to support this. I can’t make any promises though.

    Thread Starter Gerard Blanco

    (@sixaxis)

    OK, thanks, James.

    Thread Starter Gerard Blanco

    (@sixaxis)

    Hey James,

    Just letting you know that the first issue is solved somehow.

    So the only “pending” thing is the second one. If you have some time, of course.

    Thank you again,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WPML support’ is closed to new replies.