Skip to content

Commit 3ffc380

Browse files
author
Ievgen Shakhsuvarov
committed
MAGETWO-32078: Validation for Terms and Conditions should be the same for OnePage Checkout and Multishipping Flow
1 parent 9c19d10 commit 3ffc380

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

app/code/Magento/Checkout/view/frontend/web/js/overview.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ define([
1010
"mage/translate"
1111
], function($){
1212
"use strict";
13-
13+
1414
$.widget('mage.orderOverview', {
1515
options: {
1616
opacity: 0.5, // CSS opacity for the 'Place Order' button when it's clicked and then disabled.
1717
pleaseWaitLoader: 'span.please-wait', // 'Submitting order information...' Ajax loader.
18-
placeOrderSubmit: 'button[type="submit"]', // The 'Place Order' button.
19-
agreements: '#checkout-agreements' // Container for all of the checkout agreements and terms/conditions
18+
placeOrderSubmit: 'button[type="submit"]' // The 'Place Order' button.
2019
},
2120

2221
/**
@@ -28,21 +27,19 @@ define([
2827
},
2928

3029
/**
31-
* Verify that all agreements and terms/conditions are checked. Show the Ajax loader. Disable
32-
* the submit button (i.e. Place Order).
30+
* Show the Ajax loader. Disable the submit button (i.e. Place Order).
3331
* @return {Boolean}
3432
* @private
3533
*/
3634
_showLoader: function() {
37-
if ($(this.options.agreements).find('input[type="checkbox"]:not(:checked)').length > 0) {
38-
alert($.mage.__('Please agree to all Terms and Conditions before placing the orders.'));
35+
if (!this.element.validation('isValid')) {
3936
return false;
4037
}
4138
this.element.find(this.options.pleaseWaitLoader).show().end()
4239
.find(this.options.placeOrderSubmit).prop('disabled', true).css('opacity', this.options.opacity);
4340
return true;
4441
}
4542
});
46-
43+
4744
return $.mage.orderOverview;
4845
});

app/code/Magento/Multishipping/view/frontend/templates/checkout/overview.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
44
*/
55
?>
6-
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="review-order-form" data-mage-init='{"orderOverview": {}}' class="form multicheckout order-review">
6+
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="review-order-form" data-mage-init='{"orderOverview": {}, "validation":{}}' class="form multicheckout order-review">
77
<?php echo $this->getBlockHtml('formkey'); ?>
88
<div class="block block-billing">
99
<div class="block-title"><strong><?php echo __('Billing Information') ?></strong></div>

0 commit comments

Comments
 (0)