Project:
UbercartCategory:
bug reportPriority:
normalStatus:
activeHi,
I'm working through some usability testing for my checkout process and I noticed that the default action when pressing enter after changing a quantity in the shopping cart is to Continue Shopping and not save the updates. Would it be possible to change the default action to update cart... or better yet, checkout (which I noticed does update the quantities)?
Best,
Chad



Re: default submit but for shopping cart
I agree with you that's the way it should work. And in both my sites (one running UC Beta2 and one running UC Beta3) "Enter" after changing a quantity is equivalent to pressing the "Update" button, like you want. What version are you using?
Re: Re: default submit but for shopping cart
Hmm, I'm using pretty recent Bazaar code. And I just checked the Livetest and it has the same issue I described above. Perhaps there was a recent code change? Or you set your sites up differently somehow?
Re: Re: Re: default submit but for shopping cart
I looked at Livetest and was able to reproduce what you saw. The difference between my site and Livetest is that my site uses the default for the "Continue shopping" link, which is to display it as a link and not as a button. Livetest displays it as a button. This can be changed at admin/store/settings/cart/edit
What appears to be happening is that when you press "Enter" in the quantity field on the form the event gets handled by the first #type=>'submit' button, which on Livetest would be the "Continue shopping" button but on my site is the "Update" button (because my "Continue shopping" isn't a button). All three of those buttons are declared as #type=>'submit', and that's the way you want it to be because no matter which is pressed you want any changes to the form to be made permanent. However, it does have the unintended consequence you brought up.
Unless someone knows a magic option in the Drupal Form API, the only way I can see to fix this is to modify theme_uc_cart_view_form() so that the markup for the "Update" button appears first on the page, before the markup for "Continue shopping". Visually, if the CSS were changed a bit the two buttons could still maintain their present positions even though they are swapped in the markup.
You should post this as a feature request on the Issue Tracker, to make sure TPTB see it.
Re: Re: Re: Re: default submit but for shopping cart
Very interesting problem... I'll see what I can do about setting the default submit button to be the update cart button. Obviously the short term fix is to use the continue shopping link instead of button, and it may just be that the long term fix is to remove the option of a button. In any event, I should be able to solve this by playing with floats.
Re: Re: Re: Re: Re: default submit but for shopping cart
So... I fixed this for buttons, but now it breaks the display for a text link. Calling all CSS heroes to check out the Livetest and tell me how to have it be nowrap and preserve the height of the control div when it's a text link (notice the border cutting through the buttons now). clear:right; doesn't work. I also tried adding in a br tag w/ the clear but it gave too much bottom padding.
Re: Re: Re: Re: Re: Re: default submit but for shopping cart
N/M Took it in a totally different direction and solved the issue/committed the fix.
Re: Re: Re: Re: Re: Re: Re: default submit but for shopping cart
Looks good. Thanks for the fix.