Product Import - Only Update Products

Hi,



Is it possible that in product import you only UPDATE existing products (stock) and not add new products (that are also on the csv list)



We have a store with a stocksystem, where I can extract a list of products. I just need this to keep the stock on the webshop the same as in our real store.

But in that list are 2000+ products, which of course cs cart will now add as new products, where I only want it to update existing products that are already on the webshop.



Best regards

It shouldnt add new products if the Product_code is used , it should only overwrite with any changes



JOhn

Hello Demorg,



There is no default ability to restrict adding products by the import. However if you say me the version of your CS-Cart store, I can provide you with small hook which will allow you to reach this functionality.



Thanks

If you import in products without a category, they will be added to a “Products” category. After your import, just go in and delete the category. Sure, one extra step, but pretty easy to do. You could also just disable the “Products” category and then the products can't be indexed, but are still there.



Thanks,



Brandon

Also, it is possible to do what you want. I have a store that gets a feed of over 30000 products and they only have like 3000 on the store. Basically a script runs that does:



1.) Downloads the feed

2.) Compares the feed to what is on the store by:

a.) Updates the pricing and quantity of the existing products on his site

b.) If the product exists on his site, but not on the feed, it has been discontinued, so it is put into a “discontinued” category so that he can manually go through them later.



Only the products on his store are updated. No new products are brought in. Then, to add to this, I set up a cron job to do this every 4 hours so that he can have the most up to date product info.



So, anyways, this is totally possible to do.



Thanks,



Brandon

Where did you get this script can you send it to me?



We are looking for this for quite a while.



Thanks

The script I have is very specific to the supplier I use. I'd be happy to point you in the right direction though to get what you need done. Shoot me a private message and I'll be happy to help you out.



Thanks,



Brandon

[quote name='johnbol1' timestamp='1394215274' post='178952']

It shouldnt add new products if the Product_code is used , it should only overwrite with any changes



JOhn

[/quote]



I have similar concerns. Getting our products and images in to CS-Cart has required cleaning up data and in some cases taking new photos. Even with only several thousand products this is a job we need to do incrementally as it also entails writing web friendly descriptions and key words. Our CSVs (we use two, Products and Images) will always have a Product_code (from our POS system) and my understanding is that if we just add records to the CSV files a CS_Cart record will be updated if that Product_code exists in CS-Cart and a new records will be created for any Product_Code not already in CS-Cart. My early experiments seem to bear this out but I just want to be sure, as I am at the point where I'll be adding new batches to CS-Cart and don't want to mess what's there up. Is adding incrementally good practice?

I do it all the time v 3.0.6

Thanks. What I was hoping to hear.

johnbol1,



If you would like to prevent creating new products through Import, just replace the following code in the /controllers/admin/exim.php file:



if ($object_exists == true) {
fn_set_progress('echo', fn_get_lang_var('updating') . ' ' . $pattern['name'] . ' ' . implode(',', $primary_object_id) . '. ', false);
db_query('UPDATE ?:' . $pattern['table'] . ' SET ?u WHERE ?w', $_data, $primary_object_id);
} else {




with this one:



if ($object_exists == true) {
fn_set_progress('echo', fn_get_lang_var('updating') . ' ' . $pattern['name'] . ' ' . implode(',', $primary_object_id) . '. ', false);
db_query('UPDATE ?:' . $pattern['table'] . ' SET ?u WHERE ?w', $_data, $primary_object_id);
} elseif ($pattern['pattern_id'] != 'products') {




Hope it will be helpful.