Skip to content

Commit dd925fd

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MC-18719
2 parents 30e0bbb + f62adcc commit dd925fd

File tree

68 files changed

+1400
-188
lines changed

Some content is hidden

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

68 files changed

+1400
-188
lines changed

app/code/Magento/AmqpStore/Plugin/Framework/Amqp/Bulk/Exchange.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function beforeEnqueue(SubjectExchange $subject, $topic, array $envelopes
9191
if ($headers instanceof AMQPTable) {
9292
try {
9393
$headers->set('store_id', $storeId);
94-
// phpcs:ignore Magento2.Exceptions.ThrowCatch
9594
} catch (AMQPInvalidArgumentException $ea) {
9695
$errorMessage = sprintf("Can't set storeId to amqp message. Error %s.", $ea->getMessage());
9796
$this->logger->error($errorMessage);

app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public function execute()
127127
$adminSession->destroy();
128128

129129
$response->setRedirectUrl($this->getUrl('*'));
130-
// phpcs:disable Magento2.Exceptions.ThrowCatch
131130
} catch (\Magento\Framework\Backup\Exception\CantLoadSnapshot $e) {
132131
$errorMsg = __('We can\'t find the backup file.');
133132
} catch (\Magento\Framework\Backup\Exception\FtpConnectionFailed $e) {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Braintree\Plugin;
9+
10+
use Magento\Quote\Model\QuoteManagement;
11+
use Magento\Quote\Api\CartManagementInterface;
12+
use Magento\Quote\Model\Quote;
13+
14+
/**
15+
* Plugin for QuoteManagement to disable quote address validation
16+
*/
17+
class DisableQuoteAddressValidation
18+
{
19+
/**
20+
* Disable quote address validation before submit order
21+
*
22+
* @param QuoteManagement $subject
23+
* @param Quote $quote
24+
* @param array $orderData
25+
* @return array
26+
* @throws \Exception
27+
* @throws \Magento\Framework\Exception\LocalizedException
28+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
29+
*/
30+
public function beforeSubmit(
31+
QuoteManagement $subject,
32+
Quote $quote,
33+
$orderData = []
34+
) {
35+
if ($quote->getPayment()->getMethod() == 'braintree_paypal' &&
36+
$quote->getCheckoutMethod() == CartManagementInterface::METHOD_GUEST) {
37+
$billingAddress = $quote->getBillingAddress();
38+
$billingAddress->setShouldIgnoreValidation(true);
39+
$quote->setBillingAddress($billingAddress);
40+
}
41+
return [$quote, $orderData];
42+
}
43+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,4 +627,7 @@
627627
<type name="Magento\Quote\Api\CartManagementInterface">
628628
<plugin name="order_cancellation" type="Magento\Braintree\Plugin\OrderCancellation"/>
629629
</type>
630+
<type name="Magento\Quote\Model\QuoteManagement">
631+
<plugin name="disable_quote_address_validation" type="Magento\Braintree\Plugin\DisableQuoteAddressValidation"/>
632+
</type>
630633
</config>

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,17 @@ define([
187187
*/
188188
setBillingAddress: function (customer, address) {
189189
var billingAddress = {
190-
street: [address.streetAddress],
191-
city: address.locality,
190+
street: [address.line1],
191+
city: address.city,
192192
postcode: address.postalCode,
193-
countryId: address.countryCodeAlpha2,
193+
countryId: address.countryCode,
194194
email: customer.email,
195195
firstname: customer.firstName,
196196
lastname: customer.lastName,
197-
telephone: customer.phone
197+
telephone: customer.phone,
198+
regionCode: address.state
198199
};
199200

200-
billingAddress['region_code'] = address.region;
201201
billingAddress = createBillingAddress(billingAddress);
202202
quote.billingAddress(billingAddress);
203203
},
@@ -209,10 +209,12 @@ define([
209209
beforePlaceOrder: function (payload) {
210210
this.setPaymentPayload(payload);
211211

212-
if ((this.isRequiredBillingAddress() || quote.billingAddress() === null) &&
213-
typeof payload.details.billingAddress !== 'undefined'
214-
) {
215-
this.setBillingAddress(payload.details, payload.details.billingAddress);
212+
if (this.isRequiredBillingAddress() || quote.billingAddress() === null) {
213+
if (typeof payload.details.billingAddress !== 'undefined') {
214+
this.setBillingAddress(payload.details, payload.details.billingAddress);
215+
} else {
216+
this.setBillingAddress(payload.details, payload.details.shippingAddress);
217+
}
216218
}
217219

218220
if (this.isSkipOrderReview()) {

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/Catalog/Model/Category.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
131131
'page_layout',
132132
'custom_layout_update',
133133
'custom_apply_to_products',
134+
'custom_use_parent_settings',
134135
];
135136

136137
/**
@@ -331,9 +332,11 @@ protected function getCustomAttributesCodes()
331332
* @throws \Magento\Framework\Exception\LocalizedException
332333
* @return \Magento\Catalog\Model\ResourceModel\Category
333334
* @deprecated because resource models should be used directly
335+
* phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod
334336
*/
335337
protected function _getResource()
336338
{
339+
//phpcs:enable Generic.CodeAnalysis.UselessOverridingMethod
337340
return parent::_getResource();
338341
}
339342
// phpcs:enable

app/code/Magento/Catalog/Model/Product/Gallery/GalleryManagement.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ public function create($sku, ProductAttributeMediaGalleryEntryInterface $entry)
7171
$product->setMediaGalleryEntries($existingMediaGalleryEntries);
7272
try {
7373
$product = $this->productRepository->save($product);
74-
// phpcs:ignore Magento2.Exceptions.ThrowCatch
7574
} catch (InputException $inputException) {
7675
throw $inputException;
77-
// phpcs:ignore Magento2.Exceptions.ThrowCatch
7876
} catch (\Exception $e) {
7977
throw new StateException(__("The product can't be saved."));
8078
}

0 commit comments

Comments
 (0)