11 replies [Last post]
jdblank's picture
Offline
Bug Finder
Joined: 12/12/2007
Juice: 127

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.

TR
TR's picture
Online
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3361
Re: Hide QTY field in cart

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

<tr>.
keptin's picture
Offline
Joined: 01/04/2008
Juice: 22
Not a Good Solution

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

TR
TR's picture
Online
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3361
Re: Not a Good Solution

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

<tr>.
jdblank's picture
Offline
Bug Finder
Joined: 12/12/2007
Juice: 127
Re: Re: Not a Good Solution

Thanks. We are handling the qty limiting using hook_add_to_cart so we should be OK but I will test.

Mariano's picture
Offline
Joined: 09/04/2007
Juice: 110
Re: Re: Re: Not a Good Solution

Hi. Maybe you could try this contrib in order to limit the quantity of items.

Gergely Varga's picture
Offline
Joined: 03/05/2008
Juice: 51
this setting is not available anymore?

Hi, am I wrong or this option is not available in Ubercart 2 (RC1) anymore?
Could anyone tell me how can I remove the Qty. field from the cart/ ?

Thanks in advance, G

I really like lemonade.
42droids.co.uk

Gergely Varga's picture
Offline
Joined: 03/05/2008
Juice: 51
Re: this setting is not available anymore?

nobody? please.. Smiling

I really like lemonade.
42droids.co.uk

pcambra's picture
Offline
Bug Finder
Joined: 01/23/2008
Juice: 251
Re: Re: this setting is not available anymore?

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;       
      }
    }  
  }
}
?>
Gergely Varga's picture
Offline
Joined: 03/05/2008
Juice: 51
Re: Re: Re: this setting is not available anymore?

Thank you, pcambra. I also got this workaround, but I thought there must be an "easy" way to do this. Via the admin area?
Anyway I think I can live with this... Smiling Thanks for your help again.

I really like lemonade.
42droids.co.uk

univate@drupal.org's picture
Offline
Getting busy with the Ubercode.
Joined: 03/27/2009
Juice: 465
Re: Re: Re: Re: this setting is not available anymore?

What about this module:
http://drupal.org/project/uc_restrict_qty

Its limits purchases to only include one of a product (if specified).

gtothab's picture
Offline
Joined: 03/26/2009
Juice: 58
Re: Re: Re: Re: Re: this setting is not available anymore?

Yep thats an awesome mod. I just got it and it did the trick for me

THX