How to set 0 quantity if not present in CSV



  • I already read this from @zimmer-media but I think that is a little dangerous to set 0 quantities to the whole inventory and then set again the right quantity from the CSV import.

    In PS forum I found this.

    do you know some smarter solutions?





  • Not directly, but it will be supported soon.

    Meanwhile, I can offer this workaround:

    1. Preparation step - create custom field named Imported Quantity for products (or combination)

    Then:

    1. run Mass Update that will reset Imported Quantity field to zero for every product
    2. run Import that will import data into this new custom field Imported Quantity, instead of build-in quantity field
    3. run Mass Update that will copy data from Imported Quantity to standard quantity field

    If you run these 3 steps in sequence you’ll get wanted results. Unfortunately, datakick module does not support task sequencing at the moment. But you schedule these task to run at specific times. For example, you can schedule first mass update to run at 10:00, import at 10:05, and copy data task at 10:10 (or maybe later, depending on how long does it take to import data)



  • … one more thing - my module does not support csv import yet, only xml 🙂



  • This is how i handle it, We have a shop with a POS system what is the main inventory. For update the Thirtybees inventory set quantities of the whole DB to zero.
    In the Db run Query “Before testing make backup of the DB!!!”

    UPDATE tb_stock_available SET quantity=0; UPDATE tb_stock SET physical_quantity=0; UPDATE tb_stock SET usable_quantity=0

    After that i upload the CSV with the new stock. Don’t forget to rebuilt the index. PREFERENCES/SEARCH



  • @datakick said in How to set 0 quantity if not present in CSV:

    Not directly, but it will be supported soon.

    Meanwhile, I can offer this workaround:

    1. Preparation step - create custom field named Imported Quantity for products (or combination)

    Then:

    1. run Mass Update that will reset Imported Quantity field to zero for every product
    2. run Import that will import data into this new custom field Imported Quantity, instead of build-in quantity field
    3. run Mass Update that will copy data from Imported Quantity to standard quantity field

    If you run these 3 steps in sequence you’ll get wanted results. Unfortunately, datakick module does not support task sequencing at the moment. But you schedule these task to run at specific times. For example, you can schedule first mass update to run at 10:00, import at 10:05, and copy data task at 10:10 (or maybe later, depending on how long does it take to import data)

    In this way, I have to update every product every time.

    I found a relative simple shell solution to compare two ordinated CSV and then have as output a CSV only NO MORE AVAILABLE products (and a simple shell script that convert CSV to XML)… but if actually, datakick module can’t do it directly I think that Imported Quantity solution can be good.

    About datakick docs I can see editable quantity here, or is only a limit about put to 0?

    @kleijn36 said in How to set 0 quantity if not present in CSV:

    This is how i handle it, We have a shop with a POS system what is the main inventory. For update the Thirtybees inventory set quantities of the whole DB to zero.
    In the Db run Query “Before testing make backup of the DB!!!”

    UPDATE tb_stock_available SET quantity=0; UPDATE tb_stock SET physical_quantity=0; UPDATE tb_stock SET usable_quantity=0

    After that i upload the CSV with the new stock. Don’t forget to rebuilt the index. PREFERENCES/SEARCH

    I know that can be a solution but I would like to avoid to write directly in the DB. Thank you anyway… I will use it as a last resort.


 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.