Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It's my first test with Drupal Commerce on D8 and came to this question: How do i add extra fields to checkout for example to get some extra information, if people buy a special product. I don't need it on product level but in checkout.
I don't find any information how to do that, so I tried "Checkout Flows" and "Order Types". I put an extra field in the default order type, but it doesn't show on cart...
I'm stuck and any help is appreciated.
Comments
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedSame way you would in Commerce 1.x, by writing a custom checkout pane.
Comment #3
krabbe CreditAttribution: krabbe commentedThank you, bojanz!
So, I guess, it has to be in a custom plugin? No backend-solution?
Is there some sort of tutorial on the web? I didn't find D8 related stuff, and still struggling with symphony and OOPs and all that...
Maybe I can learn from commerce checkout module. Where is the important part in the module files?
Comment #4
mglamanReview https://github.com/drupalcommerce/commerce/tree/8.x-2.x/modules/checkout..., this is best way to learn how to write a checkout pane.
If you're new to D8, the Plugin system has had a lot of blog posts and documentation written around it. Such as https://www.drupal.org/developing/api/8/plugins
Or, as a shameless plug, I wrote the Drupal 8 Development Cookbook which has a whole section on plugins: https://www.packtpub.com/web-development/drupal-8-development-cookbook#
Comment #5
rszrama CreditAttribution: rszrama at Centarro commented