Home › Support › English Support › [Resolved] WPML and WooCommerce Advanched Ajax Layered Navigation plugin url problem.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: WooCommerce Multilingual
This topic contains 2 replies, has 1 voice.
Last updated by quintinA 4 years, 3 months ago.
WPML Multilingual CMS 3.8.3
WPML String Translation 2.6.2
WPML Translation Management 2.4.0
WPML Media 2.2.1
WooCommerce Multilingual 4.2.5
WooCommerce Advanced Ajax Layered Navigation 1.4.10
There's a problem using the ajax filters on translated pages, see:
I noticed the following, when i click on a filter, the URL filter parameters are added with a / in front of it:
Example: hidden link
When i remove the / the URL and all translations work fine:
I haven't investigated this problem any further but i suspect the problem lies with WOO advanched ajax layered nav, but i'm hoping WPML already encountered this problem and has a good solution ;-).
Well, maybe i should have started with my investigation before creating this post.. After a quick look at the WooCommerce Advanched Ajax layered Nav plugin the problem was quickly found.
Row: +/- 650
After collecting the correct base URL i found this line:
$link .= ( substr( $link, -1 ) == '/' ? '' : '/' );
Which basically adds a trailing slash when the base url does not end with a slash. We do not want this when using WPML ?lang= URL parameters.
Simple fix, maybe a bit dirty:
// URL WPML FIX: do not add trailing slash when lang url parameter is active
if (strpos($link, 'lang=') === false) $link .= ( substr( $link, -1 ) == '/' ? '' : '/' );
//$link .= ( substr( $link, -1 ) == '/' ? '' : '/' );
I will ask WooCommerce that they change this function to be compatible with WPML.
A quick follow up.
I've contacted Woocommerce and they created a Github feature request.
If/when it is fixed it will visible in the changelog, which can be found here: