Search and display node by scanning a barcode image I am developing a new tracking system for my fashion store to have a good relationship with my returning back customers using drupal 7.
THE SCENARIO:
1) When a customer come into my store and buy some products, he/she will be given a plastic card with a barcode on it, and ask him to present this card to the cashier every time he/she visits our store.
2) When the customer will come back later and present his/her card, the cashier will scan their plastic card using a barcode scanner device attached to the computer where the drupal website is always loaded in the browser.
3) Upon scanning of the plastic card, the website will perform a quick search based on the barcode input data and return two possible actions:
First Action:(If the card was not found on the system)
Information message: This card in not registered into the system.
Second Action: (If the card was found on the system)
Display a page contain information related to the scanned card like first name, last name, last purchased items, phone number....
MY WAY OF APPROACH:
1) I created one content type VIP Customer and added to it the below fields:
Barcode field (using the barcode module)
First Name
Last Name
Phone Number
Last purchased items
....
2) Create a webform with one text field to scan the barcode . (Using webform or entityform module)
3) In order to not let the cutomers wait for the cashier to prepare the plastic card and printed out and...
All plastic cards will have to be prepared earlier and in order to do that i decided:

Create around 500 nodes of type VIP customer where the field barcode is the only field which is filled by some data.

The data filled inside each barcode field is a arbitrary mix of text and numbers just to create a barcode image for each node.

Take all of the barcode images and give them to a library in order to print the barcode images on plastic cards.

Now, I have around 500 plastic cards with barcodes printed on them and each related to a node on my drupal website and ready to be used directly.


4) When a customer will come, the cashier will take a new plastic card and scan it using a scanner reader and here the magic will happen:

The cashier will open the webform and scan the barcode on the plastic card.

The barcode scanner will input the code behind the barcode image into the text field.

Automatically when this text field is filled up with some data, a quick search will take place and find the only node which related to the scanned barcode image.

The node will be displayed to the cashier and here the cashier can edit the node to add information about the customer.

When finish, the cashier will save the node and give the card to the customer.


5) When the customer will come back later, the cashier will take the card from the customer and scan it.

The node should automatically open on the screen and the cashier can read all the information related to that customer.

PROBLEMS:

How to transfer the code from the barcode image to the text field on the webform upon scanning ?

and what is the best approach for performing the search among all nodes and pull out/display only the node related to the card being scanned.


If the above is possible with drupal I prefer to use the drupal core and contributed modules without any written custom codes.
(I am good with drupal but not good in php coding)
Thank you for your time and support.
How to transfer the code from the barcode image to the text field on the webform upon scanning?


AFAIK most of the scanners place value into focused form element (the one with the cursor in it). So make sure that field is focused when you load the page and that should cover your first question. You can probably use contrib modules (eg. https://www.drupal.org/project/focus) to achieve it without any custom Javascript.


  and what is the best approach for performing the search among all nodes and pull out/display only the node related to the card being scanned.


I think the easiest approach is to create a View with exposed filter (barcode). Then after scanning the barcode on the plastic card, you'll be one click away from a node for an existing card.