wp ecommerce & qtranslate multilanguage store

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:

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:

Fancy notifications

The small popup notification as well as the sliding notification on the top of the cart widget still show all languages:

I tried to use the filters in cart.class.php in function get_title() but they have been ignored, so I used an ugly solution here:

I had to modify one of the wpsc core files.

Search the line containing the string “You just added” in wp-e-commerce/wpsc-includes/ajax.functions.php (in version 3.8.9.2 it’s line 91)

Add __() around $cart_item->get_title()

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()

.

 Deutscher 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.

 

Please add any issues in the comments below.

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 thoughts on “wp ecommerce & qtranslate multilanguage store”

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">