Contributions

Features (Category Index)
Search: 

order-drop-down-button-in-shoppingcart

Many articles here deal with the
the annoying fact, that you had to "extra" press the "update" button in your shopping-cart to update the number of products ordered. In response to this and to make my and your customers shopping easier, I have contributed this tiny, but I find extremly important module.
Here you have a drop down button to change the number of products ordered. And the number is changed instantaniously for your billing. So it cannot happen any more, that a customer forgets to press the "update" button and gets the wrong number of articles.
The number displayed in the drop down button can be changed in the your admin. ENJOY!!

Expand All / Collapse All

Side-Affects problem 21 Mar 2006

A classic problem of algorithms called side-effects was identified on this contribution. The for loop to populate the $options variable changes the value of the %i variable, that is the same of the scope outside the loop, already identified by $i. The increment ($i++) of this for loop leads to display the cart with the wrong number of items.

Solution: change the for loop initializer variable to another one.

for ($j=0 ; $j< $inventory_quantity; $j++) {

$options[$j][id] = ($j+1);
$options[$j][text] = ($j+1);
}

Fixed Bug Yu Hu 13 Oct 2004
Modification of array creation Yu Hu 11 Oct 2004
order-drop-down-button-in-shoppingcart Georg Singer 13 Sep 2003

Note: Contributions are used at own risk.