I am trying to set a data type for Grocery Items. Where the item can be sold at multiple stores, however, each store can charge any price they like. So my question is how do make the price relative to the store?
You need to create a datatype that links the Grocery_Item with the Store…
That data type will also contain the price that store charges, as well as any other data about that item which is specific to that store.
I have the a Store Data Type’ Name linked to the Grocery Items’ Grocery Store. Is that what you mean?
In the below screenshot, I am able to list multiple stores and multiple prices. But how do I indicate which price corresponds with which store?
You need a 3rd datatype that links a Store to a Grocery Item so that you can store specific data about that item for that store (such as the price)…
So created a new datatype (call it something like store_item), with (at least) the following 3 fields:
- Store (of type Store)
- Grocery Item (of type Grocery Item)
- Price (of type number)
Would these be lists?
No, just single items.
Ok I did what you suggested but I’m thinking that this not much different than just creating duplicate Grocery Items for each store?
What was trying to accomplish was simply add and item to a store as new stores are added or remove a store if a store stops selling it, and of course reflect the price the store wants?
Also in this scenario, I really don’t need price in Grocery Item then?
This topic was automatically closed after 70 days. New replies are no longer allowed.