Jump to content

Deleting Product Combinaions on CSV Update


Recommended Posts

Hi Presta Community,

 

I'd like to update my Combinations through CSV files. Unfortunately, when I do so, Presta doesnt delete the previous combinations. 

I started looking in the AdminImportController.php, but my php knowledge is quite miserable... I can get away with it most of the time, but here it is a bit tricky for me...

I would just need some help to get on the track, I'd like to have some kind of "clear article combination before import" test somewhere, but I'm not sure where I should implement it.

 

Basically, I'd like to have some kind of "reset" on each article number (unique) for it's combinations and quatities.

For a specific article, I just get a CSV with the available combos, so depending on wat was ther before, it stays in the database. 

Here could be an example: a shirt, gray or white, in L or XL. Say four of each.

When I update per CSV, I only get the info that L in grey or white is available. How to set the XL combos back to 0??

 

I'd be really grateful for any hints!!

 

Thanks,

Mathieu.

Edited by Mat_D1245 (see edit history)
Link to comment
Share on other sites

Is it for all of your products that you offer? (every product that exists in the shop)

 

If all you can select "delete all combinations" on import or execute a simple SQL query setting all stock to 0, however if it's a subset these won't work.

Link to comment
Share on other sites

Hi Daresh,

 

No, it would be way too easy...

 

I'd like to discard all combinations of the updated products, the rest can stay so. Our server has 30s timeout, so reimporting all the products+combinations takes ages!!

 

And thanks for having a look at my problem :) 

Link to comment
Share on other sites

I think it can only be done with some programming.

 

Grab the product ID's (based for example on references in the file, if you don't have ID's there), set quantity to 0 in the stock_available table, but only for those ID's, and import only after it's done.

 

Probably it would require writing a module, when you upload the file and it get's processed, or if the file is online a module with a button that you click and it sets the stock to 0.

 

If you want to delete the old combinations (not set the stock to 0) that would be a bit different.

Link to comment
Share on other sites

That was more or less my plan, I thought I could override the AdminImprtController.php to do so.

 

The thing is, that I need some help for that kind tuning, at least for the places I'd have to hack the code. I guess I could manage the rest with trial/error method. 

 

I'd be really thankful for tips or tricks on how to get it done!
 

Link to comment
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
×
×
  • Create New...