Ultimate SEO Urls

Template bug with hreflang module - Ultimate SEO Urls

Template bug with hreflang module

by Piernas » Thu Jul 28, 2022 1:48 pm

I have found that the hreflang module is breaking the template, causing right column to stay there even if there are not boxes installed. replacing includes\modules\header_tags\ht_hreflang.php content with the following fixes the problem.

Please uninstall module before replacing file.

Code: Select all

<?php
  /**
  *
  * ULTIMATE Seo Urls (version 3.0.5)
  *
  * @license http://www.opensource.org/licenses/gpl-2.0.php GNU Public License
  * Copyright 2021 JMC
  * Portions Copyright 2008-2009 FWR Media, 2005 Bobby Easland
  * @Id  path_rewrite.php
 */

  class ht_hreflang  extends abstract_executable_module {
    const CONFIG_KEY_BASE = 'MODULE_HEADER_TAGS_HREFLANG_USU_';

    public function __construct() {
      parent::__construct(__FILE__);
    }

    function execute() {
      global $oscTemplate, $lng;
      $alternate ="";
      if (USU_ENABLED == 'True') {
        hreflang::i()->initiate($_SESSION['navigation']->path);
        $pages_array = array();
        foreach (hreflang::i()->lang_array() as $lang_array) {
          $alternate .= '<link rel="alternate" hreflang="' . $lang_array['code'] . '" href="' . $lang_array['href'] . '" />' . PHP_EOL;
          if ($lang_array['code'] == DEFAULT_LANGUAGE) {
            $alternate .= '<link rel="alternate" hreflang="x-default" href="' . $lang_array['href']  . '" />' . PHP_EOL;
          }
        }
//        echo $this->group;
        $oscTemplate->addBlock($alternate, $this->group);
      }
    }

    protected function get_parameters() {
      return [
        $this->config_key_base . 'STATUS' => [
          'title' => 'Enable Robot hreflang Module',
          'value' => 'True',
          'desc' => 'Do you want to add the module to your shop?',
          'set_func' => "tep_cfg_select_option(['True', 'False'], ",
        ],
        $this->config_key_base . 'SORT_ORDER' => [
          'title' => 'Sort Order',
          'value' => '110',
          'desc' => 'Sort order of display. Lowest is displayed first.',
        ],
      ];
    }
  }
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact: