I am looking at a fairly complex problem (at least, so i think ;-))
I am working on a larger project that has ECK entities in a layout like this:
- Project Entity (Has an entity reference to Article)
- Article Entity (Has an entity reference to Article option AND has Dimension fields (width, height, ...))
- Article option entity
Article option contains price and quantity information.
- Article option "Pickup" has a price value of 1$ and a quantity of "per piece"
- Article option "Installation" has a price value of 25$ and a quantity of "per hour"
- Article option "Assemble" has a price value of 50$ and a quantity of "running meters" (with means that this has to be calculated)
Each project entity can contain references to multiple article entities, each containing references to multiple article option entities
We have a basic view that show all the articles of a specific project (through a contextual filter) and the options associated with each article.
Now the client is requesting to extend this view with a price line (in the view) per article option that is associated with each article in the project
So for example:
- Article A has options Install and Assemble
Then the client would like these options to be visible in the view with their calculated prices AND unit prices.
It is important to understand that we need to save the calculated values for later use in the project as well.
I was thinking on creating an additional entity like this:
- Entity Reference (unlimited values) to article options
- Entity Reference to Article entity (1value)
- Text field (unit price)
- Text field Amount (optional for "running meters" calculations)
- Text field calculated price
But this hardly seems like a nice way to do this.
All good ideas are very welcome!
Thanks so much in advance!
If any additional explanation is needed, feel free to ask!