Skip to content

Commit 86c9cad

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1712 from magento-engcom/2.1-develop-prs
Public Pull Requests #11919 [BACKPORT 2.1] [BUGFIX] Add FreeShipping to the Items when SalesRule uses by @lewisvoncken Fixed Public Issues #8089 Cart Price Rules based on Shipping Method can't be applied in basket #8172 Free shipping coupon not working with Table Rates shipping - Sorry, no quotes are available for this order. #10507 Free shipping not being properly applied in CE 2.1.8
2 parents a691f08 + 6fd5b7f commit 86c9cad

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ define([
6161
},
6262

6363
/**
64-
* @returns {Bool}
64+
* @returns {Boolean}
6565
*/
6666
isVaultEnabled: function () {
6767
return this.vaultEnabler.isVaultEnabled();
@@ -144,10 +144,19 @@ define([
144144
},
145145

146146
/**
147-
* Trigger order placing
147+
* Returns state of place order button
148+
* @returns {Boolean}
149+
*/
150+
isButtonActive: function () {
151+
return this.isActive() && this.isPlaceOrderActionAllowed();
152+
},
153+
154+
/**
155+
* Triggers order placing
148156
*/
149157
placeOrderClick: function () {
150158
if (this.validateCardType()) {
159+
this.isPlaceOrderActionAllowed(false);
151160
$(this.getSelector('submit')).trigger('click');
152161
}
153162
},

app/code/Magento/Braintree/view/frontend/web/template/payment/form.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@
139139
<button class="action primary checkout"
140140
type="submit"
141141
data-bind="
142-
click: placeOrderClick,
143-
attr: {title: $t('Place Order')},
144-
css: {disabled: !isPlaceOrderActionAllowed()},
145-
enable: isActive()
142+
click: placeOrderClick,
143+
attr: {title: $t('Place Order')},
144+
enable: isButtonActive()
146145
"
147146
disabled>
148147
<span data-bind="i18n: 'Place Order'"></span>

app/code/Magento/Checkout/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Error!,Error!
6262
"DB exception","DB exception"
6363
"Wrong minimum amount.","Wrong minimum amount."
6464
Message,Message
65-
"<a href=""%1"" onclick=""this.target=\'_blank\'"" class=""print"">Print receipt</a>","<a href=""%1"" onclick=""this.target=\'_blank\'"" class=""print"">Print receipt</a>"
65+
"Print receipt","Print receipt"
6666
"Apply Discount Code","Apply Discount Code"
6767
"Enter discount code","Enter discount code"
6868
"Apply Discount","Apply Discount"

app/code/Magento/Checkout/view/frontend/templates/button.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>
1111

1212
<?php if ($block->getCanViewOrder() && $block->getCanPrintOrder()) :?>
13-
<?php /* @escapeNotVerified */ echo __('<a href="%1" onclick="this.target=\'_blank\'" class="print">Print receipt</a>', $block->getPrintUrl()) ?>
13+
<a href="<?php /* @escapeNotVerified */ echo $block->getPrintUrl() ?>" target="_blank" class="print">
14+
<?php /* @escapeNotVerified */ echo __('Print receipt') ?>
15+
</a>
1416
<?php echo $block->getChildHtml() ?>
1517
<?php endif;?>

app/code/Magento/OfflineShipping/Model/SalesRule/Calculator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function processFreeShipping(\Magento\Quote\Model\Quote\Item\AbstractItem
4545

4646
case Rule::FREE_SHIPPING_ADDRESS:
4747
$address->setFreeShipping(true);
48+
$item->setFreeShipping(true);
4849
break;
4950
}
5051
if ($rule->getStopRulesProcessing()) {

0 commit comments

Comments
 (0)