From 27faa55eb0d6e2c8f4d36013bb1a6ed89cd2add9 Mon Sep 17 00:00:00 2001 From: eduardogomez97 Date: Tue, 7 Nov 2023 08:06:35 +0100 Subject: [PATCH] fix url in default lang --- doofinder-for-woocommerce/includes/class-landing.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doofinder-for-woocommerce/includes/class-landing.php b/doofinder-for-woocommerce/includes/class-landing.php index d6fdca13..70581bcb 100644 --- a/doofinder-for-woocommerce/includes/class-landing.php +++ b/doofinder-for-woocommerce/includes/class-landing.php @@ -370,6 +370,10 @@ private function get_desired_language($languages, $hashid) { * @return string The formatted URL with the slug included. */ private function formated_url($home_url, $slug) { + if (substr($home_url, -1) != '/') { + $home_url .= '/'; + } + $slug = "df/{$slug}"; if(strpos($home_url, '?lang=') !== false) { $formated_url = str_replace('?lang=', "{$slug}/?lang=", $home_url);