[checkout] Hitting "return" empties the cart

picdude

Joined: 2006-06-13
Posts: 176
Posted: Fri, 2013-04-19 18:22

Gallery URL = http://www.photosbybailini.com/g2/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.9 cgi-fcgi
Webserver = Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Database = mysqlt 5.0.96-community, lock.system=flock
Toolkits = Gd, ImageMagick
Acceleration = partial/3600, partial/3600
Operating system = Linux server1.photosbybailini.com 2.6.32-042stab063.2 #1 SMP Tue Oct 23 16:24:09 MSK 2012 x86_64
Default theme = carbon
gettext = enabled
Locale = en_GB
Browser = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 Safari/536.28.10
Rows in GalleryAccessMap table = 2176
Rows in GalleryAccessSubscriberMap table = 144038
Rows in GalleryUser table = 439
Rows in GalleryItem table = 144035
Rows in GalleryAlbumItem table = 4952
Rows in GalleryCacheMap table = 287787

Hello,

While tweaking my checkout for the upcoming season, I noticed that after adding an item to the cart and selecting a product, if someone (a customer) hits "return" after entering a quantity, it empties the cart. Is there a way of changing this so that hitting "return" updates the cart instead of emptying it?

My gut is telling me that this is simply due to the position of the buttons at the bottom. If "save changes" was before "empty cart", might it work? Can I swap the placement of these buttons...??

Thanks!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2013-04-20 21:46

so is the empty/reset cart button highlighted by default?

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
picdude

Joined: 2006-06-13
Posts: 176
Posted: Mon, 2013-04-22 14:48

That's what I'm guessing, suprsidr, but it's not obvious by looking at it.
The buttons along the bottom right of the basket are (from l-r) "empty cart", "save changes", and "continue to checkout". The "continue shopping" button is below those three. I think the "empty cart" button is the default. Can the default be changed to "save changes"?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2013-04-22 15:50

It would be best to set an onChange event on the select product action to highlight the save changes button.
I'm on vacation in the Caribbean ATM if you cannot figure it out by yourself I can help next week.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
picdude

Joined: 2006-06-13
Posts: 176
Posted: Mon, 2013-04-22 15:57

Enjoy your vacation!
Since I don't have a clue what you're talking about, I'll be in touch next week.
I'd like to revisit the T&C thing that we talked about last year too.

Thanks!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2013-04-22 16:27

Correct me if im wrong suprsidr, but I thought that the first submit button in the form is the default "enter" button?
I guess some JS solution would work but I think if moving the button in the template should work as well.

picdude try:
gallery2/modules/checkout/templates/Select.tpl
move

      <tr>
        <td align="right">
          <input type="submit" class="inputTypeSubmit checkoutButton checkoutShoppingButton1" name="{g->formVar var="form[action][continueshopping]"}" value="{g->text text="Continue Shopping"}"/>
        </td>
      </tr>

to just below
<table class="checkoutButtonTable" width="100%">
Should make the 'continue shopping' button be the default leaving the carts contents.

Enjoy the sun and sand.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
picdude

Joined: 2006-06-13
Posts: 176
Posted: Mon, 2013-04-22 17:16

Success!!

I found the "button" section in that template you directed me to, floridave, and just moved the "save changes" line to the top.
Like this:

{* ----------- Buttons ----------- *}
<div class="gbBlock">
<table class="checkoutButtonTable" width="100%">
<tr>
<td align="right">
<input type="submit" class="inputTypeSubmit checkoutButton checkoutSaveButton" name="{g->formVar var="form[action][savechanges]"}" value="{g->text text="Save Changes"}"/>
<input type="submit" class="inputTypeSubmit checkoutButton checkoutEmptyButton" name="{g->formVar var="form[action][emptycart]"}" value="{g->text text="Empty Cart"}"/>
<input type="submit" class="inputTypeSubmit checkoutButton checkoutContinueButton1" name="{g->formVar var="form[action][continue]"}" value="{g->text text="Continue to Checkout"}"/>

Easy as pie once I knew which template to modify. Couldn't find it on my own...

Thanks floridave and suprsidr for your help!!