Skip to content
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

Fix Add to Cart #5854

Closed
wants to merge 5 commits into from
Closed

Fix Add to Cart #5854

wants to merge 5 commits into from

Conversation

quienti
Copy link
Contributor

@quienti quienti commented Jul 28, 2016

Issue :
#5144
#5266

Thank to @Zaylril for your fix !

Issue :
#5144
#5266

Thank to @Zaylril for your fix !
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jul 28, 2016

CLA assistant check
All committers have signed the CLA.

@minhluan259
Copy link

minhluan259 commented Aug 5, 2016

@quienti , I think you should change the code

<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "Magento_Catalog/product/view/validation": {
                "radioCheckboxClosest": ".nested"
            }
        }
    }
</script>
<?php if (!$block->isRedirectToCartEnabled()) : ?>
<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "catalogAddToCart": {
                "bindSubmit": true
            }
        }
    }
</script>
<?php endif; ?>

to

<?php if (!$block->isRedirectToCartEnabled()) : ?>
<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "catalogAddToCart": {
                "bindSubmit": true
            }
        }
    }
</script>
<?php else : ?>
<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "Magento_Catalog/product/view/validation": {
                "radioCheckboxClosest": ".nested"
            }
        }
    }
</script>
<?php endif; ?>

It's better.

@vasilii-b
Copy link

Fixing code from @minhluan259 works great but page is still refreshed if you get a message like this: http://prntscr.com/c29gzw -> We don't have as many --- as you requested.

@minhluan259
Copy link

@vasilii-b , Because you add qty product > qty in stock, that message will show.

@vasilii-b
Copy link

@minhluan259 yes, I understand this, BUT: why is the minicart updated to 0 items meanwhile I actually have items in cart ? :/

Fix Add to Cart
This reverts commit f0901f6.
This reverts commit f0901f6.
@quienti quienti closed this Oct 13, 2016
@adragus-inviqa
Copy link
Contributor

@quienti - what happened?

@quienti
Copy link
Contributor Author

quienti commented Oct 19, 2016

Oops, I reopens a new pull request ! Sorry
Edit : I think it is fixed in last develp branch

@adragus-inviqa
Copy link
Contributor

Yeah, I've seen some changes in there. Thanks for the PR anyway. 👍

@minhluan259
Copy link

@quienti
The issue was fixed, Why has it still not been updated in magento version 2.1.4?

@quienti
Copy link
Contributor Author

quienti commented Feb 20, 2017

I don't know, but is fixed in develop branch, so for Magento 2.2

magento-engcom-team pushed a commit that referenced this pull request Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants