Question

Currently nop 2.x is supporting excel import by product only. For example, if I have inventory based on products by size, I cannot upload inventory based on that. I have 22 size 10 Hatties and not 22 Hatties for example.

Is there a fix to this in nop or upgrade path for this? We cannot update inventory via excel at the moment and it becomes extremely tedious to do this individually through the GUI for customers.

Was it helpful?

Solution

I got around this in my instance by making my own ImportService based on the original.

This all occurs in the ImportProductsFromXlsx function:

  • First, add the VariantName and VariantDescription columns to your list of properties
  • Move the Product product = new Product(); line outside of the while(true) loop
  • Load the values for the VariantName and VariantDescription like all of the other columns do it
  • If the name of the Product is exactly the same as the product you imported on the previous row, don't create a new product, just use the one you already have on the new ProductVariant
  • at the end of the loop, set the product to the current row's Product

There will be some tweaking to do there. I would have dumped my function here but I moved away from that process. If all your ProductVariants are next to each other in the Excel file and the Product name matches, you should be able to get multiple variants on one product with little hassle.

I'm on version 2.3

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top