One of the key things a Drupal newbie realizes very late in the cycle is the fact that when you add any module or feature to your site, it comes with it's own Entities, Fields and probably Reference. Drupal Commerce is no different.
It is extremely important to understand what the various pieces of Drupal Commerce are, before trying to figure out how it all works. So this article covers the various entities, fields and references there are in Drupal Commerce.
The figure below explains all the fields and entities that are part of the Commerce Kickstart.
The Product Definition, Creation and Display is segregated into backend components and frontend components in Drupal Commerce. Much of this has been done to add flexibility on the front end display of the product. Other reasons are very well explained on the Drupal Commerce website.
Product Type defines the Product. It includes fields that show up when creating Products. So if your product
contains an Image, a Price, different Sizes or Colors or Stock levels (through the Commerce Stock module) or anything else that you want to show up on your product , you will set it up here.
If you want your product to have multiple images, you will set the VALUES field to UNLIMITED in the IMAGE SETTINGS. Likewise, if your product has multiple COLOR or SIZE options, those are also configured here.
However, if you want a particular field to function as an attribute field on the Add to Cart forms, then the NUMBER OF VALUES must be set to ONE. Say you have your product available in 3 sizes and 5 colors and 2 styles. Then the widget to choose would be a SELECT-LIST and the NUMBER OF VALUES to set would be ONE.
When we create Products, the Product is of the type specified in the "Product Type". You may have as many product types on your catalog as you like. Every product is unique. This means that every unique product will have it's own price, color, image, size or style if these are the fields defined for it in the Product Type.
Product Reference is a reference field added by the Commerce module. When we create the Product Display for the product, the PRODUCT REFERENCE is used to refer to the Product. The Product Reference is also used to refer to the Product(s) in the Line Item Entity when products are added to the cart.
The Line Items are referenced by the LINE ITEM REFERENCE in the ORDER. Each line item is treated separately in the Order.
The Customer Profile Entity refers to the Profile of the Customer that is stored in Drupal Commerce. This contains details such as the billing address, the shipping address etc of the Customer. The Order Entity references the Customer Profile Entity through the Customer Profile Reference field.
The Payment Transaction Entity refers to the how payments work on the Drupal Commerce Site. This is an independent Entity.
It is important to just know what ENTITIES and REFERENCES are there in Drupal Commerce. Hope you found this useful. Do leave your suggestions and comments. Thanks.
No comments:
Post a Comment