starxox Posted April 12, 2010 Share Posted April 12, 2010 hi therethe fact that it is compulsory to use a product ID when importing via csv files is causing me problems with updates from my dropshipper as she does not use a product ID. This means when she makes updates I cant just upload her updated CSV on using names alone, instead I have to go through and add every product ID.I'm not sure if this is a bug because on the import screen it does not say you have to put a product ID, but if you don't it causes big problems. (like product duplication when you try and update things)Thanks Link to comment Share on other sites More sharing options...
starxox Posted April 14, 2010 Author Share Posted April 14, 2010 Anyone got any comment? Please? ) Link to comment Share on other sites More sharing options...
rocky Posted April 15, 2010 Share Posted April 15, 2010 Of course the product ID will be required. It is the only way to determine whether the product already exists in the database. I don't understand how you could decide whether to update an existing product or insert a new one without providing the product ID, unless you use another field like the reference field, but that field is not guaranteed to be unique. The product ID field is the only field in the product table that is guaranteed to be unique. Link to comment Share on other sites More sharing options...
starxox Posted April 15, 2010 Author Share Posted April 15, 2010 Thanks for the reply - well I was hoping that the reference and name would be enough - the problem is that it makes it very difficult for those of us that have lots of products and use drop shippers, to update their stores. I don't think zen cart have a product ID field so must be possible to do it without it.Thanks Link to comment Share on other sites More sharing options...
starxox Posted April 15, 2010 Author Share Posted April 15, 2010 However if I just try and use the name and reference number on the csv it duplicates the product Link to comment Share on other sites More sharing options...
rocky Posted April 15, 2010 Share Posted April 15, 2010 I'll try to come up with a solution for you. Try changing lines 533-534 of admin/tabs/AdminImport.php (in Prestashop v1.2.5) from: else $product = new Product(); to: elseif (array_key_exists('reference', $info) AND $info['reference'] != '' AND Product::getByReference($info['reference']) != false) $product = new Product(Product::getByReference($info['reference'])); else $product = new Product(); This code will check whether the reference already exists and update that product before deciding to create a new product. Link to comment Share on other sites More sharing options...
starxox Posted April 15, 2010 Author Share Posted April 15, 2010 Hi RockyI really really appreciate you taking the time to help me! Unfortunately this code doesn't seem to have worked, (tested it with a few products and they got duplicated again) any suggestions?Many thanksLouisa Link to comment Share on other sites More sharing options...
Damainman Posted June 3, 2010 Share Posted June 3, 2010 did you ever find a solution? Link to comment Share on other sites More sharing options...
Recommended Posts