Skip to content

Commit 296e280

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop expedited
Accepted Community Pull Requests: - #24643: Resolve No error message when click "Import Tax Rates" without select file issue24642 (by @edenduong) - #24627: Webapi Swagger schema generation fail in case when Get endpoint has param with Extension Attributes [Case#2] (by @swnsma) - #24530: Fix the false directory path comparison failure, which causes incorrect error message for no writable permission. (by @Hailong) - #24622: fix for the #24618 Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js accessing undefined variables (by @speedupmate) - #24605: Fixes problem with wrong image URL in sitemap (by @krisdante) - #24580: Fixed downloadable selected links price not added to product main price on cart configure page. #24579 (by @rani-webkul) - #24300: Adding out of stock items to wishlist shows success message but fails #21519 (by @Rus0) - #24270: add config for disabling swatch tooltips (by @torhoehn) - #24089: Fixed product back redirect navigate from customer view cart product (by @ravi-chandra3197) Fixed GitHub Issues: - #24642: No error message when click "Import Tax Rates" without select file (reported by @edenduong) has been fixed in #24643 by @edenduong in 2.3-develop branch Related commits: 1. 77562da - #24626: Webapi Swagger schema generation fail in case when Get endpoint has param with Extension Attributes [Case#2] (reported by @swnsma) has been fixed in #24627 by @swnsma in 2.3-develop branch Related commits: 1. a7e043c 2. 7e30a18 3. 9bbbf04 4. 8dd8768 5. f1eb7a3 - #24618: Magento_Braintree/js/view/payment/method-renderer/paypal.js accessing undefined variables (reported by @speedupmate) has been fixed in #24622 by @speedupmate in 2.3-develop branch Related commits: 1. d8534d2 - #4511: XML Sitemap refers to non-watermarked images (reported by @thomvanderboon) has been fixed in #24605 by @krisdante in 2.3-develop branch Related commits: 1. 6ab019b 2. b7059a6 3. 861e9f9 - #5321: Images added to sitemap are "404 Not Found" on Nginx [Magento 2.1.0] (reported by @RG-1) has been fixed in #24605 by @krisdante in 2.3-develop branch Related commits: 1. 6ab019b 2. b7059a6 3. 861e9f9 - #24484: sitemap image URLs has wrong cache path (reported by @bst2002git) has been fixed in #24605 by @krisdante in 2.3-develop branch Related commits: 1. 6ab019b 2. b7059a6 3. 861e9f9 - #24579: Downloadable selected links price not added to product main price on cart configure page. (reported by @rani-webkul) has been fixed in #24580 by @rani-webkul in 2.3-develop branch Related commits: 1. 3d07b8e 2. 2f6332c - #21519: Adding out of stock items to wishlist shows success message but fails (reported by @netjordanlee) has been fixed in #24300 by @Rus0 in 2.3-develop branch Related commits: 1. 8048c09 2. 8f491d3 3. 91f8f88 4. 6753604 5. 71d1ebc 6. 9a1b781 7. 964105c
2 parents a8fe42b + 562ff54 commit 296e280

File tree

33 files changed

+1010
-169
lines changed

33 files changed

+1010
-169
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ define([
336336
}
337337

338338
return {
339-
line1: address.street[0],
339+
line1: _.isUndefined(address.street) || _.isUndefined(address.street[0]) ? '' : address.street[0],
340340
city: address.city,
341341
state: address.regionCode,
342342
postalCode: address.postcode,

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Button/Back.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,32 @@
1111
class Back extends Generic
1212
{
1313
/**
14+
* Get Button Data
15+
*
1416
* @return array
1517
*/
1618
public function getButtonData()
1719
{
1820
return [
1921
'label' => __('Back'),
20-
'on_click' => sprintf("location.href = '%s';", $this->getUrl('*/*/')),
22+
'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()),
2123
'class' => 'back',
2224
'sort_order' => 10
2325
];
2426
}
27+
/**
28+
* Get URL for back
29+
*
30+
* @return string
31+
*/
32+
private function getBackUrl()
33+
{
34+
if ($this->context->getRequestParam('customerId')) {
35+
return $this->getUrl(
36+
'customer/index/edit',
37+
['id' => $this->context->getRequestParam('customerId')]
38+
);
39+
}
40+
return $this->getUrl('*/*/');
41+
}
2542
}

app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function __construct(
7575
}
7676

7777
/**
78-
* {@inheritdoc}
78+
* @inheritdoc
7979
*/
8080
protected function _construct()
8181
{
@@ -119,7 +119,7 @@ protected function _prepareCollection()
119119
}
120120

121121
/**
122-
* {@inheritdoc}
122+
* @inheritdoc
123123
*/
124124
protected function _prepareColumns()
125125
{
@@ -201,7 +201,7 @@ public function getCustomerId()
201201
}
202202

203203
/**
204-
* {@inheritdoc}
204+
* @inheritdoc
205205
*/
206206
public function getGridUrl()
207207
{
@@ -224,7 +224,13 @@ public function getGridParentHtml()
224224
*/
225225
public function getRowUrl($row)
226226
{
227-
return $this->getUrl('catalog/product/edit', ['id' => $row->getProductId()]);
227+
return $this->getUrl(
228+
'catalog/product/edit',
229+
[
230+
'id' => $row->getProductId(),
231+
'customerId' => $this->getCustomerId()
232+
]
233+
);
228234
}
229235

230236
/**

app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<section name="AdminCustomerAddressesGridSection"/>
1313
<section name="AdminCustomerAddressesGridActionsSection"/>
1414
<section name="AdminCustomerAddressesSection"/>
15+
<section name="AdminCustomerCartSection" />
16+
<section name="AdminCustomerInformationSection" />
1517
<section name="AdminCustomerMainActionsSection"/>
1618
<section name="AdminEditCustomerAddressesSection" />
1719
</page>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="AdminCustomerCartSection">
12+
<element name="cartItem" type="button" selector="#customer_cart_grid_table tbody tr:nth-of-type({{row}}) .col-product_id" parameterized="true" timeout="5"/>
13+
</section>
14+
</sections>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminCustomerInformationSection">
12+
<element name="customerView" type="button" selector="#tab_customer_edit_tab_view_content"/>
13+
<element name="accountInformation" type="button" selector="#tab_customer"/>
14+
<element name="addresses" type="button" selector="#tab_address"/>
15+
<element name="orders" type="button" selector="#tab_orders_content"/>
16+
<element name="shoppingCart" type="button" selector="#tab_cart_content"/>
17+
<element name="newsletter" type="button" selector="#tab_newsletter_content"/>
18+
<element name="billingAgreements" type="button" selector="#tab_customer_edit_tab_agreements_content"/>
19+
<element name="productReviews" type="button" selector="#tab_reviews_content"/>
20+
<element name="wishList" type="button" selector="#tab_wishlist_content"/>
21+
</section>
22+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminProductBackRedirectNavigateFromCustomerViewCartProduct">
12+
<annotations>
13+
<features value="Customer"/>
14+
<title value="Product back redirect navigate from customer view cart product"/>
15+
<description value="Back button on product page is redirecting to customer page if opened form shopping cart"/>
16+
<severity value="MINOR"/>
17+
<group value="Customer"/>
18+
</annotations>
19+
<before>
20+
<!-- Create new product-->
21+
<createData entity="_defaultCategory" stepKey="createCategory"/>
22+
<createData entity="_defaultProduct" stepKey="createProduct">
23+
<requiredEntity createDataKey="createCategory"/>
24+
</createData>
25+
26+
<!-- Create new customer-->
27+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
28+
29+
<!-- Login as admin-->
30+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
31+
</before>
32+
33+
<!-- Go to storefront as customer-->
34+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
35+
<argument name="Customer" value="$$createCustomer$$"/>
36+
</actionGroup>
37+
38+
<!-- Add product to cart -->
39+
<actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart">
40+
<argument name="product" value="$$createProduct$$"/>
41+
</actionGroup>
42+
43+
<!-- Navigate to customer edit page in admin -->
44+
<amOnPage url="{{AdminCustomerPage.url}}edit/id/$$createCustomer.id$$/" stepKey="openCustomerEditPage"/>
45+
<waitForPageLoad stepKey="waitForCustomerEditPage"/>
46+
47+
<!-- Open shopping cart -->
48+
<click selector="{{AdminCustomerInformationSection.shoppingCart}}" stepKey="clickShoppingCartButton"/>
49+
<waitForPageLoad stepKey="waitForPageLoaded"/>
50+
51+
<!-- Open product -->
52+
<click selector="{{AdminCustomerCartSection.cartItem('1')}}" stepKey="openProduct"/>
53+
54+
<!-- Go back to customer page -->
55+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="goBackToCustomerPage"/>
56+
57+
<!-- Check current page is customer page -->
58+
<seeInCurrentUrl stepKey="onCustomerAccountPage" url="{{AdminCustomerPage.url}}edit/id/$$createCustomer.id$$/"/>
59+
60+
<after>
61+
<!--Delete product-->
62+
<deleteData stepKey="deleteProduct" createDataKey="createProduct"/>
63+
64+
<!--Delete category-->
65+
<deleteData stepKey="deleteCategory" createDataKey="createCategory"/>
66+
67+
<!--Delete customer-->
68+
<deleteData stepKey="deleteCustomer" createDataKey="createCustomer"/>
69+
70+
<!-- Sign out-->
71+
<actionGroup ref="SignOut" stepKey="signOut"/>
72+
</after>
73+
</test>
74+
</tests>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="EditDownloadableProductWithSeparateLinksFromCartTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create Downloadable Product"/>
15+
<title value="Edit downloadable product with separate links from cart test"/>
16+
<description value="Product price should remain correct when editing downloadable product with separate links from cart."/>
17+
<severity value="MAJOR"/>
18+
<group value="Downloadable"/>
19+
</annotations>
20+
<before>
21+
<!-- Create category -->
22+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
23+
24+
<!-- Login as admin -->
25+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
26+
27+
<!-- Create downloadable product -->
28+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
29+
<waitForPageLoad stepKey="waitForProductGridPageLoad"/>
30+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct">
31+
<argument name="productType" value="downloadable"/>
32+
</actionGroup>
33+
34+
<!-- Fill downloadable product values -->
35+
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm">
36+
<argument name="product" value="DownloadableProduct"/>
37+
</actionGroup>
38+
39+
<!-- Add downloadable product to category -->
40+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}"
41+
parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/>
42+
43+
<!-- Fill downloadable link information before the creation link -->
44+
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/>
45+
46+
<!-- Links can be purchased separately -->
47+
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}"
48+
stepKey="checkOptionPurchaseSeparately"/>
49+
50+
<!-- Add first downloadable link -->
51+
<actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink">
52+
<argument name="link" value="downloadableLinkWithMaxDownloads"/>
53+
</actionGroup>
54+
55+
<!-- Add second downloadable link -->
56+
<actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink">
57+
<argument name="link" value="downloadableLink"/>
58+
</actionGroup>
59+
60+
<!-- Save product -->
61+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
62+
</before>
63+
<after>
64+
<!-- Delete category -->
65+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
66+
67+
<!-- Delete created downloadable product -->
68+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
69+
<argument name="product" value="DownloadableProduct"/>
70+
</actionGroup>
71+
72+
<!-- Log out -->
73+
<actionGroup ref="logout" stepKey="logout"/>
74+
</after>
75+
76+
<!-- Step 1: Navigate to store front Product page as guest -->
77+
<amOnPage url="/{{DownloadableProduct.sku}}.html"
78+
stepKey="amOnStorefrontProductPage"/>
79+
80+
<!-- Step 2: Add checkbox for first link -->
81+
<click
82+
selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}"
83+
stepKey="selectProductLink"/>
84+
85+
<!-- Step 3: Add the Product to cart -->
86+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
87+
<argument name="product" value="DownloadableProduct"/>
88+
<argument name="productCount" value="1"/>
89+
</actionGroup>
90+
91+
<!-- Step 4: Open cart -->
92+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="openShoppingCartPage"/>
93+
<waitForPageLoad stepKey="waitForShoppingCartPageLoad"/>
94+
<see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$51.99"
95+
stepKey="assertProductPriceInCart"/>
96+
97+
<!-- Step 5: Edit Product in cart -->
98+
<click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEdit"/>
99+
<waitForPageLoad stepKey="waitForEditPage"/>
100+
101+
<!-- Step 6: Make sure Product price is correct -->
102+
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="51.99" stepKey="checkPrice"/>
103+
</test>
104+
</tests>

app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ define([
3838
});
3939
}
4040
});
41+
42+
this._reloadPrice();
4143
},
4244

4345
/**

app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Generate.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ public function execute()
4949
// if sitemap record exists
5050
if ($sitemap->getId()) {
5151
try {
52+
$this->appEmulation->startEnvironmentEmulation(
53+
$sitemap->getStoreId(),
54+
\Magento\Framework\App\Area::AREA_FRONTEND,
55+
true
56+
);
5257
$sitemap->generateXml();
58+
$this->appEmulation->stopEnvironmentEmulation();
5359
$this->messageManager->addSuccessMessage(
5460
__('The sitemap "%1" has been generated.', $sitemap->getSitemapFilename())
5561
);

app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types = 1);
67
namespace Magento\Swatches\Block\Product\Renderer;
78

89
use Magento\Catalog\Block\Product\Context;
@@ -57,6 +58,11 @@ class Configurable extends \Magento\ConfigurableProduct\Block\Product\View\Type\
5758
*/
5859
const SWATCH_THUMBNAIL_NAME = 'swatchThumb';
5960

61+
/**
62+
* Config path which contains number of swatches per product
63+
*/
64+
private const XML_PATH_SWATCHES_PER_PRODUCT = 'catalog/frontend/swatches_per_product';
65+
6066
/**
6167
* @var Product
6268
*/
@@ -200,7 +206,7 @@ public function getJsonSwatchConfig()
200206
public function getNumberSwatchesPerProduct()
201207
{
202208
return $this->_scopeConfig->getValue(
203-
'catalog/frontend/swatches_per_product',
209+
self::XML_PATH_SWATCHES_PER_PRODUCT,
204210
ScopeInterface::SCOPE_STORE
205211
);
206212
}

app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="nthSwatchOptionText" type="button" selector="div.swatch-option.text:nth-of-type({{n}})" parameterized="true"/>
1717
<element name="productSwatch" type="button" selector="//div[@class='swatch-option'][@aria-label='{{var1}}']" parameterized="true"/>
1818
<element name="visualSwatchOption" type="button" selector=".swatch-option[option-tooltip-value='#{{visualSwatchOption}}']" parameterized="true"/>
19+
<element name="swatchOptionTooltip" type="block" selector="div.swatch-option-tooltip"/>
1920
</section>
2021
</sections>

0 commit comments

Comments
 (0)