Commerce Product Dimensions
Categories
Component ID
2246927
Component name
Commerce Product Dimensions
Component type
module
Maintenance status
Development status
Component security advisory coverage
covered
Downloads
1947
Component created
Component changed
Component body
A line item entity to allow customers to input the length, width and height of products if they were setup accordingly.
- Enable the module
- Create a line item type
- Go to Admin / Store / Configuration / Line item types
- Click on "Add a line item type for products with dimensions"
- Provide a name and select the dimensions this line item type should support
- Save
- Create a product
Skip this step if you're using inline entity form (https://drupal.org/project/inline_entity_form)
- Go to Admin / Store / Products
- Click on "Add a product"
- Fill in all fields and save
- Create a content type
- Go to Admin / Structure / Content types
- Click on "Add content type"
- Provide a name and click on "Save and add fields"
- Add a new field of type "Product reference" and use a widget that suits your needs. In the settings either select the previously created product or - if your using inline entity form - the referenced product gets created automatically
- Click on "Manage display"
- For the field with your product reference click on settings and in the field "Add to Cart line item type" select the line item type that you've created above
- Save
- Add a node
- Go to Admin / Content and click on "Add content"
- Provide all the details and save
Now, the product view will contain some extra fields where the customer can input their desired dimensions before they add that product to their shopping cart.
To make the dimensions also visible in the cart, you can easily edit the view configuration for the cart and add the dimension field there.
To edit the dimension field settings, go to the line item type you've created and go to "Manage Fields" there and edit the settings for the dimension field.
