File tree 1 file changed +23
-8
lines changed
app/code/Magento/Catalog/view/frontend/templates/product/view 1 file changed +23
-8
lines changed Original file line number Diff line number Diff line change 40
40
</div>
41
41
</div>
42
42
<?php endif ; ?>
43
+ <?php if ($ block ->isRedirectToCartEnabled ()) : ?>
43
44
<script type="text/x-magento-init">
44
45
{
45
46
"#product_addtocart_form": {
49
50
}
50
51
}
51
52
</script>
52
- <?php if (!$ block ->isRedirectToCartEnabled ()) : ?>
53
- <script type="text/x-magento-init">
54
- {
55
- "#product_addtocart_form": {
56
- "catalogAddToCart": {
57
- "bindSubmit": false
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;
58
73
}
59
- }
60
- }
74
+ });
75
+ });
61
76
</script>
62
77
<?php endif ; ?>
You can’t perform that action at this time.
0 commit comments