Skip to content

Commit 3330027

Browse files
Merge branch 'MAGETWO-53439' of github.com:magento-vanilla/magento2ce into PR
2 parents f495b82 + 49a2033 commit 3330027

File tree

1 file changed

+7
-24
lines changed
  • app/code/Magento/Catalog/view/frontend/templates/product/view

1 file changed

+7
-24
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
</div>
4141
</div>
4242
<?php endif; ?>
43-
<?php if ($block->isRedirectToCartEnabled()) : ?>
4443
<script type="text/x-magento-init">
4544
{
4645
"#product_addtocart_form": {
@@ -50,28 +49,12 @@
5049
}
5150
}
5251
</script>
53-
<?php else : ?>
54-
<script>
55-
require([
56-
'jquery',
57-
'mage/mage',
58-
'Magento_Catalog/product/view/validation',
59-
'Magento_Catalog/js/catalog-add-to-cart'
60-
], function ($) {
61-
'use strict';
62-
63-
$('#product_addtocart_form').mage('validation', {
64-
radioCheckboxClosest: '.nested',
65-
submitHandler: function (form) {
66-
var widget = $(form).catalogAddToCart({
67-
bindSubmit: false
68-
});
69-
70-
widget.catalogAddToCart('submitForm', $(form));
71-
72-
return false;
73-
}
74-
});
75-
});
52+
<?php if (!$block->isRedirectToCartEnabled()) : ?>
53+
<script type="text/x-magento-init">
54+
{
55+
"#product_addtocart_form": {
56+
"catalogAddToCart": {}
57+
}
58+
}
7659
</script>
7760
<?php endif; ?>

0 commit comments

Comments
 (0)