Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quantity DropDown Box in 2.3.1


aftabn10

Recommended Posts

Posted

Hi, I was wondering if somebody can help, I have managed to install the following add-on

 

http://addons.oscommerce.com/info/7914

 

but was wondering if it is possible to change to input field to a dropdown. I am aware that I need to change the 'tep_draw_input_field' to 'tep_draw_pull_down_menu' but this then shows a dropdown but with no values.

 

Would i need to add anything into the application_top file?

 

If somebody could please help or guide me as to how I can get this changed.

 

Would really appreciate it. Thanks in advance.

  • 5 weeks later...
Posted

ok i have managed to write the following code in the product info page:

 

<?php $quantity_array = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11");?>
<?php echo tep_draw_pull_down_menu('cart_quantity', $quantity_array);?>

but when viewing this in a browser the dropdown box shows up but the values 10 and 11 show up as 1. Any ideas on where i have gone wrong.

 

Would really appreciate it if somebody could help.

Posted

Your array is lacking the value arrays inside. Try this:

 

 $quantity_array = array(
   array(
  'id' => '1',
  'text' => '1'),
   array(
  'id' => '2',
  'text' => '2'),
   array(
  'id' => '3',
  'text' => '3'),
   array(
  'id' => '4',
  'text' => '4'),
   array(
  'id' => '5',
  'text' => '5'),
   array(
  'id' => '6',
  'text' => '6'),
   array(
  'id' => '7',
  'text' => '7'),
   array(
  'id' => '8',
  'text' => '8'),
   array(
  'id' => '9',
  'text' => '9'),
   array(
  'id' => '10',
  'text' => '10'),
   array(
  'id' => '11',
  'text' => '11')
 );

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Posted

Is it possible instead of at dropdown to make so there will be one quantity box for each attributes?

In my case:

Product xxxxx one quantity box for red (attribute1) one box for orange (attribute2) one box for yellow (attribute 3) and so on.

  • 2 weeks later...
Posted

NO products adding to cart with "0" quantity - error with the Aplications_top.php code:

 

open:

catalog/includes/application_top.php

 

find:

 

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);

 

replace with:

 

<!--- BOF: Quantity Input Field mod -->

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']);

<!--- END: Quantity Input Field mod -->

 

 

THE ORIGIONAL CODE WORKS FINE -

 

CAN SOMEONE TEST THIS SO I KNOW IM NOT THE ONLY ONE.

 

NEED TO SOLVE THIS ISSUE!

 

MANY THANKS

Posted

I had originally removed the quantity box that came with osc v2.3.1 because it was listing the total amount in the product stock. If there were 20 products in stock, it would list 1-20 as the customer could select to order.

 

I added this add-on, and it only adds 1 product to the cart. I then changed 'cart_quantity' to 'product_quantity' just to see if it changed, but nothing happened.

 

I included Gemma's thing as well, but still only one product gets added.

Posted

Huh, my original post must have gotten deleted or something... anyway...

 

In my original osc 2.3.1 I commented-out the drop-down for the product quantity because it kept suggesting however many I had in stock. If I had 200 in stock for something, it would display 1-200 in the drop-down.

 

I put this one in, and it displays nicely, but it only adds one product to the cart. I also tried Gemma's suggestion, but nothing changed that I could tell.

 

I'm wondering how to get this to add the appropriate number to the cart. Thanks...

 

--------------------

 

Okay, now the original post appeared above this, so sorry for the double-post...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...