Skip to content

Instantly share code, notes, and snippets.

@incrize
Created March 11, 2021 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save incrize/56c6e928bd053b13e1ebcfc64c35e175 to your computer and use it in GitHub Desktop.
Save incrize/56c6e928bd053b13e1ebcfc64c35e175 to your computer and use it in GitHub Desktop.
diff --git a/app/addons/seo/func.php b/app/addons/seo/func.php
index 4f870deca3..b74f5dd5b1 100644
--- a/app/addons/seo/func.php
+++ b/app/addons/seo/func.php
@@ -1310,7 +1310,6 @@ function fn_seo_url_post(&$url, &$area, &$original_url, &$prefix, &$company_id_i
$seo_settings = fn_get_seo_settings($settings_company_id);
$current_path = '';
$show_secondary_language_in_uri = YesNo::toBool($seo_settings['seo_language']);
- $original_lang_code = $lang_code;
if (empty($parsed_url['scheme'])) {
$current_path = (defined('HTTPS')) ? $https_path . '/' : $http_path . '/';
@@ -1471,14 +1470,6 @@ function fn_seo_url_post(&$url, &$area, &$original_url, &$prefix, &$company_id_i
if (!empty($unset_lang_code)) {
$parsed_query['sl'] = $unset_lang_code;
}
-
- if (
- !isset($parsed_query['sl'])
- && $show_secondary_language_in_uri
- && $original_lang_code !== $default_frontend_language
- ) {
- $parsed_query['sl'] = $original_lang_code;
- }
}
} else {
unset($parsed_query['company_id']); // we do not need this parameter if url is rewritten
@@ -3015,7 +3006,12 @@ function fn_seo_dispatch_before_display()
*/
function fn_seo_init_language_post($params, $area, $default_language, $session_display_language, $avail_languages, &$display_language, &$description_language, $browser_language)
{
- if (!empty($params['sl']) || !SiteArea::isStorefront($area)) {
+ if (
+ !empty($params['sl'])
+ || empty($params['dispatch'])
+ || !SiteArea::isStorefront($area)
+ || $params['dispatch'] !== 'index.index'
+ ) {
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment