This post is not about the new Ubercart release but about hiding the Qty. field on the cart page. ;)
add this code to your new/old module to make the Qty. field go away.
<?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;
}
}
}
}
?>
See this issue for more info:
http://www.ubercart.org/forum/support/2483/hide_qty_field_cart
Comments
Post new comment