Hello,
I'm new with posts' relationships in CRED forms so I'm not quite sure about this...
CPT1 is "Products"
A product may be supplied by one or several suppliers.
Product has a "Product Type" taxonomy.
CPT2 is "Suppliers"
A supplier may supply one or several products.
CPT3 is "Offers"
An offer is the price for one product by one supplier
In order to allow this many-to-many relationship, "Offers" is a children CPT of both "Products" CPT and "Suppliers" CPT.
For instance, I may have :
- supplier1's offer for product1 is 10$ ;
- supplier2's offer for product1 is 20$ ;
- supplier1's offer for product2 is 30$ ;
- supplier2's offer for product2 is 40$.
That structure also allows a same supplier to make various offers for the same product ; for instance :
- supplier1's offer for product1 is 10$ in winter ;
- supplier1's offer for product1 is 50$ in summer.
CPT4 is "Price Requests"
A request is a selection of the best available offers for one product.
Most requests will include several offers, and some offers will be included into several requests.
In order to allow this new many-to-many relationship, I must create CPT5, "Best Prices", which is a children CPT of both "Price Requests" CPT and "Offers" CPT.
Now, I need to be able to create a new "Price Request" (CPT4) threw a CRED form including :
1- Checkboxes : Products types (CPT1 taxonomy) I want to look into ;
2- Select : Product (CPT1) I want to look for offers ;
3- Multiselect : Suppliers (CPT2) from which I want offers ;
4- Checkboxes : Offers (CPT3) I want to set as "Best Prices" (CPT5).
So first question is : is the structure all right ? Couldn't it be simplier and/or more efficient in order to achieve what I want ?
And then, if the structure is OK, I have at least two major problems :
A- How to use a view as a checkbox into a CRED form ?
B- How to create several children posts of my main post threw the CRED form ?
Thank you very much for your kind help.