-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Magento 2.1 Ad product to cart reloads page --> Webanalytics and page load time #5266
Comments
I have noticed the same issue as well. I am hooking in to Magento_Catalog/js/catalog-add-to-cart.js module with my custom code and now in version 2.1 this javascript module doesn't run on product page any more. Please, you guys (Magento developers), provide me a solution how to proceed with this issue. Do I have to create custom javascript which will be reacting on click on add to cart button or wait for fix or something else? Thank for the help in advance. |
In order to restore old behavior (ajax add product to cart without page reload), I found and used the old code : magento2/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml Lines 54 to 76 in a5fa3af
that code was removed in commit MAGETWO-53439: [Github][PR] Removed inline JavaScript from template d608f9e |
@0m3r @andidhouse @Raysharr As i posted in another thread on this issue. vendor\magento\module-catalog\view\frontend\templates\product\view\addtocart.phtml You simply need to change
to
The initial value in the old code was overridden by the code in the inline script. However if you actually look at the widget itself you will see nothing happens if bind is set to false. NOTHING it's like the widget doesn't exist. How this was missed is just beyond comprehension. Unbelievable Hopefully the above fix is a much better one than simply adding in the old code. Cheers |
Just a quick update as well (for validation) So a quick 2 liner update to the widget:
|
I've noticed this behavior on all 2.1 sites I've been working on, both new installs and upgrades. @Zaylril's suggested change fixed the issue for me. |
…lytics and page load time #5266
This issue is already fixed in develop. |
i have tried this fix (putting bindSubmit to true) so i can have ajax add to cart working, but i am having another issue, Error messages are not showing ( success message are ), for example i try to purchase more qty than the product has, it wont tell me anything, no message error at all. Anyone else ? |
Hi there, tested on 2.1 one thing is fixed:
ok so far BUT... and the BUT is big "BUT" every time here... it is just half the way...
Also the behaviour is completely frustrating that the out of stock products are not marked somehow at configurable products AND simple products you ad more then once to the cart... This is another topic but my team is really tired of reporting bugs here as - if you are lucky - the bug is fixed half way after month but in most cases some things are missing or another bug appears. Any feedback on this from the magento team pls. Thanks! |
AND another bug reported also moth ago is also not solved: If a product is out of stock and the info here is shown on top in "page messages" and now go to another page each page has the this info notice :-/ .... |
Varnish and Redis installed. |
@andidhouse I managed to solve this by removing |
So will this fix be included in upcoming v2.1.3 expected in next two weeks I wonder. |
was this fixed in 2.1.3 or can we expect the fix to be in 2.1.4? |
@veloraven can you tell us if this will be in an upcoming release? The success AND failure messages need to show up where users see them without reloading the page. Thanks in advance. |
@andidhouse, thank you for your report. |
I made a patch for it: https://gist.github.com/OZZlE/67db00264ebfd94ea1f35e3998aa1c16 |
* update addresses APS-24 for 1.x * Update - removed references to newer customer matcher interfaces and used originals. * Update re: APS-35 - Known issue of Amazon Pay button on product page not working: magento/magento2#5266
Steps to reproduce
Expected result
Actual result
This causes two problems:
The best solution would be to have this behavior like in former m2 versions by adding the product to cart without reloading the page. I know that there was a bug that the site was not scrolling to top after putting a product to cart so the success message was not visible. I think the best solution would be to have this behavior like in former m2 versions without reloading the product page but scroll to top after adding product to cart.
The text was updated successfully, but these errors were encountered: