Page 1 of 1

Manufactuers Link Direction Error

Posted: Mon Nov 22, 2021 7:27 pm
by Dnj1964
1.0.8.7

Clicking on a manufacturer link from the drop-down menu goes to blank page.

Turning off manufacturer_seo and it works perfect.

Error log

Code: Select all

[22-Nov-2021 19:07:45 UTC] PHP Notice:  Undefined variable: brand in /includes/modules/header_tags/ht_manufacturer_seo.php on line 21
[22-Nov-2021 19:07:45 UTC] PHP Fatal error:  Uncaught Error: Call to a member function getData() on null in /includes/modules/header_tags/ht_manufacturer_seo.php:21
Stack trace:
#0 /includes/system/versioned/1.0.7.9/osc_template.php(79): ht_manufacturer_seo->execute()
#1 /templates/default/includes/components/template_top.php(13): oscTemplate->buildBlocks()
#2 /home/naughtyp/public_html/templates/default/includes/pages/index.php(13): require('/...')
#3 /index.php(17): require('/...')
#4 {main}
  thrown in /includes/modules/header_tags/ht_manufacturer_seo.php on line 21
  

/includes/modules/header_tags/ht_manufacturer_seo.php

Code: Select all

<?php
/*
  $Id$

  CE Phoenix, E-Commerce made Easy
  https://phoenixcart.org

  Copyright (c) 2021 Phoenix Cart

  Released under the GNU General Public License
*/

  class ht_manufacturer_seo extends abstract_module {

    const CONFIG_KEY_BASE = 'MODULE_HEADER_TAGS_MANUFACTURERS_SEO_';

    protected $group = 'header_tags';

    public function execute() {
      if ((basename(Request::get_page()) === 'index.php') && isset($_GET['manufacturers_id']) && is_numeric($_GET['manufacturers_id'])) {
        $brand_seo_description = $brand->getData('manufacturers_seo_description');

        if (!Text::is_empty($brand_seo_description)) {
          $GLOBALS['Template']->add_block('<meta name="description" content="' . Text::output($brand_seo_description) . '" />' . PHP_EOL, $this->group);
        }
      }
    }

    protected function get_parameters() {
      return [
        'MODULE_HEADER_TAGS_MANUFACTURERS_SEO_STATUS' => [
          'title' => 'Enable Manufacturer Meta Module',
          'value' => 'True',
          'desc' => 'Do you want to allow Manufacturer meta tags to be added to the page header?',
          'set_func' => "Config::select_one(['True', 'False'], ",
        ],
        'MODULE_HEADER_TAGS_MANUFACTURERS_SEO_DESCRIPTION_STATUS' => [
          'title' => 'Display Manufacturer Meta Description',
          'value' => 'True',
          'desc' => 'Manufacturer Descriptions help your site and your sites visitors.',
          'set_func' => "Config::select_one(['True'], ",
        ],
        'MODULE_HEADER_TAGS_MANUFACTURERS_SEO_SORT_ORDER' => [
          'title' => 'Sort Order',
          'value' => '110',
          'desc' => 'Sort order of display. Lowest is displayed first.',
        ],
      ];
    }

  }
Thanks for looking, Doug

Re: Manufactuers Link Direction Error

Posted: Tue Nov 23, 2021 4:28 pm
by heatherbell