Skip to content

Commit cc5f7f8

Browse files
Roman HaninRoman Hanin
authored andcommitted
Merge branch '2.4-develop' of https://github.com/magento/magento2ce into B2B-1847
2 parents 3f08ffb + 5dcb5a5 commit cc5f7f8

File tree

48 files changed

+1130
-159
lines changed

Some content is hidden

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

48 files changed

+1130
-159
lines changed

app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ Bundle.Selection.prototype = {
159159
$grid.find('.checkbox').prop({checked: false});
160160
161161
var checkRowBySku = function (sku) {
162-
sku = $.trim(sku);
162+
sku = sku.trim();
163163
$grid.find('.sku').filter(function () {
164-
return $.trim($(this).text()) == sku;
164+
return $(this).text().trim() == sku;
165165
}).closest('tr').find('.checkbox').prop({checked: true});
166166
};
167167
$.each(bSelection.gridSelection.values().pop().toArray(), function () {

app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ define([
146146

147147
if ($(this).is(':checked')) {
148148
selectedProductList[$(this).val()] = {
149-
name: $.trim(tr.find('.col-name').html()),
150-
sku: $.trim(tr.find('.col-sku').html()),
149+
name: tr.find('.col-name').html().trim(),
150+
sku: tr.find('.col-sku').html().trim(),
151151
'product_id': $(this).val(),
152152
'option_id': $('bundle_selection_id_' + optionIndex).val(),
153153
'selection_price_value': 0,
@@ -186,7 +186,7 @@ define([
186186
});
187187
bSelection.gridRemoval.each(function (pair) {
188188
$optionBox.find('.col-sku').filter(function () {
189-
return $.trim($(this).text()) === pair.key; // find row by SKU
189+
return $(this).text().trim() === pair.key; // find row by SKU
190190
}).closest('tr').find('button.delete').trigger('click');
191191
});
192192
widget.refreshSortableElements();

app/code/Magento/Bundle/view/frontend/web/js/product-summary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ define([
7777
.closest(this.options.summaryContainer)
7878
.find(this.options.templates.summaryBlock)
7979
.html();
80-
template = mageTemplate($.trim(template), {
80+
template = mageTemplate(template.trim(), {
8181
data: {
8282
_label_: this.cache.currentElement.options[key].title
8383
}
@@ -107,7 +107,7 @@ define([
107107
.closest(this.options.summaryContainer)
108108
.find(this.options.templates.optionBlock)
109109
.html();
110-
template = mageTemplate($.trim(template), {
110+
template = mageTemplate(template.trim(), {
111111
data: {
112112
_quantity_: this.cache.currentElement.options[this.cache.currentKey].selections[optionIndex].qty,
113113
_label_: this.cache.currentElement.options[this.cache.currentKey].selections[optionIndex].name
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
11+
<actionGroup name="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup">
12+
<annotations>
13+
<description>
14+
Assert that the MAP message is present on the product listing in the cart, and What's this? link is clickable and bring up the info popup.
15+
</description>
16+
</annotations>
17+
<!-- Confirm that the MAP message and help link are visible -->
18+
<see selector="{{StorefrontCartMapSection.mapNotice}}" userInput="See price before order confirmation." stepKey="seeMsrpNotice"/>
19+
<see selector="{{StorefrontCartMapSection.mapWhatsThis}}" userInput="What's this?" stepKey="seeMsrpNoticeHelpLink"/>
20+
<!-- Confirm that clicking on the 'What's this?' link shows the help popup -->
21+
<click selector="{{StorefrontCartMapSection.mapWhatsThis}}" stepKey="clickOnWhatsThisLink"/>
22+
<waitForElementVisible selector="{{StorefrontCartMapSection.mapWhatsThisPopup}}" stepKey="waitForTheInfoMessage"/>
23+
<!-- Confirm that clicking on X button closes the popup -->
24+
<click selector="{{StorefrontCartMapSection.mapWhatsThisPopupClose}}" stepKey="clickOnCloseInfoMessage"/>
25+
<waitForElementNotVisible selector="{{StorefrontCartMapSection.mapWhatsThisPopup}}" stepKey="waitForTheInfoMessageToClose"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="StorefrontCartMapSection">
12+
<element name="mapNotice" type="text" selector=".msrp.notice"/>
13+
<element name="mapWhatsThis" type="text" selector=".msrp .action.help.map"/>
14+
<element name="mapWhatsThisPopup" type="text" selector="//div[@id='map-popup-text-what-this']"/>
15+
<element name="mapWhatsThisPopupClose" type="text" selector=".popup button.action.close"/>
16+
</section>
17+
</sections>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="StorefrontVerifyMapMessagePopupOnCartViewPageTest">
10+
<annotations>
11+
<stories value="Shopping Cart"/>
12+
<features value="Checkout"/>
13+
<title value="Minimum Advertised Price 'What's this?' popup does not displays in cart"/>
14+
<description value="When Minimum Advertised Price (MAP) is enabled and the product has MAP set in Advanced Pricing, click on 'What's this?' at the product listing in the shopping cart must display the popup with the info message."/>
15+
<testCaseId value="MC-41596"/>
16+
<useCaseId value="MC-41494"/>
17+
<severity value="MAJOR"/>
18+
<group value="shoppingCart"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<!-- Enable MAP functionality in Magento Instance -->
23+
<createData entity="MsrpEnableMAP" stepKey="enableMAP"/>
24+
<!-- Create product and category -->
25+
<createData entity="_defaultCategory" stepKey="category"/>
26+
<createData entity="SimpleProduct" stepKey="product">
27+
<requiredEntity createDataKey="category"/>
28+
</createData>
29+
</before>
30+
<after>
31+
<!-- Disable MAP functionality in Magento Instance -->
32+
<createData entity="MsrpDisableMAP" stepKey="disableMAP"/>
33+
<!-- Delete product and category -->
34+
<deleteData createDataKey="product" stepKey="deleteSimpleProduct"/>
35+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
36+
</after>
37+
38+
<!-- Add MAP to the newly created product Advanced Pricing -->
39+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
40+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminProductEditPage">
41+
<argument name="productId" value="$$product.id$$"/>
42+
</actionGroup>
43+
<actionGroup ref="AdminAddMinimumAdvertisedPriceActionGroup" stepKey="setMapToCreatedProduct">
44+
<argument name="msrpData" value="MsrpBeforeOrderConfirmation"/>
45+
</actionGroup>
46+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
47+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/>
48+
49+
<!--Adding the newly created product to shopping cart.-->
50+
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPageOnFrontEnd">
51+
<argument name="categoryUrl" value="$category.custom_attributes[url_key]$"/>
52+
</actionGroup>
53+
<actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart">
54+
<argument name="product" value="$product$"/>
55+
</actionGroup>
56+
57+
<!-- Navigate to the cart edit page -->
58+
<actionGroup ref="clickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCartViewAndEditPage"/>
59+
60+
<!-- Check if MAP message and link are present and functioning -->
61+
<actionGroup ref="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup" stepKey="checkFormMapFunctioning"/>
62+
</test>
63+
</tests>

app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
7878
<a href="#" class="action help map"
7979
id="<?= ($block->escapeHtmlAttr($helpLinkId)) ?>"
8080
data-mage-init='{"addToCart":{
81+
"origin": "info",
8182
"helpLinkId": "#<?= $block->escapeJs($block->escapeHtml($helpLinkId)) ?>",
8283
"productName": "<?= $block->escapeJs($block->escapeHtml($product->getName())) ?>",
8384
"showAddToCart": false

app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ define([
104104
}
105105
});
106106

107-
if ($.isArray(addrs.street)) {
107+
if (Array.isArray(addrs.street)) {
108108
streetObject = {};
109109
addrs.street.forEach(function (value, index) {
110110
streetObject[index] = value;
@@ -113,7 +113,7 @@ define([
113113
}
114114

115115
//jscs:disable requireCamelCaseOrUpperCaseIdentifiers
116-
if ($.isArray(addrs.customAttributes)) {
116+
if (Array.isArray(addrs.customAttributes)) {
117117
customAttributesObject = {};
118118
addrs.customAttributes.forEach(function (value) {
119119
customAttributesObject[value.attribute_code] = value.value;

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ define([
106106
errorOption,
107107
allOptions = [];
108108

109-
newOption.label = $.trim(newOption.label);
109+
newOption.label = newOption.label.trim();
110110

111111
if (_.isEmpty(newOption.label)) {
112112
return false;

app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function execute(array $cartItemData): array
9393
throw new GraphQlNoSuchEntityException(__('Could not find specified product.'));
9494
}
9595

96-
$this->checkProductStock($sku, (float) $qty, (int) $cart->getStore()->getWebsite()->getId());
96+
$this->checkProductStock($sku, (float) $qty, (int) $cart->getStore()->getWebsiteId());
9797

9898
$configurableProductLinks = $parentProduct->getExtensionAttributes()->getConfigurableProductLinks();
9999
if (!in_array($product->getId(), $configurableProductLinks)) {

0 commit comments

Comments
 (0)