wp ecommerce & qtranslate multilanguage store

Posted on Nov 21, 2012 in Wordpress | 3 Comments

This post is a development documentation of the qtranslate integrations for WP E-commerce Shop Styling.

I’m working on a multilanguage wp ecommerce shop. Many translations work out of the box with qtranslate and the content from the .mo and .po files.

Unfortunately there are some small problems.

shopping cart

Product name

In the shopping cart widget as well as in the fancy notification I had a product name in both languages.

I found this post: http://getshopped.org/forums/topic/how-to-create-a-multilingual-shop-with-qtranslate/#post-150551

It’s out of date, but it gave me the right hint.

Add this to your themes function.php or to your plugin:

If you’re using the shop styling plugin you do not need this, function, because it’s already included in the plugin.

Product links

The product links in the cart widget and also the cart page still point to the default language.

You can either surround each link with qtrans_convertURL() or solve the problem in general.

To fix this problem for all internal links add this to your functions.php:

If you’re using the shop styling plugin you do not need this, function, because it’s already included in the plugin.

Checkout and Clear cart links

At the bottom of the cart widgets are two links, one to clear the cart, and one to the checkout page.

Both of them point to the default language, so you have to wrap them in qtrans_convertURL()

Emails

This part is especially for the shop styling plugin.

You can add the different languages to the email content fields using the HTML comment syntax English Text .

The first email immediately after the purchase is sent in the users session, so it still has the same language as selected in the shop, but if the admin changes the order state (for example after a manual payment) another email is sent to the customer and this email is in the preferred language of the admin(!!).
So the result of my tests: IT DOESN’T WORK! (Shop Styling 1.9.1)

Thanks to Daniele for pointing me the right direction. I hope to find some time to fix this in the next weeks.

UPDATE 2013-05-12:

I added a few improvements in the last days.
The column titles of the products table as well as the email subjects can be translated now very comfortable using the qtranslate extension plugin.
A great plugin with really simple integration.
All other texts, especially the formatted contents can be translated using shortcodes.
e. g. [ :en ]english text [ :de ]german text [ :nl ]dutch text…

There was another tricky modification:
When a user submitted his order all mails, pages and the invoice were already translated correctly, but when the admin changed the payment status an email was sent in the language of the admin.
So I had to save the user locale on order submission to the database (shown as a flag in the sales log table ) and translate the mail to this language.

wp e-commerce sales log language flags

Download development version

 

Please add any issues in the comments below and tell me if you found bugs and improvements.

3 Comments

  1. Daniele
    2013/04/23 07:14

    Hi Hannes,

    Thanks for posting this!

    Did you check if the translation codes are also working for the “products table” provided by your plugin?

    Reply
    • Daniele
      2013/04/29 14:07

      I spoke with Hannes, latest version of the plugin (1.9.2) translates the “product table” correctly!

      THANKS

      Reply
    • Hannes
      2013/05/12 16:46

      Hi Daniele,
      I added a link to the development version above and I hope you can give me some feedback.
      br, Hannes

      Reply

Leave a Reply