Hi Guys,
As a developer i had to dig deep into tables to understand the entity relation in commerce 2.x. It really took me some time to figure it out.
So I have created a Entity Relationship Diagram which if accepted can be included in official documentation. This would be helpful for new developers to understand commerce 2.x.
Please have a look on diagram. Attaching PNG.
Also, Do correct me if i have mentioned incorrect relations anywhere.
NOTE :
I did not understood much about the relation between "COMMERCE_PRODUCT_VARIATION" & "COMMERCE_PRODUCT_ATTRIBUTE_VALUE" via config factory.
It would be helpful if somebody solves the mystery for me :-)
Comment | File | Size | Author |
---|---|---|---|
Commerce 2.x ER Diagram.png | 210.27 KB | kunalkursija |
Comments
Comment #2
kunalkursija CreditAttribution: kunalkursija at Iksula, Blisstering Solutions commentedPlease note this was created by referring 'Alpha 4' release of this drupal commerce 2.x.
Comment #3
finneHi,
I also made diagram, using the beta 4 release. See https://www.dx-experts.nl/commerce-2-entity-relations
This could also be used in the docs, if needed.
Comment #4
drugan CreditAttribution: drugan as a volunteer commentedGreat work! The diagrams will definitely help drupalcommerce newcomers to figure out how it works. And not only newcomers - firstly I've looked into the system six months ago and still learning it.
As for the correlation between "COMMERCE_PRODUCT_VARIATION" & "COMMERCE_PRODUCT_ATTRIBUTE_VALUE" via config factory I think there is no one. It's just a human friendly mechanism to facilitate a choice for admins when they add variations to a product and for customers to select a desirable variation of a product. With the help of attribute value(s) (their unique IDs combination) the machine finds the variation ID and builds user facing title and if the value(s) or their number will change on a particular variation it does not change the variation itself (its ID). Just title will change but it has no any sense for the machine, so no config for attribute values is found.
Comment #5
finneI updated dx-experts.nl/commerce-2-entity-relations. It now includes Shipping.
Comment #6
SpartyDan CreditAttribution: SpartyDan as a volunteer commentedThe link in #5 is not working.
I believe that this is the new link:
dx-experts.nl/commerce-2-entity-relations-including-shipping
Comment #7
mortona2k CreditAttribution: mortona2k commentedComment #8
mglamanThese are also starting to be documented here https://docs.drupalcommerce.org/commerce2/developer-guide/core/relations...