1

I'm wanting to add a custom form field to the DC cart page - not the add to cart page but the cart page. It wants to be specific to the cart rather than specific to individual line items which will then save to the order information to be available later. I've looked at dozens of questions and answers on the internet and done some digging of my own and haven't figured out even what would be the right hook to use. Any suggestions?

1

Use hook_form_alter() on its form ID. The form is built via Views, and I can't recall the ID off the top of my head, but any time I don't know the ID to use I just use a general hook_form_alter() and print out the form ID of every form on the page. You'll find it fast.

Depending on the type of data you're collecting and how you need it stored, it could be that you add a field to the base order type and then populate it based on the value of whatever field you add to the shopping cart form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.