outblast Posted July 17, 2011 Share Posted July 17, 2011 I need a module to update product price from a csv. file by the reference number (product code) not by id.TXS! Link to comment Share on other sites More sharing options...
outblast Posted July 17, 2011 Author Share Posted July 17, 2011 I found the answer on Español forum, works on 1.4 version but the problem is that deletes the missing fields for example if i don't put the description, suplier, producer... in the csv. file, after update the product description, suplier, producer from the website disappears, please tell me what is wrong. TXS: in classes/product.php search for: public static function existsInDatabase($id_product) { $row = Db::getInstance()->getRow(' SELECT `id_product` FROM '._DB_PREFIX_.'product p WHERE p.`id_product` = '.(int)($id_product)); return isset($row['id_product']); } add this: public static function refInDatabase($ref) { $sql = 'SELECT id_product FROM '._DB_PREFIX_.'product WHERE reference = \''.$ref.'\''; $tab = Db::getInstance()->getValue($sql); return $tab; } should look like this: public static function existsInDatabase($id_product) { $row = Db::getInstance()->getRow(' SELECT `id_product` FROM '._DB_PREFIX_.'product p WHERE p.`id_product` = '.(int)($id_product)); return isset($row['id_product']); } public static function refInDatabase($ref) { $sql = 'SELECT id_product FROM '._DB_PREFIX_.'product WHERE reference = \''.$ref.'\''; $tab = Db::getInstance()->getValue($sql); return $tab; } in /admin/tabs/AdminImport.php search for: if ($product->id AND Product::existsInDatabase((int)($product->id))) { $datas = Db::getInstance()->getRow('SELECT `date_add` FROM `'._DB_PREFIX_.'product` WHERE `id_product` = '.(int)($product->id)); $product->date_add = pSQL($datas['date_add']); $res = $product->update(); } add this before the above code: if ($product->reference AND Product::refInDatabase($product->reference)) { $product->id = Product::refInDatabase($product->reference); } should look like this: if ($product->reference AND Product::refInDatabase($product->reference)) { $product->id = Product::refInDatabase($product->reference); } if ($product->id AND Product::existsInDatabase((int)($product->id))) { $datas = Db::getInstance()->getRow('SELECT `date_add` FROM `'._DB_PREFIX_.'product` WHERE `id_product` = '.(int)($product->id)); $product->date_add = pSQL($datas['date_add']); $res = $product->update(); } 1 Link to comment Share on other sites More sharing options...
animeandtoystore Posted September 7, 2011 Share Posted September 7, 2011 Have you found a solution? Need it too Link to comment Share on other sites More sharing options...
Kerm Posted September 7, 2011 Share Posted September 7, 2011 In SVN version 1.4.5.0 they made that thing u want, try. Link to comment Share on other sites More sharing options...
outblast Posted September 7, 2011 Author Share Posted September 7, 2011 great, ty for info Link to comment Share on other sites More sharing options...
philee Posted September 8, 2011 Share Posted September 8, 2011 Have you found a solution? Would be fantastic if we had the ability to update the quantity by supplying a suppliers reference value and quantity value. Link to comment Share on other sites More sharing options...
Mike Kranzler Posted September 8, 2011 Share Posted September 8, 2011 Hi philee, Have you tried the SVN version yet? -Mike Link to comment Share on other sites More sharing options...
Bewitching Posted September 12, 2011 Share Posted September 12, 2011 Mike, I copied the classes/products.php from the SVN and dropped it in 1.4.4, and I am not seeing any change in what the import is requiring. It still says " Name* " (required). Neither Reference #, nor Supplier reference # have the asterisk. Is there something I am missing ? Thanks, Kathleen Link to comment Share on other sites More sharing options...
Mike Kranzler Posted September 12, 2011 Share Posted September 12, 2011 Hi Kathleen, The SVN version is not for public use, which means you won't be able to use it in your current storefront. However, we're planning to release it around the end of November, at which point you will be able to use this feature on your live store. If you would like to test it out now, you'll need to do a local install of the SVN version just to test out on your own until it is officially released. -Mike Link to comment Share on other sites More sharing options...
Bewitching Posted September 12, 2011 Share Posted September 12, 2011 Thanks for the quick reply Mike. Without this feature, updating stock quantities is impossible ! LOL I can't see deleting my entire stock & uploading a fully loaded csv, just to change stock quantities. Link to comment Share on other sites More sharing options...
Mike Kranzler Posted September 12, 2011 Share Posted September 12, 2011 That's why we've worked to add it, you're not the only one who feels this way -Mike Link to comment Share on other sites More sharing options...
Bewitching Posted September 12, 2011 Share Posted September 12, 2011 That's why we've worked to add it, you're not the only one who feels this way -Mike Thank you !!!!! This is the ONLY feature I find lacking. Everything else is top-notch !! Link to comment Share on other sites More sharing options...
Shhhh Posted January 24, 2012 Share Posted January 24, 2012 That's why we've worked to add it, you're not the only one who feels this way -Mike Hi Mike, Any news on that feature? I'm on 1.4.5 and it still deletes all missing info. Thanks Link to comment Share on other sites More sharing options...
Rolige Posted January 24, 2012 Share Posted January 24, 2012 Interesting modification. I think it should work in ps 1.4.6.2, the fields name is the same Link to comment Share on other sites More sharing options...
cristi.ionita Posted May 28, 2012 Share Posted May 28, 2012 (edited) This feature is still missing, and i don't see why is this marked as [sOLVED] It still deletes all missing info on Prestashop Version: 1.4.8.2. Very frustrating! Did anyone find a way to update product prices based on Product reference? Edited May 28, 2012 by cristi.ionita (see edit history) Link to comment Share on other sites More sharing options...
rseigel Posted August 6, 2012 Share Posted August 6, 2012 I need this as well. It amazes me that this hasn't been implemented in the core yet. Will this be included in 1.5? Link to comment Share on other sites More sharing options...
Recommended Posts