ruslan Posted November 30, 2010 Share Posted November 30, 2010 Please Help !)How can I make it so that when the import process is started, all the products get "Not available" status? Link to comment Share on other sites More sharing options...
rocky Posted December 1, 2010 Share Posted December 1, 2010 Do you mean you want the products hidden when they are imported, so you can check them afterwards before they are displayed online? You can use the "Active (0/1)" column to do that. Just set the value to 0 for every row in the CSV file. Link to comment Share on other sites More sharing options...
ruslan Posted December 1, 2010 Author Share Posted December 1, 2010 No, I need request, that will set "0" in goods quantity, to be performed before import starts.The reason for this is:1. Price lists come with different goods2. The item that did not get in new price list should be left on site, but with "0" in quantitySo the import process will be as following:First I set "0" in quantity for each item on site.Then price list is imported with, for example, "10" value in quantinty.So after import we will have new items added and existing items updated (either with "0" in quantity - if it is not in new price list, or with new value of quantity as in price list) Link to comment Share on other sites More sharing options...
ruslan Posted December 1, 2010 Author Share Posted December 1, 2010 please help!!! Link to comment Share on other sites More sharing options...
siadmin Posted December 1, 2010 Share Posted December 1, 2010 I run a mysql query that does this outside prestashop.. looks kinda like this..UPDATE tbl_product SET quantity=0mine is more complicated than that though. you can do this in phpMyAdmin, or with a cron script.. you will need to check what your table is called, as it probably wont be tbl_product.. if your stuck ask me and i'll gladly provide more help Link to comment Share on other sites More sharing options...
siadmin Posted December 1, 2010 Share Posted December 1, 2010 also.. i dont know how your producing your import file, but i'm sure i could cross reference your prestashop table with your suppliers data and get a single import file that fills in the qty field to 0 or 10 as needed..MySQL is good like that. Link to comment Share on other sites More sharing options...
ruslan Posted December 2, 2010 Author Share Posted December 2, 2010 where exactly should I include ('UPDATE '._DB_PREFIX_.'ps_product SET quantity = 0'); in AdminImport.php ???AdminImport.php file: http://www.prestashop.com/?ACT=29&fid=104&aid=26691_99WpWDUJ9ZIX6dCYU9bZ&board_id=1 Link to comment Share on other sites More sharing options...
ruslan Posted December 2, 2010 Author Share Posted December 2, 2010 please help!! Link to comment Share on other sites More sharing options...
siadmin Posted December 2, 2010 Share Posted December 2, 2010 You probably could put it in adminimport.php and have it work.. ..how is your understanding of php/mysql? I've done manipulations in that file and its pretty full on, i'm no expert though.i think you would add to the function productImport() ...you would have something like this at the start before any of the other product import code..$sql = "UPDATE ps_product SET quantity=0";mysql_query($sql);that way all product quantities would set to 0 before import.. If you are going to try this i would recommend creating a copy of adminimport.php.. name it adminImport_setqty.php or something like that.. then add it as a custom tab in the back office. Do your modifications in that file and leave the original alone. Make sure you back up your database before running the new file. Link to comment Share on other sites More sharing options...
siadmin Posted December 2, 2010 Share Posted December 2, 2010 to elaborate a bit on what you can do.. my query looks more like thisUPDATE ps_product SET active=1, price=tblsupplier_data.price*1.33 WHERE EXISTS (SELECT * FROM tblsupplier_data WHERE tblsupplier_data.reference = ps_product.supplier_reference) roughly.. then there's another that sets, active 0 for the same thing but 'WHERE NOT EXISTS()'then there are queries that select items from the supplier table that dont exist in the product table and exports them ready for import.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now