Vote up!
Vote down!

How to allow a custom text attribute that the customer enters before adding to cart?

The store I'm potentially rebuilding in DC sells many personalised products. So for some of these products it is necessary to add one or more fields that could be text that the customer enters e.g. the personalised name or a select list to choose the image that will be printed on the product.

In Ubercart this is easy by adding text attribute to a product but from the docs I've read I'm not obviously seeing how this would work in DC.

It feels like this would need to be on the product variation, but that assumes the store admin is filling it out, not the customer. If it was added to the display node, then I'm presuming it wouldn't carry through to the order details?


Asked by: martinjbaker
on April 1, 2013

1 Answer

Vote up!
Vote down!

Great question, and one we get a lot!

I'd recommend this video: http://www.drupalcommerce.org/videos/demo/introduction-line-item-fields

Basically it boils down to these simple steps:

1) Install http://drupal.org/project/commerce_custom_product

2) Create a new Line Item Type

3) Add a text field

4) Edit the display settings for your Product Display's (Node, not Product Entity) product reference field so that it uses your new custom line item type

5) Maybe edit your Cart Views to show the custom text and perhaps enable drupal.org/project/editablefields to make the line item editable from within the /cart page.

Josh Miller
Answer by: Josh Miller
Posted: Apr 2, 2013