Page 1 of 1

Error When Adding Manufacturer SEO Name

Posted: Sat Jul 25, 2009 5:55 pm
by Tyndie
Hi,

I have tried a few times when entering a new manufacturer to add the seo title too, but each time I receive this error:

Code: Select all

Notice: Undefined variable: manufacturer_id in /homepages/41/xx/htdocs/zzzzz/store/admin/model/catalog/manufacturer.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at /homepages/41/xx/htdocs/zzzzz/store/admin/model/catalog/manufacturer.php:7) in /homepages/41/xx/htdocs/zzzzz/store/system/engine/controller.php on line 23

Re: Error When Adding Manufacturer SEO Name

Posted: Sun Jul 26, 2009 2:19 am
by Daniel
thanks

I will fix this in the next release.

Re: Error When Adding Manufacturer SEO Name

Posted: Sun Jul 26, 2009 4:41 pm
by abmcr
In the file
admin/model/catalog/manufacturer.php
change the function addManufacturer as

Code: Select all

	public function addManufacturer($data) {
  		$this->db->query("INSERT INTO " . DB_PREFIX . "manufacturer SET name = '" . $this->db->escape(@$data['name']) . "', image = '" . $this->db->escape(basename($data['image'])) . "', sort_order = '" . (int)$data['sort_order'] . "'");
		$manufacturer_id = $this->db->getLastId();
		if ($data['keyword']) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'manufacturer_id=" . (int)$manufacturer_id . "', keyword = '" . $this->db->escape($data['keyword']) . "'");
		}
		
		$this->cache->delete('manufacturer');
	}