Im working on a new module that will store stock levels in multiple inventory locations. What is the "best" way to store the data? Im slow to just attach and array of key/values to the product object and think I should use an entity instance for each warehouse. A few things that might effect what "best" is:

  1. need to be conflict free with existing commerce simple stock module
  2. need to be able to show individual stock locations via Field UI using conditional fields or Rules.
  3. need to be able to iterate through all of the stock location
  4. Each stock will have name, stock value, and a few other properties such as geo location
  5. List item would like to use field group to displace the multiple values with existing formatters and widgets.
  6. Commerce uses inline entity fields that might be good pattern to use
  7. I intend to be a Commerce Stock submodule and would like to leverage as much Commerce Stock functionality as possible.

I am dealing with the same question here for a 2 location store, one in the US and the other in EU. Because i also don't want to interfere with functionalities and UX of present stock validation and control modules, my thought went also to manage inventory levels in separate entities. I have this workflow/checkout in mind : - product nodes show the availibity of a product(variation) based on total stock of all inventories - after entering delivery address in checkout, shipping rates will be calculated from both inventory locations - customer will be presented a default inventory based on rate, estimated delivery time and last but not least stock level for the chosen products in that inventory.

The matter of splitting up the order comes in mind with this solution if product a is only available in EU inventory and product b only in US inventory, or when ordered quantity of product c needs to be shipped from 2 inventories.

So before thinking about setting up a multiple stock location solution, you should think about it's consequences to the workflow, especially in checkout and feasible splitting of shipping arrangements and related dues.

If you came up with something already, let me know. Hope my feedback helped you making the right choices.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.