Skip to content

Commit 6874630

Browse files
authored
Merge pull request #4495 from magento-mpi/PR-20190718
MAIN-PR-20190718
2 parents 60fa2b1 + 49e021f commit 6874630

File tree

14 files changed

+294
-108
lines changed

14 files changed

+294
-108
lines changed

app/code/Magento/CatalogRule/Pricing/Price/CatalogRulePrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getValue()
9393
} else {
9494
$this->value = $this->getRuleResource()
9595
->getRulePrice(
96-
$this->dateTime->scopeDate($this->storeManager->getStore()->getId()),
96+
$this->dateTime->date(null, null, false),
9797
$this->storeManager->getStore()->getWebsiteId(),
9898
$this->customerSession->getCustomerGroupId(),
9999
$this->product->getId()

app/code/Magento/CatalogRule/Test/Unit/Pricing/Price/CatalogRulePriceTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ protected function setUp()
155155
*/
156156
public function testGetValue()
157157
{
158-
$coreStoreId = 1;
159158
$coreWebsiteId = 1;
160159
$productId = 1;
161160
$customerGroupId = 1;
@@ -164,15 +163,12 @@ public function testGetValue()
164163
$catalogRulePrice = 55.12;
165164
$convertedPrice = 45.34;
166165

167-
$this->coreStoreMock->expects($this->once())
168-
->method('getId')
169-
->will($this->returnValue($coreStoreId));
170166
$this->coreStoreMock->expects($this->once())
171167
->method('getWebsiteId')
172168
->will($this->returnValue($coreWebsiteId));
173169
$this->dataTimeMock->expects($this->once())
174-
->method('scopeDate')
175-
->with($this->equalTo($coreStoreId))
170+
->method('date')
171+
->with(null, null, false)
176172
->will($this->returnValue($dateTime));
177173
$this->customerSessionMock->expects($this->once())
178174
->method('getCustomerGroupId')

app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,19 @@
1313
<a if="currentBillingAddress().telephone" attr="'href': 'tel:' + currentBillingAddress().telephone" text="currentBillingAddress().telephone"></a><br/>
1414

1515
<each args="data: currentBillingAddress().customAttributes, as: 'element'">
16-
<each args="data: Object.keys(element), as: 'attribute'">
17-
<if args="typeof element[attribute] === 'object'">
18-
<if args="element[attribute].label">
19-
<text args="element[attribute].label"/>
20-
</if>
21-
<ifnot args="element[attribute].label">
22-
<if args="element[attribute].value">
23-
<text args="element[attribute].value"/>
24-
</if>
25-
</ifnot>
16+
<if args="typeof element === 'object'">
17+
<if args="element.label">
18+
<text args="element.label"/>
2619
</if>
27-
<if args="typeof element[attribute] === 'string'">
28-
<text args="element[attribute]"/>
29-
</if><br/>
30-
</each>
20+
<ifnot args="element.label">
21+
<if args="element.value">
22+
<text args="element.value"/>
23+
</if>
24+
</ifnot>
25+
</if>
26+
<if args="typeof element === 'string'">
27+
<text args="element"/>
28+
</if><br/>
3129
</each>
3230

3331
<button visible="!isAddressSameAsShipping()"

app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@
1313
<a if="address().telephone" attr="'href': 'tel:' + address().telephone" text="address().telephone"></a><br/>
1414

1515
<each args="data: address().customAttributes, as: 'element'">
16-
<each args="data: Object.keys(element), as: 'attribute'">
17-
<if args="typeof element[attribute] === 'object'">
18-
<if args="element[attribute].label">
19-
<text args="element[attribute].label"/>
20-
</if>
21-
<ifnot args="element[attribute].label">
22-
<if args="element[attribute].value">
23-
<text args="element[attribute].value"/>
24-
</if>
25-
</ifnot>
16+
<if args="typeof element === 'object'">
17+
<if args="element.label">
18+
<text args="element.label"/>
2619
</if>
27-
<if args="typeof element[attribute] === 'string'">
28-
<text args="element[attribute]"/>
29-
</if><br/>
30-
</each>
20+
<ifnot args="element.label">
21+
<if args="element.value">
22+
<text args="element.value"/>
23+
</if>
24+
</ifnot>
25+
</if>
26+
<if args="typeof element === 'string'">
27+
<text args="element"/>
28+
</if><br/>
3129
</each>
3230
</if>

app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ $params = $block->getParams();
1515
<?php if (isset($params['redirect'])): ?>
1616
window.location="<?= $block->escapeUrl($params['redirect']) ?>";
1717
<?php elseif (isset($params['redirect_parent'])): ?>
18-
var require = window.top.require;
18+
var require = window.parent.require;
1919
require(
2020
[
2121
'jquery'
2222
],
2323
function($) {
24-
var parent = window.top;
24+
var parent = window.parent;
2525
$(parent).trigger('clearTimeout');
2626
parent.location="<?= $block->escapeUrl($params['redirect_parent']) ?>";
2727
}
2828
);
2929
<?php elseif (isset($params['error_msg'])): ?>
30-
var require = window.top.require;
30+
var require = window.parent.require;
3131
require(
3232
[
3333
'jquery',
@@ -36,7 +36,7 @@ $params = $block->getParams();
3636
'Magento_Checkout/js/model/full-screen-loader'
3737
],
3838
function($, globalMessageList, $t, fullScreenLoader) {
39-
var parent = window.top;
39+
var parent = window.parent;
4040
$(parent).trigger('clearTimeout');
4141
fullScreenLoader.stopLoader();
4242
globalMessageList.addErrorMessage({
@@ -45,21 +45,21 @@ $params = $block->getParams();
4545
}
4646
);
4747
<?php elseif (isset($params['multishipping'])): ?>
48-
var require = window.top.require;
48+
var require = window.parent.require;
4949
require(
5050
[
5151
'jquery'
5252
],
5353
function($) {
54-
var parent = window.top;
54+
var parent = window.parent;
5555
$(parent).trigger('clearTimeout');
5656
$(parent.document).find('#multishipping-billing-form').submit();
5757
}
5858
);
5959
<?php elseif (isset($params['order_success'])): ?>
60-
window.top.location = "<?= $block->escapeUrl($params['order_success']) ?>";
60+
window.parent.location = "<?= $block->escapeUrl($params['order_success']) ?>";
6161
<?php else: ?>
62-
var require = window.top.require;
62+
var require = window.parent.require;
6363
require(
6464
[
6565
'jquery',
@@ -69,7 +69,7 @@ $params = $block->getParams();
6969
'Magento_Checkout/js/model/full-screen-loader'
7070
],
7171
function($, quote, placeOrderAction, redirectOnSuccessAction, fullScreenLoader) {
72-
var parent = window.top;
72+
var parent = window.parent;
7373

7474
$(parent).trigger('clearTimeout');
7575
$.when(
@@ -80,7 +80,7 @@ $params = $block->getParams();
8080
}
8181
).fail(
8282
function () {
83-
var parent = window.top;
83+
var parent = window.parent;
8484
$(parent).trigger('clearTimeout');
8585
fullScreenLoader.stopLoader();
8686
}

app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
*/
1818
abstract class Create extends \Magento\Backend\App\Action
1919
{
20+
/**
21+
* Indicates how to process post data
22+
*/
23+
private static $actionSave = 'save';
2024
/**
2125
* @var \Magento\Framework\Escaper
2226
*/
@@ -206,7 +210,7 @@ protected function _processActionData($action = null)
206210
/**
207211
* Apply mass changes from sidebar
208212
*/
209-
if ($data = $this->getRequest()->getPost('sidebar')) {
213+
if (($data = $this->getRequest()->getPost('sidebar')) && $action !== self::$actionSave) {
210214
$this->_getOrderCreateModel()->applySidebarData($data);
211215
}
212216

@@ -222,7 +226,8 @@ protected function _processActionData($action = null)
222226
/**
223227
* Adding products to quote from special grid
224228
*/
225-
if ($this->getRequest()->has('item') && !$this->getRequest()->getPost('update_items') && !($action == 'save')
229+
if ($this->getRequest()->has('item') && !$this->getRequest()->getPost('update_items')
230+
&& $action !== self::$actionSave
226231
) {
227232
$items = $this->getRequest()->getPost('item');
228233
$items = $this->_processFiles($items);

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@
294294
<see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/>
295295
</actionGroup>
296296

297+
<!--Assert that the product is not in the order items list-->
298+
<actionGroup name="dontSeeProductInItemsOrdered">
299+
<arguments>
300+
<argument name="product"/>
301+
</arguments>
302+
<dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/>
303+
</actionGroup>
304+
297305
<!--Select Check Money payment method-->
298306
<actionGroup name="SelectCheckMoneyPaymentMethod">
299307
<waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderFormShoppingCartSection">
12+
<element name="addProduct" type="button" selector="//div[@id='sidebar_data_cart']//tr[td[contains(.,'{{name}}')]]//input[contains(@name,'[add_cart_item]')]" timeout="30" parameterized="true"/>
13+
<element name="removeProduct" type="button" selector="//div[@id='sidebar_data_cart']//tr[td[contains(.,'{{name}}')]]//input[contains(@name,'[remove]')]" timeout="30" parameterized="true"/>
14+
</section>
15+
</sections>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminCreateOrderWithSelectedShoppingCartItemsTest">
11+
<annotations>
12+
<title value="Shopping cart items must not be added to the order unless they were moved manually"/>
13+
<stories value="MC-17838: Shopping cart items added to the order created in the admin"/>
14+
<description value="Shopping cart items must not be added to the order unless they were moved manually"/>
15+
<features value="Sales"/>
16+
<severity value="AVERAGE"/>
17+
<group value="Sales"/>
18+
</annotations>
19+
<before>
20+
<!--Set default flat rate shipping method settings-->
21+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
22+
23+
<!--Create customer-->
24+
<createData entity="Simple_US_CA_Customer" stepKey="simpleCustomer"/>
25+
26+
<!--Create category-->
27+
<createData entity="_defaultCategory" stepKey="category1"/>
28+
29+
<!--Create product1-->
30+
<createData entity="_defaultProduct" stepKey="product1">
31+
<requiredEntity createDataKey="category1"/>
32+
</createData>
33+
34+
<!--Create product2-->
35+
<createData entity="_defaultProduct" stepKey="product2">
36+
<requiredEntity createDataKey="category1"/>
37+
</createData>
38+
39+
<!--Login as admin-->
40+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
41+
</before>
42+
43+
<!-- Step 1: Go to Storefront as Customer -->
44+
<actionGroup ref="CustomerLoginOnStorefront" stepKey="customerLogin">
45+
<argument name="customer" value="$$simpleCustomer$$" />
46+
</actionGroup>
47+
48+
<!-- Step 2: Add product to cart -->
49+
<amOnPage url="{{StorefrontProductPage.url($$product1.custom_attributes[url_key]$)}}" stepKey="amOnPage"/>
50+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
51+
<argument name="product" value="$$product1$$"/>
52+
<argument name="productCount" value="1"/>
53+
</actionGroup>
54+
55+
<!--Step 3: Create new customer order-->
56+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
57+
<argument name="customer" value="$$simpleCustomer$$"/>
58+
</actionGroup>
59+
60+
<!--Step 4: Add product2 to the order-->
61+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder">
62+
<argument name="product" value="$$product2$$"/>
63+
</actionGroup>
64+
65+
<!--Step 5: Select product1 in the shopping cart-->
66+
<click selector="{{AdminOrderFormShoppingCartSection.addProduct($$product1.name$$)}}" stepKey="selectProduct1InTheShoppingCart"/>
67+
68+
<!--Step 6: Select FlatRate shipping method-->
69+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/>
70+
71+
<!--Step 7: Submit order-->
72+
<actionGroup ref="SubmitOrderActionGroup" stepKey="submitOrder"/>
73+
74+
<!--Step 8: Verify order information-->
75+
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/>
76+
77+
<!--Step 9: Check that product 2 is in the order items list -->
78+
<actionGroup ref="seeProductInItemsOrdered" stepKey="seeProduct2InItemsOrdered">
79+
<argument name="product" value="$$product2$$"/>
80+
</actionGroup>
81+
82+
<!--Step 10: Check that product 1 is not in the order items list -->
83+
<actionGroup ref="dontSeeProductInItemsOrdered" stepKey="dontSeeProduct1InItemsOrdered">
84+
<argument name="product" value="$$product1$$"/>
85+
</actionGroup>
86+
<after>
87+
<!--Delete product1-->
88+
<deleteData createDataKey="product1" stepKey="deleteProduct1"/>
89+
90+
<!--Delete product2-->
91+
<deleteData createDataKey="product2" stepKey="deleteProduct2"/>
92+
93+
<!--Delete category-->
94+
<deleteData createDataKey="category1" stepKey="deleteCategory1"/>
95+
96+
<!--Delete customer-->
97+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
98+
99+
<!--Logout-->
100+
<actionGroup ref="logout" stepKey="logout"/>
101+
</after>
102+
</test>
103+
</tests>

app/code/Magento/Signifyd/etc/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
<argument name="converter" xsi:type="object">Magento\Signifyd\Model\PaymentMethodMapper\XmlToArrayConfigConverter</argument>
6969
<argument name="schemaLocator" xsi:type="object">PaymentMapperSchemaLocator</argument>
7070
<argument name="fileName" xsi:type="string">signifyd_payment_mapping.xml</argument>
71+
<argument name="idAttributes" xsi:type="array">
72+
<item name="/config/payment_method_list/payment_method" xsi:type="string">name</item>
73+
</argument>
7174
</arguments>
7275
</virtualType>
7376
<virtualType name="PaymentMethodConfigData" type="Magento\Framework\Config\Data">

0 commit comments

Comments
 (0)