Developer forum

Forum » Integration » Integration and Stock Locations

Integration and Stock Locations

Thomas Overgaard Nielsen
Reply

Hi all

I need to expand an ecom integration to list stock levels at two stock locations.
This raises a few questions. I am using the DynamicwebProvider in the import. It is clear to me, that I need to import data into at least two tables:

EcomStockLocation - Defines the possible stock locations.
What is the role of column StockLevelGroupId?
EcomStockUnit - Defines relations between Products, StockLocations, Units, and StockLevels

But where are units defined?
I only operate with one unit, and importing this from the ERP seems a bit excessive. But hardcoding the unit-ID and putting this into EcomStockUnit seems like a bad idea.

And another question: Will I need to set default unit, and a unit count on all products?
As far as I can see, the default unit is included in a hidden field in the product form and thus sent to the cart. Is this necessary if I only have one unit defined?

Final question: When I switch from one stock location (using the stock field in the simple product settings) to multiple locations .. will the former field take a value from the advanced stock management? (Perhaps a stock total) .. or just remain void?

Best regards
Thomas
 


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Thomas

The units are in a bad place - in the variantgroup and variantoption tables.

But if you use only one unit, simply hardcode it - I do not see that as a big issue.

No reason to set default unit and unit count.

Also it is not needed to include in the template as well.

Final: No - it will not. You get some loops on the products with the stocklocation and levels and when you add products to the cart, you have to tell which location you are using. I think there is a tag giving you the stock total from all locations, but not sure...

BR Nicolai

Votes for this answer: 1
 
Thomas Overgaard Nielsen
Reply

Hi Nicolai

Ah, thats why I didn't find the units. They are simply treated like a special kind of variant options :)

Okay, cool.
But does that mean, that I have to include a stocklocation field in my product form?
I think I read somewhere, that the ordered quantity is simply subtracted from the first StockLocation with a sufficient stocklevel.
I think that selection belongs to the realm of the ERP but of course if it is obligatory I can just hard code a stock location.

Thanks for the quick reply :)

Regards Thomas

 
Nicolai Pedersen
Reply
This post has been marked as an answer

You do not have to include it. You can also add a product to cart using querystring ?cartcmd=add&productid=prod1 and that does not include unit either.

Votes for this answer: 1
 
Thomas Overgaard Nielsen
Reply

Thank you Nicolai :)

 

You must be logged in to post in the forum