1

We have a magento site, running on Magento 1.8.0.

We get complaints from some of our customers because they can't add a product the cart. They always have an Ipad 2. But not all ipad 2 users have this problem (so maybe a certain OS version?). Iphone and other Apple products work just fine with our website.

We don't have errors in our log, and we've tried everything with cookies (set cookie path, set cookie lifetime to 86400, even remove the cookie part in Varien.php). Nothing seems to solve the problem.

How can I reproduce this bug so I can solve it? I have to do this without the Ipad 2 as I don't own one.

Maybe someone has experience with this Ipad 2 related-bug? It's in Safari and Chrome on the Ipad 2, so it's not an safari problem

1

Have you tried using chrome's emulation tool to debug if its anything front-end related due to size ore something. maybe some element is hovering over it.

more about chrome emulate: https://developer.chrome.com/devtools/docs/device-mode

Then try the inspector if the error also occurs on the ipad 2 screen sizes.

Personally when debugging i try to close in to the issue by also trying other same sized devices how are iphones doing, ipad 1 or newer ipad airs. then you get more and more sence where the issue might be.

0

Thank you for your anwser Kay Int Veen. It is a handy tool, I didn't know about that one. I've tried it, and I've encountered no problems or errors (fortunately and unfortunately).

After hours of searching inside the raw logs I found something: When a 'normal' user adds a product to the cart, the log says:

GET /checkout/cart/add/uenc/(etc etc)

and then
"GET /checkout/cart/" (to see what's inside the cart).

The users with an Ipad 2 only get directed to the cart, so there's no add to cart command before that. So the user gets directed to an empty cart (and that's what I heard from our customers).

I've searched inside the raw logs with the same user agent, but not all have the same problem. Now I had it narrowed down to the add to cart button.

I've compared the /template/catalog/product/view.phtml with the default theme, and I found this piece of code missing inside our own template:

<?php echo $this->getBlockHtml('formkey'); ?>

I think this has to do with the empty carts.. what I don't understand is why some people have this problem, and others don't.

I have now added it to view.phtml like so:

<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
<?php echo $this->getBlockHtml('formkey'); ?>

I hope this solves the problem.

  • Jup seems like your issue should be solved with this. good luck! – Kay Int Veen Mar 23 '15 at 7:29
  • Magento uses formkey to secure forms, so bots cannot spam/misuse these. It can happen that after upgrading you've need to manually add the formkey block to custom .phtml files. I'm guessing you're using another template for mobile/iPad2 users. So check these files too – Jeroen Apr 8 '15 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.