We would like to achieve this functionality: for each order we want to associate a store and a time slot in which the product can be collected.
We also like to manage the stores and the slots available for each store in the cms (for example adding the slots to a store like you add users to a group in windows)
What would be the best way to achieve this? Storing objects in Business Foundation or dynamic data storage, or is it better to have a custom database and admin tool?
Examples or pointers to the right direction are welcome :-)
Ok we found that it is possible to store the data with custom entities using Business Foundation.
The only problem is that a many to many relationship does not seem to work as we would like it to work.A "store" can have many "time slots" (in which orders can be collected) and a "time slot" can be used in many "stores".
So we would like to show an editable list of slots on the edit store Form. It could look like this:http://msdn.microsoft.com/en-us/library/Aa167285.405riordan1%28l=en-us,v=office.11%29.jpg
What would be the best way to achieve this?
You'll want to extend the PurchaseOrder to persist a 'store' and 'collection date': https://world.optimizely.com/documentation/developer-guides/commerce/orders/Extending-order-classes/
For managing a list of stores / available time slots, you could create a custom table in the episerver commerce database or you could store them as a cms page / blocks. Depends on how you want to surface the data with your other features.
Hello @Cedric, I would also use business foundation for creating stores. Either you can create a new entity or use existing entity Organization as store. Either way should work. However, for time slots you can use two different ways, create a custom entity as you have already created or use multi select MetaEnums. Using mutli select MetaEnums you can populate the meta enums as a multi select checkbox on your stores easily and store them accordingly. Or else create custom meta fields on your store to show all our custom entity (time slots) as multi select checkbox and while storing the data in stores, store their ids instead of creating reference between them. If you avoid using reference, then you will be able to avoid the many to many relationship problem.