File tree Expand file tree Collapse file tree 1 file changed +7
-24
lines changed
app/code/Magento/Catalog/view/frontend/templates/product/view Expand file tree Collapse file tree 1 file changed +7
-24
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 ()) : ?>
44
43
<script type="text/x-magento-init">
45
44
{
46
45
"#product_addtocart_form": {
50
49
}
51
50
}
52
51
</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
+ }
76
59
</script>
77
60
<?php endif ; ?>
You can’t perform that action at this time.
0 commit comments