The Administrative Console Guide
Full online documentation for the WP EasyCart eCommerce plugin!
Full online documentation for the WP EasyCart eCommerce plugin!
WPML is a popular plugin that is used to convert a WordPress website into multiple languages. More information can be found at WPML’s website
Watch a short video on this section from our video library!
1. Ensure language files exist for the WP EasyCart by visiting your WP EasyCart -> Settings -> Language Editor. Read below if you need to add a language file to fit your requirements.
2. Add Languages as needed: You can add or delete language packs to ensure you are matching which languages you want to have with WPML.
3. Working with a language pack: Just select which language you would like active on your site by default and you can edit other languages by selecting them. Whichever you select will be default though.
4. Ensure the language codes match: For each, scroll down to the bottom of the page and check the language code. Make sure the language codes match, for example, WPML uses ES for Spanish and by default the EasyCart displays SP, resave after change each to match what WPML uses.
5. Be sure settings in WPML are correct. There are a lot of variables and settings in WPML, and this guide recommends you use basic installation of plugin. We always ensure that you have the URL linking for WPML set to use URL linking variable method. If you utilize other methods, EasyCart may not recognize those.
6. Add a “Store”, “Account”, and “Cart” page for each WPML language. You can click the + plus sign for each language in WPML you are allowing. In this example, you can see we have our three pages (store, cart, account) in default english. But we can edit the french and greek pages for each store, cart, account.
7. For all language pages, you should use (example is for a Spanish translation, change to match correct language code): [ec_store language=”ES”], [ec_cart language=”ES”], and [ec_account language=”ES”]
8. View your Pages: You should be able to view your store, account, or cart page and switch languages using WPML flags or dropdowns. Basic store data like add to cart buttons and phrases should all adjust based on that language pack found in our settings -> language editor.
In this example, we have English, French, and Greek flags from WPML to switch language, and you notice we are on french and see the french title of the product, french model number, and french add to cart button.
9. Translate Your Products: Throughout the product setups, you can force a translation of any text by entering a translation of each. For example, if you want a product title to be different for English and German, enter [EN]English Title[/EN][DE]German Title[/DE]. The store will translate based on the WPML language selected.
If you would like to be able to switch languages within a product, you should add the following code to your theme’s functions.php file.
add_filter('icl_ls_languages', 'wpml_ls_filter');
add_filter('icl_ls_languages', 'wpml_ls_filter');function wpml_ls_filter($languages) { if( isset( $_GET['model_number'] ) ){ global $sitepress; foreach( $languages as $lang_code => $language ){ $languages[$lang_code]['url'] = $languages[$lang_code]['url'] . '&model_number='.$_GET['model_number']; } } return $languages;} }
Note: Once you have added a language file and accessed the advanced language page, you cannot make changes to the language file directly! In order to prevent changes to language from being overwritten during an upgrade, language data is stored in your database once imported. The following instructions therefore only apply to those who need to add a new language to the system!