#STEP 1 – The background
A few days ago the FIXMAKERS team was commissioned to check the search function on the website of one of our long-time clients. He’s selling sports equipment and addressing his offer overseas. To do this, he armed his website with multi-language capacity. The benefits of such an extension are countless until you face one annoying issue. It’s when your website shows products in all languages at the same time, causing confusion among your audience. Why should they get foreign results, and be forced to decipher foreign language product descriptions in order to understand them? After all, if this hampers the e-commerce process, the buyers may not give you a second chance. With high probability, they will go to your competitor. Trust me, he already polished this step of his ordering form to a mirror shine.
#STEP 2 – The tech
It brings to the fore the classic example of more actually meaning less. More undesired products, in this case, push aside the products we want to follow and compare. For multi-language support, we picked Polylang – a free alternative to the popular WPML. Plugins like these have to meet a handful of needs. Let’s name a few.
- Enable access to new markets
- Provide better results in SEO engines
- Reach out to the new audience
- Sell more
The choice of the plugin belongs to you. Small websites will benefit from Polylang, while the complex ones may need the versatile but paid WPML. And if you’re the sort of person that loves setup wizard guidance, you’ll definitely be into WPML more. Others who don’t take any form of web aid naturally will, by contrast, appreciate Polylang. Both plugins offer content translation made through the WordPress dashboard. The mechanism is simple – when you view a page in a selected language, all posts written in it are fetched and displayed.
So why does exactly WordPress confuse content?
#STEP 3 – The fix
When your website shows content in two languages, it means that the ‘suppress_filters’ parameter has been set to true. The option applies to the theme or widget that keeps queries for shown posts. In consequence, WordPress skips custom filters that plugins use for them.
The solution is to enable multi-language plugins to have a say in querying for posts. You can do it by editing the PHP file for your theme. Open it and add ‘suppress_filters’ => false. It should look like this:
$args = array( 'post_type' =>'services', 'numberposts' => -1, 'tax_query' => $service_tax_query, 'suppress_filters' => false ); $services_posts = get_posts($args);
This will apply to the get_posts function and help show posts only for the language in use.
#STEP 4 – The Clap!
Now the checkout process flows uninterrupted. The visitors get their products in the preferred language. And the average time they spend on the website is improved. Needless to say that the longer the visit lasts, the more user engagement it entails.