Recently we created a Drupal 6 store using Ubercart 2, but we just wanted users to be able to purchase one item at a time. This posed an interesting, but not insurmountable, problem.
The main issue here is that by default, the user may visit his or her shopping cart and choose any quantity of items. In order to restrict the user to force him or her to just buy one, we had a few options:
In the end, we utilised an Ubercart hook called hook_cart_item() which fires each time the cart is loaded. It checks the quantities of each item in the cart, and sets the quantity to 1 if it's not already 1. It's not the most elegant solution, but it does the job. Our implementation of the hook looked something like this:
It should be noted that this does not cater to the needs of the users, who will need to know that the shop imposes a 1-item limit. This will simply reset the quantity to 1 even if the user chooses more items, so unless there is a message to this effect somewhere on the site, the user might conclude that the site is not working properly.
We chose to implement a custom checkout pane with a special message to give the users some guidance, although perhaps that's a topic for an entirely separate article!


Nice snippet and perfect for my project (selling virtual files) !
Thanks

An alternative would be to use the add to cart button in a view, not showing an input field. (this is standard selectable functionality.)
When clicking the add to cart button the default amount (1) would be added to the cart.
Then use the cart block to disable or change the add to cart button much like stock check does when it notices out of stock for an item.

Nice hook thanks.
If you are not familiar with hooks like me. A hook is a piece of code that talks with another module (like Ubercart).
To use the hook you have to create your own module in Drupal.
Paste the code from Chris example into your module_filename.module and change the text mymodule to the filename you have given your module.
You can learn to create your own module in the Drupal documentation at http://drupal.org/node/206753
You can form alter the uc_cart_view_form form and change the #theme callback for the qty field for each (or any particular) item in the cart.
In your custom theme function you then simply return check_plain($element['#value']);
That way there's no qty input box on the cart page at all.