Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

order-drop-down-button-in-shoppingcart issue


tnfno

Recommended Posts

I have installed Yu Hu's contribution for dropdown box for QTY in the shoppingcart (http://www.oscommerce.com/community/contributions,1517).

 

It works great and is much better then the original method where UPDATE has to be clicked, but I am only able to get it to work with order QTY up to 9. Any two digit numbers are blanked out. I have tried to change the array definition and manually enter numbers, and it looks like any two digit number are trunktated and only the first digit is used in the dropdown.

 

I do not have the knowledge to solve this myself, anyone who has a solution ?

Link to comment
Share on other sites

I have installed Yu Hu's contribution for dropdown box for QTY in the shoppingcart  (http://www.oscommerce.com/community/contributions,1517). 

 

It works great and is much better then the original method where UPDATE has to be clicked, but  I am only able to get it to work with order QTY up to 9.  Any two digit numbers are blanked out.  I have tried to change the array definition and manually enter numbers, and it looks like any two digit number are trunktated and only the first digit is used in the dropdown.

 

I do not have the knowledge to solve this myself, anyone who has a solution ?

 

if you can show us the code you are using, we may have a solution.

Treasurer MFC

Link to comment
Share on other sites

if you can show us the code you are using, we may have a solution.

 

OK. I have followed the instructions below. I do get the dropdown box and it works, but my customers can only order nine items per product. Any attempt to specify a hight number gives a blank dropdown box, or if I manually define the array (instead of the range definition) any number with two digits show as one, so 11 and 12 shows as two 1's in the dropdow box. SO, it lokks like there are two problems, one with the number of values maxing out at 9 and giving a blank dropdown, the other only one digit showing in the dropdown field.

 

____________

 

Changes:	
1)

----Apply the ordmaxdropdown.sql code to your shop either manually or by copy and paste to your MySQL user interface.

2)


-----In catalog/shopping_cart.php FIND the following(it?s line 115 in my installation):


 for ($i=0, $n=sizeof($products); $i<$n; $i++) {
       if (($i/2) == floor($i/2)) {
         $info_box_contents[] = array('params' => 'class="productListing-even"');
       } else {
      	 $info_box_contents[] = array('params' => 'class="productListing-odd"');
       }

       $cur_row = sizeof($info_box_contents) - 1;

       $info_box_contents[$cur_row][] = array('align' => 'center',
                                            'params' => 'class="productListing-data" valign="top"',
                                            'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));


Right before above code ENTER the following:

 

 

 //Yu Hu's modification for dropdown start

  $options = range("1", NUM_PROD_MAXORD);
 //Yu Hu's modification end



FIND the following (should be line 161):

 'text'=> tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));
 
 
and EXCHANGE BY

 //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


HOW USE IT:

Go to your admin-site and find unter configuration->Maximum Values->Number of Products to be ordered
Here you can enter the number of products, that the drop-down button in your shopping cart shall display.

Edited by tnfno
Link to comment
Share on other sites

This might help.

 

100%

 

Iggy

 

 

Have actually tried that, but it did not help. It only changes the cosmetic look slightly.

 

I believe the solution is a definition somewhere to define how many positions this field should have ? Maybe it defaults to one position so a new definition has to be inserted, but this is above my PHP knowledge.

Link to comment
Share on other sites

Have actually tried that, but it did not help. It only changes the cosmetic look slightly. 

 

I believe the solution is a definition somewhere to define how many positions this field should have ?  Maybe it defaults to one position so a new definition has to be inserted, but this is above my PHP knowledge.

 

Hmmm, that was the problem when I installed it. Have you changed the setting in admin to allow more than 9 items?

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...