Skip to content

Commit 7b02b5d

Browse files
committed
Merge remote-tracking branch 'origin/develop' into MAGETWO-55668
2 parents e6c60d1 + 569bbc3 commit 7b02b5d

File tree

18 files changed

+105
-57
lines changed

18 files changed

+105
-57
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ Login,Login
121121
Close,Close
122122
item,item
123123
items,items
124-
"Go to Checkout","Go to Checkout"
125124
"Recently added item(s)","Recently added item(s)"
126125
"View and edit cart","View and edit cart"
127126
"See Details","See Details"

app/code/Magento/Checkout/view/frontend/web/js/view/cart/totals.js

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,28 @@
22
* Copyright © 2016 Magento. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
5-
define(
6-
[
7-
'uiComponent',
8-
'Magento_Checkout/js/model/totals',
9-
'Magento_Checkout/js/model/shipping-service'
10-
],
11-
function (Component, totalsService, shippingService) {
12-
'use strict';
5+
define([
6+
'jquery',
7+
'uiComponent',
8+
'Magento_Checkout/js/model/totals',
9+
'Magento_Checkout/js/model/shipping-service'
10+
], function ($, Component, totalsService, shippingService) {
11+
'use strict';
1312

14-
return Component.extend({
13+
return Component.extend({
14+
isLoading: totalsService.isLoading,
1515

16-
isLoading: totalsService.isLoading,
17-
18-
/**
19-
* @override
20-
*/
21-
initialize: function () {
22-
this._super();
23-
totalsService.totals.subscribe(function () {
24-
window.dispatchEvent(new Event('resize'));
25-
});
26-
shippingService.getShippingRates().subscribe(function () {
27-
window.dispatchEvent(new Event('resize'));
28-
});
29-
}
30-
});
31-
}
32-
);
16+
/**
17+
* @override
18+
*/
19+
initialize: function () {
20+
this._super();
21+
totalsService.totals.subscribe(function () {
22+
$(window).trigger('resize');
23+
});
24+
shippingService.getShippingRates().subscribe(function () {
25+
$(window).trigger('resize');
26+
});
27+
}
28+
});
29+
});

app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@
3636
<!-- /ko -->
3737
</div>
3838

39-
<!-- ko if: getCartParam('possible_onepage_checkout') -->
40-
<!-- ko foreach: getRegion('subtotalContainer') -->
41-
<!-- ko template: getTemplate() --><!-- /ko -->
42-
<!-- /ko -->
39+
<!-- ko foreach: getRegion('subtotalContainer') -->
40+
<!-- ko template: getTemplate() --><!-- /ko -->
4341
<!-- /ko -->
4442

4543
<!-- ko foreach: getRegion('extraInfo') -->
@@ -56,11 +54,11 @@
5654
data-action="close"
5755
data-bind="
5856
attr: {
59-
title: $t('Go to Checkout')
57+
title: $t('Proceed to Checkout')
6058
},
6159
click: closeMinicart()
6260
">
63-
<!-- ko i18n: 'Go to Checkout' --><!-- /ko -->
61+
<!-- ko i18n: 'Proceed to Checkout' --><!-- /ko -->
6462
</button>
6563
<div data-bind="html: getCartParam('extra_actions')"></div>
6664
</div>

app/code/Magento/Customer/view/frontend/templates/address/edit.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@
7575
value="<?php echo $block->escapeHtml($block->getStreetLine(1)) ?>"
7676
title="<?php /* @escapeNotVerified */ echo __('Street Address') ?>"
7777
id="street_1"
78-
class="input-text <?php /* @escapeNotVerified */
79-
echo $_streetValidationClass ?>"/>
78+
class="input-text <?php /* @escapeNotVerified */ echo $_streetValidationClass ?>"/>
8079
<div class="nested">
8180
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
8281
<?php for ($_i = 1, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i < $_n; $_i++): ?>
@@ -88,7 +87,8 @@
8887
<input type="text" name="street[]"
8988
value="<?php echo $block->escapeHtml($block->getStreetLine($_i + 1)) ?>"
9089
title="<?php /* @escapeNotVerified */ echo __('Street Address %1', $_i + 1) ?>"
91-
id="street_<?php /* @escapeNotVerified */ echo $_i + 1 ?>" echo $_streetValidationClass ?>">
90+
id="street_<?php /* @escapeNotVerified */ echo $_i + 1 ?>"
91+
class="input-text <?php /* @escapeNotVerified */ echo $_streetValidationClass ?>">
9292
</div>
9393
</div>
9494
<?php endfor; ?>

app/code/Magento/Dhl/view/frontend/web/js/model/shipping-rates-validation-rules.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ define(
1616
},
1717
'country_id': {
1818
'required': true
19+
},
20+
'city': {
21+
'required': true
1922
}
2023
};
2124
}

app/code/Magento/Fedex/Model/Carrier.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ public function setRequest(RateRequest $request)
338338
} else {
339339
}
340340

341+
if ($request->getDestCity()) {
342+
$r->setDestCity($request->getDestCity());
343+
}
344+
341345
$weight = $this->getTotalNumOfBoxes($request->getPackageWeight());
342346
$r->setWeight($weight);
343347
if ($request->getFreeMethodWeight() != $request->getPackageWeight()) {
@@ -432,6 +436,10 @@ protected function _formRateRequest($purpose)
432436
],
433437
];
434438

439+
if ($r->getDestCity()) {
440+
$ratesRequest['RequestedShipment']['Recipient']['Address']['City'] = $r->getDestCity();
441+
}
442+
435443
if ($purpose == self::RATE_REQUEST_GENERAL) {
436444
$ratesRequest['RequestedShipment']['RequestedPackageLineItems'][0]['InsuredValue'] = [
437445
'Amount' => $r->getValue(),

app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ protected function setUp()
148148
);
149149
}
150150

151+
public function testSetRequestWithoutCity()
152+
{
153+
$requestMock = $this->getMockBuilder(\Magento\Quote\Model\Quote\Address\RateRequest::class)
154+
->disableOriginalConstructor()
155+
->setMethods(['getDestCity'])
156+
->getMock();
157+
$requestMock->expects($this->once())
158+
->method('getDestCity')
159+
->willReturn(null);
160+
$this->_model->setRequest($requestMock);
161+
}
162+
163+
public function testSetRequestWithCity()
164+
{
165+
$requestMock = $this->getMockBuilder(\Magento\Quote\Model\Quote\Address\RateRequest::class)
166+
->disableOriginalConstructor()
167+
->setMethods(['getDestCity'])
168+
->getMock();
169+
$requestMock->expects($this->exactly(2))
170+
->method('getDestCity')
171+
->willReturn('Small Town');
172+
$this->_model->setRequest($requestMock);
173+
}
174+
151175
/**
152176
* Callback function, emulates getValue function
153177
* @param $path
@@ -194,7 +218,16 @@ public function testCollectRatesRateAmountOriginBased($amount, $rateType, $expec
194218
$this->_model->expects($this->any())->method('_getCachedQuotes')->will(
195219
$this->returnValue(serialize($response))
196220
);
197-
$request = $this->getMock(\Magento\Quote\Model\Quote\Address\RateRequest::class, [], [], '', false);
221+
$request = $this->getMock(
222+
\Magento\Quote\Model\Quote\Address\RateRequest::class,
223+
['getDestCity'],
224+
[],
225+
'',
226+
false
227+
);
228+
$request->expects($this->exactly(2))
229+
->method('getDestCity')
230+
->willReturn('Wonderful City');
198231
foreach ($this->_model->collectRates($request)->getAllRates() as $allRates) {
199232
$this->assertEquals($expected, $allRates->getData('cost'));
200233
}

app/code/Magento/Fedex/view/frontend/web/js/model/shipping-rates-validation-rules.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ define(
1616
},
1717
'country_id': {
1818
'required': true
19+
},
20+
'city': {
21+
'required': true
1922
}
2023
};
2124
}

app/code/Magento/Sales/Model/ResourceModel/Order/Handler/State.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class State
2323
*/
2424
public function check(Order $order)
2525
{
26-
if (!$order->getId()) {
27-
return $order;
28-
}
2926
if (!$order->isCanceled() && !$order->canUnhold() && !$order->canInvoice() && !$order->canShip()) {
3027
if (0 == $order->getBaseGrandTotal() || $order->canCreditmemo()) {
3128
if ($order->getState() !== Order::STATE_COMPLETE) {

app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/StateTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,20 @@ protected function setUp()
7474
public function testCheckOrderEmpty()
7575
{
7676
$this->orderMock->expects($this->once())
77-
->method('getId')
78-
->will($this->returnValue(null));
79-
$this->assertEquals($this->orderMock, $this->state->check($this->orderMock));
77+
->method('getBaseGrandTotal')
78+
->willReturn(100);
79+
$this->orderMock->expects($this->never())
80+
->method('setState');
81+
82+
$this->state->check($this->orderMock);
8083
}
8184

8285
/**
8386
* test check order - set state complete
8487
*/
8588
public function testCheckSetStateComplete()
8689
{
87-
$this->orderMock->expects($this->once())
90+
$this->orderMock->expects($this->any())
8891
->method('getId')
8992
->will($this->returnValue(1));
9093
$this->orderMock->expects($this->once())
@@ -120,7 +123,7 @@ public function testCheckSetStateComplete()
120123
*/
121124
public function testCheckSetStateClosed()
122125
{
123-
$this->orderMock->expects($this->once())
126+
$this->orderMock->expects($this->any())
124127
->method('getId')
125128
->will($this->returnValue(1));
126129
$this->orderMock->expects($this->once())
@@ -162,7 +165,7 @@ public function testCheckSetStateClosed()
162165
*/
163166
public function testCheckSetStateProcessing()
164167
{
165-
$this->orderMock->expects($this->once())
168+
$this->orderMock->expects($this->any())
166169
->method('getId')
167170
->will($this->returnValue(1));
168171
$this->orderMock->expects($this->once())

app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ define([
4949
return _.mapObject({
5050
"min_text_length": [
5151
function (value, params) {
52-
return value.length == 0 || value.length >= +params;
52+
return _.isUndefined(value) || value.length == 0 || value.length >= +params;
5353
},
5454
$.mage.__('Please enter more or equal than {0} symbols.')
5555
],
5656
"max_text_length": [
5757
function (value, params) {
58-
return value.length <= +params;
58+
return !_.isUndefined(value) && value.length <= +params;
5959
},
6060
$.mage.__('Please enter less or equal than {0} symbols.')
6161
],

app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,5 +391,9 @@
391391
}
392392
}
393393
}
394+
395+
.action {
396+
margin-bottom: @indent__s;
397+
}
394398
}
395399
}

app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434

3535
.subtotal {
36-
margin: 0 @indent__s;
36+
margin: 0 @indent__s @indent__s;
3737
text-align: right;
3838

3939
.label {
@@ -123,6 +123,7 @@
123123
.lib-css(padding, 25px @minicart__padding-horizontal);
124124
right: 0;
125125
width: 320px;
126+
z-index: 101;
126127

127128
.block-title {
128129
display: none;

app/design/frontend/Magento/blank/web/css/source/_extends.less

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,12 +1139,13 @@
11391139
}
11401140

11411141
.action {
1142-
&.continue {
1143-
float: left;
1142+
&.clear,
1143+
&.update {
1144+
margin-left: @indent__s;
11441145
}
11451146

1146-
&.clear {
1147-
margin-right: @indent__s;
1147+
&.continue {
1148+
float: left;
11481149
}
11491150
}
11501151
}

app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434

3535
.subtotal {
36-
margin: 0 @indent__s;
36+
margin: 0 @indent__s @indent__s;
3737
text-align: right;
3838

3939
.label {
@@ -126,6 +126,7 @@
126126
.lib-css(padding, 25px @minicart__padding-horizontal);
127127
right: 0;
128128
width: 320px;
129+
z-index: 101;
129130

130131
.block-title {
131132
display: none;

dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/BraintreeSettlementReportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* 1. Log in Storefront.
2020
* 2. Add products to the Shopping Cart.
2121
* 3. In 'Estimate Shipping and Tax' section specify destination using values from Test Data.
22-
* 4. Click the 'Go to Checkout' button.
22+
* 4. Click the 'Proceed to Checkout' button.
2323
* 5. Fill shipping information.
2424
* 6. Select shipping method.
2525
* 7. Select payment method (use reward points and store credit if available).

dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWith3dSecureTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* 2. Add products to the Shopping Cart.
2222
* 3. Apply discounts in Shopping Cart according to dataset.
2323
* 4. In 'Estimate Shipping and Tax' section specify destination using values from Test Data.
24-
* 5. Click the 'Go to Checkout' button.
24+
* 5. Click the 'Proceed to Checkout' button.
2525
* 6. Fill shipping information.
2626
* 7. Select shipping method.
2727
* 8. Select payment method (use reward points and store credit if available).

dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWithBraintreePaypalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* 1. Log in Storefront.
2020
* 2. Add products to the Shopping Cart.
2121
* 3. In 'Estimate Shipping and Tax' section specify destination using values from Test Data.
22-
* 4. Click the 'Go to Checkout' button.
22+
* 4. Click the 'Proceed to Checkout' button.
2323
* 5. Fill shipping information.
2424
* 6. Select shipping method.
2525
* 8. Select payment method

0 commit comments

Comments
 (0)