I am migrating a site selling cheese and other products from Drupal 6 to Drupal 7. On the D6 version in the product form is the option "Default quantity to add to cart" - if you put a zero in here, no "quantity" option shows to the site visitor, but if you add a 1 then the visitor automatically gets the option to adjust this quantity. This works very well on my site since cheeses are mostly sold by weight, which I handle using attributes/options, e.g. one option for 250g at one price, another option for 500g at another price and so on. With these weight options it doesn't make sense to have a quantity as well, so "Default quantity to add to cart" is always set to zero for those. For products sold individually however (with no weight options) "Default quantity to add to cart" is set to 1 so the visitor can buy as many items as needed. On the Drupal 7 version though there seems to be no such field in the product form, only a blanket option under /admin/store/settings/products for "Display an optional quantity field in the Add to Cart form". I don't want to turn this option on because then the quantity field appears under all products including the cheeses sold by weight. How do I get the same functionality as the Drupal 6 version please?

Comments

thoughtcat created an issue. See original summary.

TR’s picture

Status: Active » Fixed

As far as I can see it works the same as it did in D6, but D6 is unsupported and I'm not going to set up a D6 site just to check. To get the behavior you want, check "Display an optional quantity field in the Add to Cart form." and save that setting. Then you can set the default quantity to 0 for a product to hide its quantity field.

Also, you should really use the latest Ubercart if you're setting up a new site. (7.x-3.x-dev or 7.x-3.10)

thoughtcat’s picture

Hi TR, thanks, that works. Sorry for the confusion, it was basically that the "Display an optional quantity field in the Add to Cart form" in product settings wasn't selected when I began the migration/building the site, which meant that "Default quantity to add to cart" didn't appear in the form for any products. Now I've turned it on in restrospect I have to go through all the products and put a zero in the cheeses that should be sold by weight. Glad to know it works though.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.