Skip to content

Commit edafa51

Browse files
Merge pull request #4732 from magento-tsg-csl3/2.3-develop-pr31
[TSG-CSL3] For 2.3 (pr31)
2 parents e95cca3 + 79b8a19 commit edafa51

File tree

18 files changed

+398
-109
lines changed

18 files changed

+398
-109
lines changed

app/code/Magento/Bundle/Plugin/UpdatePriceInQuoteItemOptions.php

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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="BundleProductWithTierPriceInCartTest">
11+
<annotations>
12+
<features value="Bundle"/>
13+
<stories value="Check that price of cart is correct when the bundle product added to the cart twice"/>
14+
<title value="Customer should get the right subtotal in cart when the bundle product added to the cart twice"/>
15+
<description value="Customer should be able to add one more bundle product to the cart and get the right price"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-19727"/>
18+
<group value="bundle"/>
19+
</annotations>
20+
<before>
21+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
22+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
23+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
27+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
28+
<actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/>
29+
<actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid">
30+
<argument name="product" value="BundleProduct"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFiltersAfter"/>
33+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
34+
<argument name="customerEmail" value="CustomerEntityOne.email"/>
35+
</actionGroup>
36+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/>
37+
</after>
38+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/>
39+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
40+
<actionGroup ref="fillMainBundleProductForm" stepKey="fillMainFieldsForBundle"/>
41+
<actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption1">
42+
<argument name="x" value="0"/>
43+
<argument name="n" value="1"/>
44+
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
45+
<argument name="prodTwoSku" value=""/>
46+
<argument name="optionTitle" value="Option1"/>
47+
<argument name="inputType" value="checkbox"/>
48+
</actionGroup>
49+
<actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption2">
50+
<argument name="x" value="1"/>
51+
<argument name="n" value="2"/>
52+
<argument name="prodOneSku" value="$$simpleProduct2.sku$$"/>
53+
<argument name="prodTwoSku" value=""/>
54+
<argument name="optionTitle" value="Option2"/>
55+
<argument name="inputType" value="checkbox"/>
56+
</actionGroup>
57+
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
58+
<actionGroup ref="ProductSetAdvancedPricing" stepKey="addTierPriceProduct">
59+
<argument name="group" value="ALL GROUPS"/>
60+
<argument name="quantity" value="1"/>
61+
<argument name="price" value="Discount"/>
62+
<argument name="amount" value="50"/>
63+
</actionGroup>
64+
<actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser">
65+
<argument name="Customer" value="CustomerEntityOne"/>
66+
</actionGroup>
67+
<amOnPage url="{{StorefrontProductPage.url(BundleProduct.urlKey)}}" stepKey="goToStorefront"/>
68+
<waitForPageLoad stepKey="waitForStorefront"/>
69+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickOnCustomizeAndAddToCartButton"/>
70+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
71+
<argument name="quantity" value="1"/>
72+
</actionGroup>
73+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCartAgain">
74+
<argument name="quantity" value="1"/>
75+
</actionGroup>
76+
<actionGroup ref="AssertSubTotalOnStorefrontMiniCartActionGroup" stepKey="assertSubTotalOnStorefrontMiniCart">
77+
<argument name="subTotal" value="$246.00"/>
78+
</actionGroup>
79+
</test>
80+
</tests>

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@
123123
</argument>
124124
</arguments>
125125
</type>
126-
<type name="Magento\Quote\Model\Quote\Item">
127-
<plugin name="update_price_for_bundle_in_quote_item_option" type="Magento\Bundle\Plugin\UpdatePriceInQuoteItemOptions"/>
128-
</type>
129126
<type name="Magento\Quote\Model\Quote\Item\ToOrderItem">
130127
<plugin name="append_bundle_data_to_order" type="Magento\Bundle\Model\Plugin\QuoteItem"/>
131128
</type>

app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,8 @@ protected function _collectOptionMainData(
14581458
) {
14591459
if ($this->_isPriceGlobal) {
14601460
$prices[$nextOptionId][Store::DEFAULT_STORE_ID] = $priceData;
1461+
} else {
1462+
$prices[$nextOptionId][$this->_rowStoreId] = $priceData;
14611463
}
14621464
}
14631465

app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ public function __construct(
7676
*/
7777
public function resolve(): SearchCriteria
7878
{
79-
$this->builder->setPageSize($this->size);
79+
if ($this->size !== 0) {
80+
$this->builder->setPageSize($this->size);
81+
}
8082
$searchCriteria = $this->builder->create();
8183
$searchCriteria->setRequestName($this->searchRequestName);
8284
$searchCriteria->setSortOrders($this->orders);

app/code/Magento/Elasticsearch/Test/Unit/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolverTest.php

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,18 @@ protected function setUp()
3434
}
3535

3636
/**
37-
* @param array|null $orders
38-
* @param array|null $expected
37+
* @param array $params
38+
* @param array $expected
3939
* @dataProvider resolveSortOrderDataProvider
4040
*/
41-
public function testResolve($orders, $expected)
41+
public function testResolve($params, $expected)
4242
{
4343
$searchRequestName = 'test';
4444
$currentPage = 1;
45-
$size = 10;
45+
$size = $params['size'];
46+
$expectedSize = $expected['size'];
47+
$orders = $params['orders'];
48+
$expectedOrders = $expected['orders'];
4649

4750
$searchCriteria = $this->getMockBuilder(SearchCriteria::class)
4851
->disableOriginalConstructor()
@@ -54,7 +57,7 @@ public function testResolve($orders, $expected)
5457
->willReturn($searchCriteria);
5558
$searchCriteria->expects($this->once())
5659
->method('setSortOrders')
57-
->with($expected)
60+
->with($expectedOrders)
5861
->willReturn($searchCriteria);
5962
$searchCriteria->expects($this->once())
6063
->method('setCurrentPage')
@@ -64,10 +67,16 @@ public function testResolve($orders, $expected)
6467
$this->searchCriteriaBuilder->expects($this->once())
6568
->method('create')
6669
->willReturn($searchCriteria);
67-
$this->searchCriteriaBuilder->expects($this->once())
68-
->method('setPageSize')
69-
->with($size)
70-
->willReturn($this->searchCriteriaBuilder);
70+
71+
if ($expectedSize === null) {
72+
$this->searchCriteriaBuilder->expects($this->never())
73+
->method('setPageSize');
74+
} else {
75+
$this->searchCriteriaBuilder->expects($this->once())
76+
->method('setPageSize')
77+
->with($expectedSize)
78+
->willReturn($this->searchCriteriaBuilder);
79+
}
7180

7281
$objectManager = new ObjectManagerHelper($this);
7382
/** @var SearchCriteriaResolver $model */
@@ -92,12 +101,12 @@ public function resolveSortOrderDataProvider()
92101
{
93102
return [
94103
[
95-
null,
96-
null,
104+
['size' => 0, 'orders' => null],
105+
['size' => null, 'orders' => null],
97106
],
98107
[
99-
['test' => 'ASC'],
100-
['test' => 'ASC'],
108+
['size' => 10, 'orders' => ['test' => 'ASC']],
109+
['size' => 10, 'orders' => ['test' => 'ASC']],
101110
],
102111
];
103112
}

app/code/Magento/Review/view/frontend/templates/product/view/list.phtml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ $format = $block->getDateFormat() ?: \IntlDateFormatter::SHORT;
1111
?>
1212
<?php if (count($_items)) : ?>
1313
<div class="block review-list" id="customer-reviews">
14-
<div class="block-title">
15-
<strong><?= $block->escapeHtml(__('Customer Reviews')) ?></strong>
16-
</div>
14+
<?php if (!$block->getHideTitle()) : ?>
15+
<div class="block-title">
16+
<strong><?= $block->escapeHtml(__('Customer Reviews')) ?></strong>
17+
</div>
18+
<?php endif ?>
1719
<div class="block-content">
1820
<div class="toolbar review-toolbar">
1921
<?= $block->getChildHtml('toolbar') ?>

app/code/Magento/SalesRule/Model/Validator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ public function canApplyRules(AbstractItem $item)
243243
public function reset(Address $address)
244244
{
245245
$this->validatorUtility->resetRoundingDeltas();
246+
$address->setBaseSubtotalWithDiscount($address->getBaseSubtotal());
247+
$address->setSubtotalWithDiscount($address->getSubtotal());
246248
if ($this->_isFirstTimeResetRun) {
247249
$address->setAppliedRuleIds('');
248250
$address->getQuote()->setAppliedRuleIds('');

app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private function findCurrentRewrite(UrlRewrite $oldRewrite, StoreInterface $targ
111111
if (!$currentRewrite) {
112112
$currentRewrite = $this->urlFinder->findOneByData(
113113
[
114-
UrlRewrite::REQUEST_PATH => $oldRewrite->getTargetPath(),
114+
UrlRewrite::REQUEST_PATH => $oldRewrite->getRequestPath(),
115115
UrlRewrite::STORE_ID => $targetStore->getId(),
116116
]
117117
);

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ public function testSaveCustomOptions(string $importFile, string $sku, int $expe
376376
/**
377377
* Tests adding of custom options with multiple store views
378378
*
379-
* @magentoDataFixture Magento/Store/_files/second_store.php
380-
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
379+
* @magentoConfigFixture current_store catalog/price/scope 1
380+
* @magentoDataFixture Magento/Store/_files/core_second_third_fixturestore.php
381381
* @magentoAppIsolation enabled
382382
*/
383383
public function testSaveCustomOptionsWithMultipleStoreViews()
@@ -388,7 +388,7 @@ public function testSaveCustomOptionsWithMultipleStoreViews()
388388
$storeCodes = [
389389
'admin',
390390
'default',
391-
'fixture_second_store',
391+
'secondstore',
392392
];
393393
/** @var \Magento\Store\Model\StoreManagerInterface $storeManager */
394394
$importFile = 'product_with_custom_options_and_multiple_store_views.csv';

0 commit comments

Comments
 (0)