Post by Martink » Tue Nov 24, 2009 5:02 pm

Hi All,
Hope your well.

Had a quick idea on the transition from the basket totals to the checkout "delivery information" page. Unless the user clicks on update, their quantities aren't updated. Would it be possible to have it so that onmouseout of the quantity feild the form is submitted (the same as clicking update).

Has anyone else done this? Did it work out ok? Have had a look through the forums and not seen any sign of it yet.

Just done an install for a client that uses quantity as the length of material that they sell. This works fine and seems to be the only way as the lengths are different from order to order. However, this does mean that they are likely to play round with the quantities.

All the best,
Martin.

Newbie

Posts

Joined
Fri May 15, 2009 10:04 pm

Post by i2Paq » Tue Nov 24, 2009 10:56 pm

I like to see this to.

As soon as you updated the quantity it gets autoupdated.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Tue Nov 24, 2009 11:36 pm

Easy...
For all versions (1.4.x, 1.5.x, 2.x)...

1. EDIT: catalog/view/theme/YOURTHEME/template/checkout/cart.tpl

2. ADD AT THE BOTTOM BEFORE THE "$footer" LINE:

Code: Select all

<script type="text/javascript">
$("input[name^='quantity']").change(function() {
    $("input[name^='quantity']").closest('form').submit();
});
</script>

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Thu Dec 31, 2009 10:15 am

did anyone ever find this useful?

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by i2Paq » Thu Dec 31, 2009 6:50 pm

Qphoria wrote:did anyone ever find this useful?
Do I add this below: <?php echo $footer; ?> ?

Edit: I just put it there and it works.

Nice find and very usefull.
Should be default in the cart!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Moggin » Sun May 16, 2010 12:34 am

i2Paq wrote:....Nice find and very usefull.
I agree - many thanks, Qphoria. Works in 1.4.7 too.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by Moggin » Tue Jun 15, 2010 12:37 am

...and half way to working in 1.4.8b. Updates the quantity, but doesn't act on 'remove' field.
Would love an update to this neat tweak! :) And i2Paq's right: would also be a good default feature in the cart

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by Qphoria » Wed Jul 14, 2010 10:47 pm

Moggin wrote:...and half way to working in 1.4.8b. Updates the quantity, but doesn't act on 'remove' field.
It was never designed to do that... but its easy to add

change:

Code: Select all

$("input[name*='quantity']")
to just

Code: Select all

$("input")

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Maansy » Wed Jul 14, 2010 10:57 pm

thanks Q. its so useful as customers might assume since they added the # of quantity they are all set for checkout not knowing they have to click update.
good work
IMHO, i think this add-on should be added to the core

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by Qphoria » Thu Jul 15, 2010 1:31 am

Well maybe in a different way. the checkboxes are meant to allow you to check multiple and delete them at once. The mod prevents that. So I would need to add a separate delete button next to the input.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Moggin » Thu Jul 15, 2010 4:54 am

Thank you for the extra refinement, QPhoria! I know I was mistaken about the original ;) But fixes which sweep up after the user are such a great idea. Thanks again.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by emmetje » Wed Jun 22, 2011 9:57 pm

To make this work on 1.5.0.5. change

Code: Select all

$('#cart').submit();
to

Code: Select all

$('#basket').submit();

User avatar
New member

Posts

Joined
Wed Jun 22, 2011 2:18 am

Post by Qphoria » Wed Jun 22, 2011 10:01 pm

Thanks for the update :)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by kaliyas » Sun Dec 18, 2011 12:40 am

Hi guys.. I followed all your steps to apply this to 1.5.13 but it is not working.
This is the code

Code: Select all

<script type="text/javascript">
$("input").change(function() {
    $('#basket').submit();
});
</script>
can you give me a hand please? Thanks

New member

Posts

Joined
Sat Dec 17, 2011 6:36 pm

Post by Klimskady » Sat Jan 14, 2012 10:15 am

Actually this would be very useful... has anyone got this working on 1.5.1.3?

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Post by wonderland » Wed Jan 25, 2012 12:24 am

I just added

Code: Select all

<script type="text/javascript">
$("input[name*='quantity']").change(function() {
    $('#basket').submit();
});
</script>
And it seems to work, just takes a bit long to update.

New member

Posts

Joined
Wed Jun 15, 2011 8:25 pm

Post by Klimskady » Thu Jan 26, 2012 6:58 pm

When you say it takes a bit long to update is it like seconds to update?

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Post by Qphoria » Thu Jan 26, 2012 11:08 pm

should be instant. It just submits the form on change.. there is nothing to delay here. The only delay would be your server loading slowly.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Klimskady » Sat Apr 28, 2012 6:14 am

I have tried to get this to work as a vQmod but it doesn't seem to work, there are no errors or anything appearing in vQmod Manager, I have tried changing the basket to cart and that didn't work. The code is:

Code: Select all

<modification>
	<id>Auto update quantity</id>
	<version>1.0</version>
	<vqmver>2.1.6</vqmver>

   <file name="catalog/view/theme/shoppica/template/checkout/cart.tpl">
     <operation>
		<search position="after"><![CDATA[<?php echo $footer; ?>]]></search>
          <add><![CDATA[<script type="text/javascript">$("input).change(function() {$('#basket').submit();});</script> ]]></add>
	</operation>

</file>

</modification>

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Post by chakru » Sat May 05, 2012 3:38 am

I am looking at something like this

http://www.opencart.com/index.php?route ... on_id=4330

Only problem is the author of the extension hardly seems to there to support his extension. Wonder if he is still alive or lost interest in opencart?

Anyone got any idea on how to do this with ajax?

Regards

Newbie

Posts

Joined
Tue Mar 20, 2012 3:07 pm
Who is online

Users browsing this forum: Bing [Bot] and 42 guests