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 :-)

CommentFileSizeAuthor
Commerce 2.x ER Diagram.png210.27 KBkunalkursija
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kunal.kursija created an issue. See original summary.

kunalkursija’s picture

Please note this was created by referring 'Alpha 4' release of this drupal commerce 2.x.

finne’s picture

Hi,

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.

drugan’s picture

Great 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.

finne’s picture

I updated dx-experts.nl/commerce-2-entity-relations. It now includes Shipping.

SpartyDan’s picture

The link in #5 is not working.

I believe that this is the new link:
dx-experts.nl/commerce-2-entity-relations-including-shipping

mortona2k’s picture

mglaman’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.