Zen Cart Logo
Forums / General Questions / Quantity box question

Quantity box question

Locked

Views: 3,698

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
19 Jan 2007, 11:22 PM
#1
flightoffancy avatar

flightoffancy

New Zenner

Join Date:
Dec 2005
Posts:
56
Plugin Contributions:
0

Quantity box question

I have all of my products set up to not show the quantity box in the listing but I would like for my customers to be able to update the quantities in the shopping cart.

I've attached a screenshot just in case I'm not clear on what I'm asking. Where it shows Qty and then the 1, I would like for it to have the little box where they could change the quantity and then update the cart.

Is this possible without having to turn on the quantity box in the listings?

19 Jan 2007, 11:30 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Quantity box question

There are several ways to control the quantity box ...

If you mark the Product as Hide Quantity box that is everywhere ...

If you want the quantity box in certain places not to show that can be done separately ...

How are you doing it now?

19 Jan 2007, 11:57 PM
#3
flightoffancy avatar

flightoffancy

New Zenner

Join Date:
Dec 2005
Posts:
56
Plugin Contributions:
0

Re: Quantity box question

The only place I've found (messed with) that controls the quantity box is on the page to create/edit a product.

A screenshot is attached showing the settings I have in that section.

20 Jan 2007, 12:11 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Quantity box question

That will change the setting everywhere for the product ...

If you want it only gone in some places, that setting needs to be turned OFF as in use:
Products Quantity Box Shows: Yes, Show Quantity Box

Then to turn off on the Product Listing ... you can change this in the Configuration ... Product Listing ...

Display Product Add to Cart Button (0=off; 1=on; 2=on with Qty Box per Product)
Do you want to display the Add to Cart Button?

NOTE: Turn OFF Display Multiple Products Qty Box Status to use Option 2 on with Qty Box per Product

That means also set this one to 0:

Display Multiple Products Qty Box Status and Set Button Location
Do you want to display Add Multiple Products Qty Box and Set Button Location?
0= off
1= Top
2= Bottom
3= Both

20 Jan 2007, 12:12 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Quantity box question

Note: the other 3 listings for New Listing, Featured Listing and All Listing have their own setting for:

Display Multiple Products Qty Box Status and Set Button Location
Do you want to display Add Multiple Products Qty Box and Set Button Location?
0= off
1= Top
2= Bottom
3= Both

20 Jan 2007, 12:49 AM
#6
signs avatar

signs

Zen Follower

Join Date:
Jun 2006
Posts:
128
Plugin Contributions:
0

Re: Quantity box question

Following those instructions STILL leaves the qty uneditable in the shopping cart view. I think she wants to not have the box show anywhere BUT the shopping cart, so that if a customer wants to increase qty they can just change the number in the cart rather than purchase several singles.

I tried those directions and any number of combinations, but it's either off everywhere or on everywhere. Maybe I'm not doing something right...

20 Jan 2007, 2:46 AM
#7
flightoffancy avatar

flightoffancy

New Zenner

Join Date:
Dec 2005
Posts:
56
Plugin Contributions:
0

Re: Quantity box question

^ signs said what I was trying to say.

I guess instead of trying to get wordy I should have just said ..... I want the qty box off everywhere, on all products, except for the shopping cart.

20 Jan 2007, 3:47 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Quantity box question

You would need to customize the template:
/includes/templates/template_default/templates/tpl_product_info_display.php

By copying to your templates and overrides directory and changing this function:

            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
    $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            }

What that does is force no quantity box when turned off on the Product (which you do not want to use) or in the second part, display the quantity box ...

You want both sides of the IF to not display the quantity box on the product _info so you can comment out the code and duplicate the other method with:

            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
//    $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            }

Now all of the quantity boxes are controlled by the switches or the override file and only in the shopping cart will you have a quantity box ... :smile:

/me thinks someone needs to make one more switch ... :lamo:

20 Jan 2007, 5:08 AM
#9
flightoffancy avatar

flightoffancy

New Zenner

Join Date:
Dec 2005
Posts:
56
Plugin Contributions:
0

Re: Quantity box question

Thank you Linda! That did exactly what I wanted.

20 Jan 2007, 5:09 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Quantity box question

Thanks for the update and glad that this worked for you ... :smile:

26 Jan 2007, 2:53 AM
#11
monrios avatar

monrios

New Zenner

Join Date:
Jan 2007
Posts:
1
Plugin Contributions:
0

Re: Quantity box question

Hello Linda,

I've tried all of the above and nothing seems to be working. I'm using 1.3.7 for one website:

www.asweetsurprise.com

and 1.3.6 for another:

www.myfiretees.com

The site using 1.3.6 is working without a glitch but the site using 1.3.7 is not...I've tried all combinations of turning on and off using the Admin panel as well as your new php code...Any other solutions you can provide?

Thanks

26 Jan 2007, 4:54 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Quantity box question

Compare the file from v1.3.6 and v1.3.7 ... they should be pretty identical ...

Are you using an override file on the v1.3.7 and updating the wrong file?

9 Mar 2010, 3:25 AM
#13
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Quantity box question

I'm having the opposite problem. I have quantity boxes showing on Product Info page, but NOT on the Shopping Cart Page.

Where is the option in Admin to enable it on the Cart Page?

20 Jun 2010, 9:43 PM
#14
electrobumps avatar

electrobumps

New Zenner

Join Date:
Feb 2009
Posts:
29
Plugin Contributions:
0

Re: Quantity box question

Ajeh:

You would need to customize the template:
/includes/templates/template_default/templates/tpl_product_info_display.php

By copying to your templates and overrides directory and changing this function:

        if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
          // hide the quantity box and default to 1
          $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        } else {
          // show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        }
> 
> What that does is force no quantity box when turned off on the Product (which you do not want to use) or in the second part, display the quantity box ...
> 
> You want both sides of the IF to not display the quantity box on the product _info so you can comment out the code and duplicate the other method with:
> ```php
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
//    $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            }

Now all of the quantity boxes are controlled by the switches or the override file and only in the shopping cart will you have a quantity box ... :smile:

/me thinks someone needs to make one more switch ... :lamo:

To be honest I was a little confused by the above explanation (sorry for being a little slow!.)

I tried replacing the code with both the codes above, and it doesn't seem to make any difference?

Any ideas would be appreciated.