Is it possible to hide the QTY field in the cart view and make it a hidden field? All of our items would have a qty 1 so we don't want to confuse the customer.
Hide QTY field in cart
Hello,
This solution won't work well. If the customer were to click the add to cart button twice then the Quantity will be two but there will be no way for them to take it back to one, unless the customer removes the item from their cart. I smell a feature request here: ability to limit the number of times an item can be added to a cart.
Scott
Well, that's a different question, isn't it? You can limit the quantity purchased by implementing hook_add_to_cart(). See http://www.ubercart.org/docs/api/hook_add_to_cart
I think that tapir interface went away in UC2, I have made this workaround for my project, in a custom module:
<?php
function mymodule_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'uc_cart_view_form') {
//This line disables qty column
unset($form['items']['#columns']['qty']);
//This loop denies access to all qty fields for the form
foreach($form['items'] as &$item) {
if (is_array($item) & isset($item['qty'])) {
$item['qty']['#access'] = 0;
}
}
}
}
?>What about this module:
http://drupal.org/project/uc_restrict_qty
Its limits purchases to only include one of a product (if specified).






Uncheck the Qty. box at admin/store/settings/tables/uc_cart_view_table
<tr>.