Skip to content

Commit 6fe5c10

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into MC-19746
# Conflicts: # app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddress/SelectedShippingMethod.php # dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedShippingMethodTest.php
2 parents af414b0 + d93d288 commit 6fe5c10

File tree

41 files changed

+952
-224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+952
-224
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
5050

5151
const VALIDATOR_WEBSITE = 'validator_website';
5252

53-
const VALIDATOR_TEAR_PRICE = 'validator_tear_price';
53+
/**
54+
* @deprecated
55+
* @see VALIDATOR_TIER_PRICE
56+
*/
57+
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';
58+
59+
private const VALIDATOR_TIER_PRICE = 'validator_tier_price';
5460

5561
/**
5662
* Validation failure message template definitions.
@@ -221,7 +227,7 @@ public function __construct(
221227
$this->_catalogProductEntity = $this->_resourceFactory->create()->getTable('catalog_product_entity');
222228
$this->_oldSkus = $this->retrieveOldSkus();
223229
$this->_validators[self::VALIDATOR_WEBSITE] = $websiteValidator;
224-
$this->_validators[self::VALIDATOR_TEAR_PRICE] = $tierPriceValidator;
230+
$this->_validators[self::VALIDATOR_TIER_PRICE] = $tierPriceValidator;
225231
$this->errorAggregator = $errorAggregator;
226232

227233
foreach (array_merge($this->errorMessageTemplates, $this->_messageTemplates) as $errorCode => $message) {
@@ -536,7 +542,7 @@ protected function getWebSiteId($websiteCode)
536542
*/
537543
protected function getCustomerGroupId($customerGroup)
538544
{
539-
$customerGroups = $this->_getValidator(self::VALIDATOR_TEAR_PRICE)->getCustomerGroups();
545+
$customerGroups = $this->_getValidator(self::VALIDATOR_TIER_PRICE)->getCustomerGroups();
540546
return $customerGroup == self::VALUE_ALL_GROUPS ? 0 : $customerGroups[$customerGroup];
541547
}
542548

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\AbstractImportTestCase
1717
{
18+
/**
19+
* DB Table data
20+
*/
1821
const TABLE_NAME = 'tableName';
1922
const LINK_FIELD = 'linkField';
2023

@@ -54,7 +57,7 @@ class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\A
5457
protected $websiteValidator;
5558

5659
/**
57-
* @var AdvancedPricing\Validator\TearPrice |\PHPUnit_Framework_MockObject_MockObject
60+
* @var AdvancedPricing\Validator\TierPrice |\PHPUnit_Framework_MockObject_MockObject
5861
*/
5962
protected $tierPriceValidator;
6063

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function getChildFinalPrice($product, $productQty, $childProduct, $childP
204204
}
205205

206206
/**
207-
* Gets the 'tear_price' array from the product
207+
* Gets the 'tier_price' array from the product
208208
*
209209
* @param Product $product
210210
* @param string $key

app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/GroupPrice/AbstractTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ public function testGetAffectedFields()
6565
$attribute->expects($this->any())->method('getAttributeId')->will($this->returnValue($attributeId));
6666
$attribute->expects($this->any())->method('isStatic')->will($this->returnValue(false));
6767
$attribute->expects($this->any())->method('getBackendTable')->will($this->returnValue('table'));
68-
$attribute->expects($this->any())->method('getName')->will($this->returnValue('tear_price'));
68+
$attribute->expects($this->any())->method('getName')->will($this->returnValue('tier_price'));
6969
$this->_model->setAttribute($attribute);
7070

7171
$object = new \Magento\Framework\DataObject();
72-
$object->setTearPrice([['price_id' => 10]]);
72+
$object->setTierPrice([['price_id' => 10]]);
7373
$object->setId(555);
7474

7575
$this->assertEquals(

app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class BasePriceTest extends \PHPUnit\Framework\TestCase
3939
/**
4040
* @var \Magento\Catalog\Pricing\Price\TierPrice|\PHPUnit_Framework_MockObject_MockObject
4141
*/
42-
protected $tearPriceMock;
42+
protected $tierPriceMock;
4343

4444
/**
4545
* @var \Magento\Catalog\Pricing\Price\SpecialPrice|\PHPUnit_Framework_MockObject_MockObject
@@ -60,7 +60,7 @@ protected function setUp()
6060
$this->saleableItemMock = $this->createMock(\Magento\Catalog\Model\Product::class);
6161
$this->priceInfoMock = $this->createMock(\Magento\Framework\Pricing\PriceInfo\Base::class);
6262
$this->regularPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\RegularPrice::class);
63-
$this->tearPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\TierPrice::class);
63+
$this->tierPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\TierPrice::class);
6464
$this->specialPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\SpecialPrice::class);
6565
$this->calculatorMock = $this->createMock(\Magento\Framework\Pricing\Adjustment\Calculator::class);
6666

@@ -69,7 +69,7 @@ protected function setUp()
6969
->will($this->returnValue($this->priceInfoMock));
7070
$this->prices = [
7171
'regular_price' => $this->regularPriceMock,
72-
'tear_price' => $this->tearPriceMock,
72+
'tier_price' => $this->tierPriceMock,
7373
'special_price' => $this->specialPriceMock,
7474
];
7575

@@ -97,7 +97,7 @@ public function testGetValue($specialPriceValue, $expectedResult)
9797
$this->regularPriceMock->expects($this->exactly(3))
9898
->method('getValue')
9999
->will($this->returnValue(100));
100-
$this->tearPriceMock->expects($this->exactly(2))
100+
$this->tierPriceMock->expects($this->exactly(2))
101101
->method('getValue')
102102
->will($this->returnValue(99));
103103
$this->specialPriceMock->expects($this->any())

app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function testUpdateCatalogRuleGroupWebsiteData()
252252
);
253253
$resourceMock->expects($this->any())
254254
->method('getMainTable')
255-
->will($this->returnValue('catalog_product_entity_tear_price'));
255+
->will($this->returnValue('catalog_product_entity_tier_price'));
256256
$backendModelMock->expects($this->any())
257257
->method('getResource')
258258
->will($this->returnValue($resourceMock));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ define([
347347
if ($(this).find('.options').length > 0) {
348348
$(this).collapsible();
349349
}
350-
outerHeight = $(this).outerHeight();
350+
outerHeight = $(this).outerHeight(true);
351351

352352
if (counter-- > 0) {
353353
height += outerHeight;

app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddress/AvailableShippingMethods.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
7575
);
7676
$methods[] = $this->processMoneyTypeData(
7777
$methodData,
78-
$cart->getQuoteCurrencyCode(),
79-
$context->getExtensionAttributes()->getStore()
78+
$cart->getQuoteCurrencyCode()
8079
);
8180
}
8281
}
@@ -88,21 +87,17 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
8887
*
8988
* @param array $data
9089
* @param string $quoteCurrencyCode
91-
* @param StoreInterface $store
9290
* @return array
9391
* @throws NoSuchEntityException
9492
*/
95-
private function processMoneyTypeData(array $data, string $quoteCurrencyCode, StoreInterface $store): array
93+
private function processMoneyTypeData(array $data, string $quoteCurrencyCode): array
9694
{
9795
if (isset($data['amount'])) {
9896
$data['amount'] = ['value' => $data['amount'], 'currency' => $quoteCurrencyCode];
9997
}
10098

101-
if (isset($data['base_amount'])) {
102-
/** @var Currency $currency */
103-
$currency = $store->getBaseCurrency();
104-
$data['base_amount'] = ['value' => $data['base_amount'], 'currency' => $currency->getCode()];
105-
}
99+
/** @deprecated The field should not be used on the storefront */
100+
$data['base_amount'] = null;
106101

107102
if (isset($data['price_excl_tax'])) {
108103
$data['price_excl_tax'] = ['value' => $data['price_excl_tax'], 'currency' => $quoteCurrencyCode];

app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddress/SelectedShippingMethod.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
4646
}
4747
}
4848

49-
/** @var Currency $currency */
50-
$currency = $context->getExtensionAttributes()->getStore()->getBaseCurrency();
51-
5249
$data = [
5350
'carrier_code' => $carrierCode,
5451
'method_code' => $methodCode,
@@ -58,10 +55,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
5855
'value' => $address->getShippingAmount(),
5956
'currency' => $address->getQuote()->getQuoteCurrencyCode(),
6057
],
61-
'base_amount' => [
62-
'value' => $address->getBaseShippingAmount(),
63-
'currency' => $currency->getCode(),
64-
],
58+
/** @deprecated The field should not be used on the storefront */
59+
'base_amount' => null,
6560
];
6661
} else {
6762
$data = null;

app/code/Magento/QuoteGraphQl/etc/schema.graphqls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ type SelectedShippingMethod {
244244
carrier_title: String
245245
method_title: String
246246
amount: Money
247-
base_amount: Money
247+
base_amount: Money @deprecated(reason: "The field should not be used on the storefront")
248248
}
249249

250250
type AvailableShippingMethod {
@@ -254,7 +254,7 @@ type AvailableShippingMethod {
254254
method_title: String @doc(description: "Could be null if method is not available")
255255
error_message: String
256256
amount: Money!
257-
base_amount: Money @doc(description: "Could be null if method is not available")
257+
base_amount: Money @deprecated(reason: "The field should not be used on the storefront")
258258
price_excl_tax: Money!
259259
price_incl_tax: Money!
260260
available: Boolean!

0 commit comments

Comments
 (0)