How to override limit of only 10 items showing in Create an Order page in Drupal Commerce? On the Create an Order page (/admin/commerce/orders/add), my client is not able to see more than 10 items in the dropdown when using the 'Add Line Item' for a Product.  I can see that in the commerce_product.module that the function function commerce_product_autocomplete() is limiting with the following line:

// Get an array of matching products.
$products = commerce_product_match_products($field, $instance, $tag_last, $match, array(), 10);


..but how can this be overridden? Trying to implement a change in a custom module does not seem to be read by the system. Can anyone explain why this is, and how it can be changed?

Any help is greatly appreciated. Thanks!
This should be the screen you are referring to yes?



The field here is an auto complete field that is widely used in Drupal Commerce.  And yes the hints are limited because if they were not limited then the AJAX call could take a very long time to run.  You have to keep typing to narrow down your options in the provided guesses.

Short answer: No you cannot change this without hacking Commerce.

Long answer: To change this would require a lot of work because the create order form (/admin/commerce/orders/add) is built by attaching fields from the entity. Specifically here is the code that creates the form in the image above. So in order to change this you would have to alter the field types of the order entity. Specifically the Product SKU field would have to be altered and it's call back replaced with one that would load more than 10 items.  Doing so would of course alter Commerce and any upgrade you did to Commerce would erase your alterations.

// Add the field related form elements.
$form_state['commerce_order'] = $order;
field_attach_form('commerce_order', $order, $form, $form_state);


This uses field_attach_form to attach elements to the existing form based off the entity, in this case the entity 'commerce_order'.