I have been creating a lot of custom forms for purchase order creation and custom shipping methods, using Drupal 8's form API.
For the latest form, I needed to add an autocomplete field for user accounts that filtered by a specific role.
In the example below I only needed to show users with the role of 'Supplier'
While working on a Drupal Commerce project, I came across an interesting issue during checkout. My client’s coupon field keeps getting populated with a user’s country when they use autofill to fill out their address.
Upon working through disabling the autofill or autocomplete feature on the coupon field, the new version of Google’s browser Google Chrome ignores the autocomplete=off setting.
The solution to this problem was to update the autocomplete attribute with a string other than ‘off.’
Correct way, but ignored by Google:
I'm currently working on a custom feature for Drupal 8 Commerce 2.x, and I decided along the way that I wanted to update orders with messages. Documentation on this topic was so light that I decided to write my own post about it!
Your custom module will need to have a couple of additional files:
Defines our log categories. e.g.