Jump to content

Import /"Not available" status


ruslan
 Share

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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 goods
2. The item that did not get in new price list should be left on site, but with "0" in quantity

So 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)

Share this post


Link to post
Share on other sites

I run a mysql query that does this outside prestashop..

looks kinda like this..

UPDATE tbl_product SET quantity=0

mine 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

Share this post


Link to post
Share on other sites

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.
:)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

to elaborate a bit on what you can do.. my query looks more like this

UPDATE 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..

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More