Bruz Posted November 11, 2008 Share Posted November 11, 2008 Hi,I've got the .cvs-imort-thing working, but there's one big thing that's really bugging me: manufacturers with the same name (well, actually it is the same manufacturer) are created for every product with a different id: Product 1; Manufacturer 1 Product 2; Manufacturer 1 ... Product 100; Manufacturer 1 results in 100 manufacturers with the same name and id's from 1 to 100I really need to get this going the way it should - same name, same id! Link to comment Share on other sites More sharing options...
Bruz Posted November 12, 2008 Author Share Posted November 12, 2008 Am I the only one with that problem? I can't belive that thats only bugging me! Link to comment Share on other sites More sharing options...
Bruz Posted November 12, 2008 Author Share Posted November 12, 2008 I'm sorry, it's me again..I think I found the problem (/admin/tabs/AdminImport.php, Line 490): if (isset($product->manufacturer) AND is_numeric($product->manufacturer) AND Manufacturer::manufacturerExists(intval($product->manufacturer))) $product->id_manufacturer = intval($product->manufacturer); elseif (isset($product->manufacturer) AND is_string($product->manufacturer) AND !empty($product->manufacturer)) { $manufacturer = new Manufacturer(); $manufacturer->name = $product->manufacturer; if ($manufacturer->validateFields(UNFRIENDLY_ERROR) AND $manufacturer->validateFieldsLang(UNFRIENDLY_ERROR)) if ($manufacturer->add()) $product->id_manufacturer = intval($manufacturer->id); else $this->_errors[] = mysql_error().' '.$manufacturer->name.(isset($manufacturer->id) ? ' ('.$manufacturer->id.')' : '').' '.Tools::displayError('cannot be saved'); } There is only the check if the id exists if the value is numeric, but no check if the string exists - is it possible to add this? Link to comment Share on other sites More sharing options...
moncler Posted November 18, 2008 Share Posted November 18, 2008 Hi, I had the same problem. Simply replace in your file import your manufacturer by its ID, if there is only one it is easily done with any text editor with the replace function.Of course you have to import before the manufacturer.csv with the correct id.I do not think this is a bug in my opinion they expected to have several manufacturers with the same name. Link to comment Share on other sites More sharing options...
vdub Posted January 17, 2009 Share Posted January 17, 2009 I have just experienced the same issue. Moncler.. thanks for the explaination.. i guess it does make sense.. Link to comment Share on other sites More sharing options...
Recommended Posts