Author Topic: IE: Strange Add to Cart Problem  (Read 7683 times)

sscheidegger

  • Jr. Member
  • **
  • Posts: 88
IE: Strange Add to Cart Problem
« on: November 21, 2011, 09:08:36 am »
Hi everybody

Testing J1.7.3 and VM1.9.8M (and the standard fruitshop template and the VM example data) I face a strange problem:
Things in general work very well: Adding products to the cart, checking out, etc. However, if in IE8 I press the "Add to Cart" button on the products details page twice in a row, it won't add the product twice. So I found out that I can click the add to cart button, it will add one product. If after that I click add to cart again (for the same product!), it won't add the product again until I restart IE. But if I change the number of products i.e. form 1 to 2, then it will add 2 pieces to the cart. From now on I cannot add 1 or 2 pieces of that product anymore. I'd have to change to a different number, that would work again, and so on...
In Firefox I don't have this problem.

Greets,
Stefan

dpodesta

  • Beginner
  • *
  • Posts: 12
Re: IE: Strange Add to Cart Problem
« Reply #1 on: November 22, 2011, 14:13:31 pm »
I have the same problem in IE 9. If you click the add to cart button again you get nothing. The pop up says product added to cart though.

Also if I click compatibility mode button in IE9 the add to cart button doesn't work.

I need to restart IE and then turn it off and it starts working. I turned offStill can't add to items by clicking the button twice. the Google library and may have fixed that issue. "not really sure though".

Still can't add 2 items by click "add to cart " twice though.

http://www.1skinsolution.com/base

Any help would be greatly appreciated as I have a client emailing me about it everyday.


manch

  • Beginner
  • *
  • Posts: 34
Re: IE: Strange Add to Cart Problem
« Reply #2 on: November 22, 2011, 19:16:27 pm »
I have this bug too in ie if i put the same product one by one in the cart...

Manch

Aliciah85

  • Beginner
  • *
  • Posts: 28
Re: IE: Strange Add to Cart Problem
« Reply #3 on: November 23, 2011, 05:48:18 am »
i also have this issue!

edjec

  • Beginner
  • *
  • Posts: 2
Re: IE: Strange Add to Cart Problem
« Reply #4 on: November 29, 2011, 02:51:02 am »
Ditto!  Since upgrading to VM 1.1.9 our members cannot add items to their cart if using Mac's.  So far it seems OK with any PC browser though.

Is there any assistance for this issue?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27570
  • Always on vacation
    • Jenkin Hill Internet
Re: IE: Strange Add to Cart Problem
« Reply #5 on: November 29, 2011, 13:24:14 pm »
edjec, this thread is about VM2 - this is the VM2 section of the board. If having issues with 1.1.9 please post in the 1.1 forum area.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.8.10202 on Joomla 3.9.13 PHP 7.0.33

sscheidegger

  • Jr. Member
  • **
  • Posts: 88
Re: IE: Strange Add to Cart Problem
« Reply #6 on: December 13, 2011, 14:24:40 pm »
Testing with J1.7.3 and VM RC3 K, this problem is still there...

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10375
  • VirtueMart Version: 3+
Re: IE: Strange Add to Cart Problem
« Reply #7 on: December 13, 2011, 14:52:50 pm »

Still can't add 2 items by click "add to cart " twice though.

http://www.1skinsolution.com/base

Any help would be greatly appreciated as I have a client emailing me about it everyday.



I noticed on your site you are doing a template override with an error in your add to cart form.

<input type="hidden" class="pname" value="<?php echo $this->product->product_name ?>"/>

YOU are missing the "/" to close the input.

Try that
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

sscheidegger

  • Jr. Member
  • **
  • Posts: 88
Re: IE: Strange Add to Cart Problem
« Reply #8 on: December 19, 2011, 16:01:50 pm »
Testing J1.7.3 and VM RC3, the behaviour in IE has improved. Several products can be added to the cart by repeatedly clicking the "Add to Cart" button.

However, the Cart Module does not work correctly yet. It seems to update, when clicking first time on the "Add to Cart" button. For the following clicks it doesn't update anymore. Only when the page is reloaded, the cart module updates and shows the correct content. When proceeding to the cart, it shows the correct products in the cart (corresponding to the number of clicks on "Add to Cart").

This behaviour again I found only in IE. With Firefox everything works perfectly.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27570
  • Always on vacation
    • Jenkin Hill Internet
Re: IE: Strange Add to Cart Problem
« Reply #9 on: December 19, 2011, 16:59:20 pm »
When you have such issues with IE then try the built in script debugger - hit F12. IE9 is much more sensitive to JS conflicts than other browsers.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.8.10202 on Joomla 3.9.13 PHP 7.0.33

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10375
  • VirtueMart Version: 3+
Re: IE: Strange Add to Cart Problem
« Reply #10 on: December 19, 2011, 17:09:32 pm »
Testing J1.7.3 and VM RC3, the behaviour in IE has improved. Several products can be added to the cart by repeatedly clicking the "Add to Cart" button.

However, the Cart Module does not work correctly yet. It seems to update, when clicking first time on the "Add to Cart" button. For the following clicks it doesn't update anymore. Only when the page is reloaded, the cart module updates and shows the correct content. When proceeding to the cart, it shows the correct products in the cart (corresponding to the number of clicks on "Add to Cart").

This behaviour again I found only in IE. With Firefox everything works perfectly.


are you using a template overide that the add to cart form does not has

<form method="post" class="product js-recalculate" action="index.php" >

js-recalculate   was added
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

sscheidegger

  • Jr. Member
  • **
  • Posts: 88
Re: IE: Strange Add to Cart Problem
« Reply #11 on: December 20, 2011, 09:11:32 am »

are you using a template overide that the add to cart form does not has

<form method="post" class="product js-recalculate" action="index.php" >

js-recalculate   was added


Thanks for the hint! I checked, js-recalculate is there. To further analyze I activated an original template (beez5) with no overrides. And I also checked in a clean installation of Joomla and VM RC3 (with the sample products). The problem is the same in all cases: In Firefox the cart module works as expected, in IE 8 & 9 it doesn't update correctly.

Actually, I also observed another strange behaviour: There are already some products in the cart and the cart module shows them correctly (after a refresh or some navigation on the website). When now I add again a product, all the products disappear in the cart module and it shows only one product (I think the one I had added first).

As I said, this is only a problem with the cart module. When I go to the cart, everything is there as it should be.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4045
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: IE: Strange Add to Cart Problem
« Reply #12 on: December 23, 2011, 12:52:13 pm »
Hi,
It was a problem with customfields plugin and cart adding.
It must be solved now in SVN files but don't know if this is exactly your problem.

Plz try to get the svn files to test and give me some news ;)

sscheidegger

  • Jr. Member
  • **
  • Posts: 88
Re: IE: Strange Add to Cart Problem
« Reply #13 on: December 29, 2011, 10:59:44 am »
Hi,

thanks a lot for having a look at this. I just installed SVN 5182 on J1.7.3. Unfortunately the problem is still there.

Are you able to reproduce this problem? I'm facing it on a clean installation of Joomla and VM. The only thing I had to do was using IE instead of my favorite browser.

sscheidegger

  • Jr. Member
  • **
  • Posts: 88
Re: IE: Strange Add to Cart Problem
« Reply #14 on: December 30, 2011, 15:56:37 pm »

I had a closer look at this and found it to be an AJAX caching problem in IE!

The AJAX request in line 92 of vmprices.js is being cached by IE. As long as there is no change in the request, IE will show the cached response to that request. Therefore clicking repeatedly "Add To Cart" won't update the cart module correctly.
Code: [Select]
$.getJSON(siteurl+"index.php?option=com_virtuemart&nosef=1&view=cart&task=viewJS&format=json",
http://www.codecouch.com/2009/01/how-to-stop-internet-explorer-from-caching-ajax-requests/ suggests the common getTime() workaround and a solution using Cache-Control.

On my website I tested the getTime() workaround by changing line 92 of vmprices.js to
Code: [Select]
$.getJSON(siteurl+"index.php?option=com_virtuemart&nosef=1&view=cart&task=viewJS&format=json&dummy="+new Date().getTime(),I found it to be working in IE8, IE8 with compatibility mode, IE9 and Firefox 9.

Happy New Year!