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.



  • @datakick as the products I will import will be half-dropshipping* products but sometimes I will have some products locally too, do you suggest to use warehouses or simply different suppliers to maintain the quantities precisely? datakick module can update suppliers product quantities too?

    • products are not in our warehouse but we order from the supplier asap we receive the customer order and then we drive to the warehouse and self-ship it.


  • @FooLab what do you mean by update suppliers product quantities? I’m not aware that such information is stored inside tb. We have only product / combination quantities, and then stock information for warehouses.



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

    @FooLab what do you mean by update suppliers product quantities? I’m not aware that such information is stored inside tb. We have only product / combination quantities, and then stock information for warehouses.

    Yes it’s true, I think that I need warehouses as it’s not possible to set quantities by suppliers.

    In the datakick module how can I updates warehouses stocks? I can’t find info about it in the docs and the only field I found in the demo installed in my sandbox is “quantity”.



  • @datakick is it possible or I need another import module? I would like to use datakick!



  • @foolab I’m afraid that’s not possible at the moment. Importing / adjusting stock in the warehose isn’t that trivial. It can’t be done directly, otherwise your stock movement wouldn’t match warehouse stock (and quantity on hand).

    I can investigate to see how big effort it would be to add support for stock import.



  • thank you @datakick, keep me (us) posted!



  • @datakick instead of set quantities is possible to lower or add quantities?
    In this way waiting for warehouses support I can simply lower or add by “X” value the availability during xml import?



  • @foolab not possible at the moment. You can only replace column value with the value from dataset. You can transform the input value before you store it, ie:

    input * 1.5
    

    or

    if(input='20%', 0.2,  0.18)
    

    Unfortunately it’s not possible to take current value into consideration. But it would be killer functionality, I’ve added it to the backlog



  • @datakick well with that and the warehouses support datakick module can be a very powerful killer app!

    In the meantime if I import in a custom field (“imported quantity”) and then with a a mass edit (with cron) I increase/lower the quantity do you think it can work?



  • @foolab yes, that might work.


 

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