Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Estore+affiliate+wpml, got everything working but only one thing not…
Tagged: add to cart, estore, Language, multilingual, product description, translate, Translation, wpml
- This topic has 12 replies, 3 voices, and was last updated 11 years ago by admin.
-
AuthorPosts
-
March 16, 2012 at 8:57 pm #5846AncadeMember
I’m using Estore and affiliate plugin and have it all multilingual, only think I can’t get changed is the “add to cart” text, how can I translate this? (I use WPML)
btw done all the changes for estore to get it working with WPML, only “add to cart” text is not translated
March 17, 2012 at 12:31 am #43098adminKeymasterYou specify the default text of the “Add to cart” button in the following settings field of eStore:
Add to Cart Button Text or Image
eStore will take the value you specified in that field and show it on the front end.
March 17, 2012 at 11:10 am #43099AncadeMemberYes I know, but wasn’t my question. In your translations files like eng.php, spa.php etc, the value is not specified. I need to have it translated in serveral languages, I have a multilingual website. I use WPML and have everything nearly translated, I also use the wpml string plugin. for the translation of estore I used your instructions and is also running correctly, except the “add to cart” and product description. But I can work around this probably by adding same product with different language, or you have any better idea? about the add to cart, see for example http://www.herbalmenplus.com/de/kaufen to get an idea what I mean.
Most simple thing would be that I could add like in ger.php WP_ESTORE_ADD_TO_CART= bla bla
March 18, 2012 at 3:53 am #43100adminKeymasterLets do this little experiment to see if we get a positive result. Open the “eStore_button_display_helper.php” file from eStore plugin and search for the following line of code:
$replacement .= '<input type="submit" value="'.WP_ESTORE_ADD_CART_BUTTON.'" class="eStore_button" />';
Once you find it change it with the following line:
$replacement .= '<input type="submit" value="'._(WP_ESTORE_ADD_CART_BUTTON).'" class="eStore_button" />';
This will output the “Add to Cart” text with the marker that your language translation plugin should be able to pick up and translate.
March 18, 2012 at 2:07 pm #43101AncadeMemberIt’s not picking up add to cart, I’m not sure how to do this, but seen with gettext, you need to mention the plugin name ex. _(link, pluginname), I’m no programmer and tried all kinds of things to get the pluginname in the sentence but no luck, maybe you can help me out?
March 18, 2012 at 7:05 pm #43102AncadeMemberYour suggestion worked, after I figured out why it didn’t work, I was using _ instead of __ , I would like to do the same for product description, which php file and statement can I find it?
March 19, 2012 at 4:12 am #43103adminKeymasterOkay good. For the description section do the following:
Search for the following line of code in the “eStore_misc_functions.php” file then change it to what is necessary (there will be two occurrences):
$output .= html_entity_decode($ret_product->description, ENT_COMPAT,"UTF-8");
March 28, 2012 at 2:54 pm #43104AncadeMemberBeen trying to get it right, but doing something wrong. I looked up both statements, and change it to $output .= __(html_entity_decode($ret_product->description, ENT_COMPAT,”UTF-8″));
But not getting the string to translate, could you please help me out?
March 29, 2012 at 5:11 am #43105adminKeymasterTry a simpler expression like the following first:
$output .= __($ret_product->description);
March 29, 2012 at 6:48 pm #43106AncadeMemberif I understand it correctly, you mean change:
$output .= html_entity_decode($ret_product->description, ENT_COMPAT,”UTF-8″);
into
$output .= html_entity_decode(__($ret_product->description), ENT_COMPAT,”UTF-8″);
?
March 30, 2012 at 1:07 am #43107adminKeymasterI should have been more clear. I meant the following:
Change the following line
$output .= html_entity_decode($ret_product->description, ENT_COMPAT,"UTF-8");
to the following:
$output .= __($ret_product->description);
November 2, 2013 at 1:48 pm #43108Ludovic BMemberSame problem, and the solution above does not work.
I’m using eStore (7.0.0)+ WPML.
I chose the i18n setting, on a french/english website.
But my eStore front-end texts, translated by me in WPML, are not taken into account, and only the texts from wp-cart…/languages/fr.php are shown on the front-end – which is not a problem, except for the “Add to Cart” button in text mode, which is absent from the fr.php.
So my first question is :
What line looking like
define(“ESTORE_*****”, “*****”);
should I add to the fr.php file ?
And my second question is :
How can I send my visitors to the appropriate linguistic versions of the checkout/terms/return/cancel/thank-you pages of the general settings of eStore, according to the language parameter (defined by WPML) of the page the visitor was on ?
(My website is accessible in two versions:
– all the english pages at the .com/… pages
– all the french versions at the .com/fr/… pages)
November 3, 2013 at 11:45 pm #43109adminKeymasterTry the tweak mentioned in this post:
https://support.tipsandtricks-hq.com/forums/topic/multilanguage-support/page/2#post-28521
-
AuthorPosts
- You must be logged in to reply to this topic.