Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Qty changed to dropdown, but initial qty still 1 unit


james_ct

Recommended Posts

Hi

 

I have change the qty text box to a dropdown list with multiples of 6 for the qty, now my problem is that when you click Buy Now on a product it takes you to your Cart but the total for that product is still only for 1 product while the dropdown list indicates 6, when you change the qty in the dropdown list then only does the total update to the correct amount, so how can i make it that the Cart will show the total as per 6 products when entering the first time?

 

Can anyone help me?

 

Cheers

James

 

Below is the code that i modified from a contibution to allow only mutiples of 6 and the dropdown list:

 

//modification start for dropdown

 

for ($i=0 ; $i<NUM_PROD_MAXORD; $i++) {

$options[$i][id] = ($i+1)*6;

$options[$i][text] = ($i+1)*6;

}

 

//modification end for dropdown

 

$info_box_contents[$cur_row][] = array('align' => 'center',

'params' => 'class="productListing-data" valign="top"',

//change dropdown

'text' => tep_draw_pull_down_menu('cart_quantity[]', $options, $products[$i]['quantity'], 'onchange="this.form.submit()" style="width: 100%"').tep_draw_hidden_field('products_id[]', $products[$i]['id']));

//end change dropdown

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...