Skip to content

Commit ca45436

Browse files
authored
Merge branch '2.4-develop' into add-AdminClickInvoiceButtonIntoOrderActionGroup
2 parents 5ced4ba + 8aa1d46 commit ca45436

File tree

228 files changed

+10103
-834
lines changed

Some content is hidden

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

228 files changed

+10103
-834
lines changed

app/code/Magento/Bundle/Model/Product/LinksList.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function __construct(
3939
}
4040

4141
/**
42+
* Bundle Product Items Data
43+
*
4244
* @param \Magento\Catalog\Api\Data\ProductInterface $product
4345
* @param int $optionId
4446
* @return \Magento\Bundle\Api\Data\LinkInterface[]
@@ -50,8 +52,12 @@ public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product, $o
5052
$productLinks = [];
5153
/** @var \Magento\Catalog\Model\Product $selection */
5254
foreach ($selectionCollection as $selection) {
55+
$bundledProductPrice = $selection->getSelectionPriceValue();
56+
if ($bundledProductPrice <= 0) {
57+
$bundledProductPrice = $selection->getPrice();
58+
}
5359
$selectionPriceType = $product->getPriceType() ? $selection->getSelectionPriceType() : null;
54-
$selectionPrice = $product->getPriceType() ? $selection->getSelectionPriceValue() : null;
60+
$selectionPrice = $bundledProductPrice ? $bundledProductPrice : null;
5561

5662
/** @var \Magento\Bundle\Api\Data\LinkInterface $productLink */
5763
$productLink = $this->linkFactory->create();
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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="StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest">
10+
<annotations>
11+
<features value="Bundle"/>
12+
<stories value="Bundle product details page"/>
13+
<title value="Customer should be able to see all the bundle items in invoice view"/>
14+
<description value="Customer should be able to see all the bundle items in invoice view"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="MC-37515"/>
17+
<group value="Bundle"/>
18+
</annotations>
19+
<before>
20+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
21+
<createData entity="SimpleProduct2" stepKey="firstSimpleProduct"/>
22+
<createData entity="SimpleProduct2" stepKey="secondSimpleProduct"/>
23+
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
24+
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
28+
<deleteData createDataKey="firstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
29+
<deleteData createDataKey="secondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
30+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
31+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
32+
</after>
33+
<!-- Create new bundle product -->
34+
<actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createBundleProduct">
35+
<argument name="productType" value="bundle"/>
36+
</actionGroup>
37+
38+
<!-- Fill all main fields -->
39+
<actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainProductFields"/>
40+
41+
<!-- Add first bundle option to the product -->
42+
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addFirstBundleOption">
43+
<argument name="x" value="0"/>
44+
<argument name="n" value="1"/>
45+
<argument name="prodOneSku" value="$firstSimpleProduct.sku$"/>
46+
<argument name="prodTwoSku" value="$secondSimpleProduct.sku$$"/>
47+
<argument name="optionTitle" value="{{CheckboxOption.title}}"/>
48+
<argument name="inputType" value="{{CheckboxOption.type}}"/>
49+
</actionGroup>
50+
51+
<!-- Save product form -->
52+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveWithThreeOptions"/>
53+
54+
<!--Login customer on storefront-->
55+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
56+
<argument name="Customer" value="$$createCustomer$$" />
57+
</actionGroup>
58+
59+
<!--Open Product Page-->
60+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
61+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
62+
</actionGroup>
63+
64+
<!-- Add bundle to cart -->
65+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart">
66+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
67+
</actionGroup>
68+
<checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '1')}}" stepKey="selectOption2Product1"/>
69+
<checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '2')}}" stepKey="selectOption2Product2"/>
70+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
71+
<argument name="quantity" value="1"/>
72+
</actionGroup>
73+
74+
<!--Navigate to checkout-->
75+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/>
76+
<!-- Click next button to open payment section -->
77+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
78+
<!-- Click place order -->
79+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
80+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
81+
82+
<!-- Order review page has address that was created during checkout -->
83+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById">
84+
<argument name="orderId" value="{$grabOrderNumber}"/>
85+
</actionGroup>
86+
87+
<!-- Open create invoice page -->
88+
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/>
89+
90+
<!-- Assert item options display -->
91+
<see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $firstSimpleProduct.sku$" stepKey="seeFirstProductInList"/>
92+
<see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $secondSimpleProduct.sku$" stepKey="seeSecondProductInList"/>
93+
</test>
94+
</tests>

app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testLinksList()
9191
->method('getSelectionsCollection')
9292
->with([$optionId], $this->productMock)
9393
->willReturn([$this->selectionMock]);
94-
$this->productMock->expects($this->exactly(2))->method('getPriceType')->willReturn('price_type');
94+
$this->productMock->expects($this->once())->method('getPriceType')->willReturn('price_type');
9595
$this->selectionMock->expects($this->once())
9696
->method('getSelectionPriceType')
9797
->willReturn('selection_price_type');

app/code/Magento/Bundle/view/adminhtml/templates/sales/invoice/create/items/renderer.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<?php $items = $block->getChildren($_item); ?>
1616
<?php $_count = count($items) ?>
1717
<?php $_index = 0 ?>
18+
<?php $canEditItemQty = true ?>
1819
<?php
1920
/** @var \Magento\Catalog\Helper\Data $catalogHelper */
2021
$catalogHelper = $block->getData('catalogHelper');
@@ -37,7 +38,7 @@ $catalogHelper = $block->getData('catalogHelper');
3738
<?php if ($_item->getOrderItem()->getParentItem()): ?>
3839
<?php
3940
if ($shipTogether) {
40-
continue;
41+
$canEditItemQty = false;
4142
}
4243
?>
4344
<?php $attributes = $block->getSelectionAttributes($_item) ?>
@@ -130,7 +131,7 @@ $catalogHelper = $block->getData('catalogHelper');
130131
</td>
131132
<td class="col-qty-invoice">
132133
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
133-
<?php if ($block->canEditQty()): ?>
134+
<?php if ($block->canEditQty() && $canEditItemQty): ?>
134135
<input type="text"
135136
class="input-text admin__control-text qty-input"
136137
name="invoice[items][<?= $block->escapeHtmlAttr($_item->getOrderItemId()) ?>]"

app/code/Magento/Catalog/Block/Product/View.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ public function getJsonConfig()
196196
'productId' => (int)$product->getId(),
197197
'priceFormat' => $this->_localeFormat->getPriceFormat(),
198198
'prices' => [
199+
'baseOldPrice' => [
200+
'amount' => $priceInfo->getPrice('regular_price')->getAmount()->getBaseAmount() * 1,
201+
'adjustments' => []
202+
],
199203
'oldPrice' => [
200204
'amount' => $priceInfo->getPrice('regular_price')->getAmount()->getValue() * 1,
201205
'adjustments' => []

app/code/Magento/Catalog/Helper/Image.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ public function backgroundColor($colorRGB)
384384
{
385385
// assume that 3 params were given instead of array
386386
if (!is_array($colorRGB)) {
387+
//phpcs:disable
387388
$colorRGB = func_get_args();
389+
//phpcs:enabled
388390
}
389391
$this->_getModel()->setBackgroundColor($colorRGB);
390392
return $this;
@@ -498,7 +500,11 @@ protected function initBaseFile()
498500
if ($this->getImageFile()) {
499501
$model->setBaseFile($this->getImageFile());
500502
} else {
501-
$model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
503+
$model->setBaseFile(
504+
$this->getProduct()
505+
? $this->getProduct()->getData($model->getDestinationSubdir())
506+
: ''
507+
);
502508
}
503509
}
504510
return $this;

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridUrlFilterApplierTest.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@
2020
</annotations>
2121

2222
<before>
23-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2423
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
26+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
27+
<!-- Should wait a bit for filters really cleared because waitForPageLoad does not wait for javascripts to be finished -->
28+
<!-- Without this test will fail sometimes -->
29+
<wait time="5" stepKey="waitFilterReallyCleared"/>
30+
<reloadPage stepKey="reloadPage"/>
2531
</before>
2632

2733
<after>

app/code/Magento/Catalog/Test/Unit/Helper/ImageTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,14 @@ public function testGetWidth()
396396
$this->assertEquals($data['width'], $this->helper->getWidth());
397397
}
398398

399+
/**
400+
* Check initBaseFile without properties - product
401+
*/
402+
public function testGetUrlWithOutProduct()
403+
{
404+
$this->assertNull($this->helper->getUrl());
405+
}
406+
399407
/**
400408
* @param array $data
401409
* @dataProvider getHeightDataProvider

app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(
7171
public function getCategoryUrlSuffix()
7272
{
7373
return $this->scopeConfig->getValue(
74-
static::XML_PATH_CATEGORY_URL_SUFFIX,
74+
self::XML_PATH_CATEGORY_URL_SUFFIX,
7575
ScopeInterface::SCOPE_STORE
7676
);
7777
}
@@ -84,7 +84,7 @@ public function getCategoryUrlSuffix()
8484
public function isCategoryUsedInProductUrl(): bool
8585
{
8686
return $this->scopeConfig->isSetFlag(
87-
static::XML_PATH_PRODUCT_USE_CATEGORIES,
87+
self::XML_PATH_PRODUCT_USE_CATEGORIES,
8888
ScopeInterface::SCOPE_STORE
8989
);
9090
}
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillCatalogProductsListWidgetTitleActionGroup">
12+
<annotations>
13+
<description>Fill catalog products list title field.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="title" type="string" defaultValue=""/>
18+
</arguments>
19+
<waitForElementVisible selector="{{InsertWidgetSection.title}}" stepKey="waitForField"/>
20+
<fillField selector="{{InsertWidgetSection.title}}" userInput="{{title}}" stepKey="fillTitleField"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertWidgetTitleActionGroup">
12+
<annotations>
13+
<description>Assert widget title on storefront.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="title" type="string"/>
17+
</arguments>
18+
19+
<grabTextFrom selector="{{StorefrontWidgetsSection.widgetProductsGrid}} {{StorefrontWidgetsSection.widgetTitle}}"
20+
stepKey="grabWidgetTitle"/>
21+
<assertEquals stepKey="assertWidgetTitle">
22+
<actualResult type="string">$grabWidgetTitle</actualResult>
23+
<expectedResult type="string">{{title}}</expectedResult>
24+
</assertEquals>
25+
</actionGroup>
26+
</actionGroups>

app/code/Magento/CatalogWidget/Test/Mftf/Section/CatalogWidgetSection/InsertWidgetSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
<element name="checkElementStorefrontByPrice" type="button" selector="//*[@class='product-items widget-product-grid']//*[contains(text(),'${{arg4}}.00')]" parameterized="true"/>
2020
<element name="checkElementStorefrontByName" type="button" selector="//*[@class='product-items widget-product-grid']//*[@class='product-item'][{{productPosition}}]//a[contains(text(), '{{productName}}')]" parameterized="true"/>
2121
<element name="categoryTreeWrapper" type="text" selector=".rule-chooser .tree.x-tree"/>
22+
<element name="title" type="text" selector="input[name='parameters[title]']"/>
2223
</section>
2324
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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="StorefrontCustomerCheckoutWithCustomerGroupTest">
11+
<annotations>
12+
<features value="Customer Checkout"/>
13+
<stories value="Customer checkout with Customer Group assigned"/>
14+
<title value="Place order by Customer with Customer Group assigned"/>
15+
<description value="Customer Group should be assigned to Order when setting Auto Group Assign is enabled for Customer"/>
16+
<testCaseId value="MC-37259"/>
17+
<severity value="MAJOR"/>
18+
<group value="checkout"/>
19+
<group value="customer"/>
20+
</annotations>
21+
<before>
22+
23+
<magentoCLI command="config:set customer/create_account/auto_group_assign 1" stepKey="enableAutoGroupAssign"/>
24+
25+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
26+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
31+
32+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
33+
34+
<actionGroup ref="AdminUpdateCustomerGroupByEmailActionGroup" stepKey="updateCustomerGroup">
35+
<argument name="emailAddress" value="$$createCustomer.email$$"/>
36+
<argument name="customerGroup" value="Retail"/>
37+
</actionGroup>
38+
39+
</before>
40+
<after>
41+
<magentoCLI command="config:set customer/create_account/auto_group_assign 0" stepKey="disableAutoGroupAssign"/>
42+
43+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
44+
<deleteData createDataKey="createCustomer" stepKey="deleteUsCustomer"/>
45+
<actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="resetCustomerFilters"/>
46+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
47+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
48+
<deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/>
49+
</after>
50+
51+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
52+
<argument name="Customer" value="$$createCustomer$$"/>
53+
</actionGroup>
54+
55+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
56+
<argument name="category" value="$$createCategory$$"/>
57+
</actionGroup>
58+
59+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
60+
61+
<actionGroup ref="StorefrontAddCategoryProductToCartActionGroup" stepKey="addProductToCart">
62+
<argument name="product" value="$$createSimpleProduct$$"/>
63+
<argument name="productCount" value="CONST.one"/>
64+
</actionGroup>
65+
66+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
67+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
68+
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToReview"/>
69+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
70+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder">
71+
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
72+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
73+
</actionGroup>
74+
75+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/>
76+
77+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="addFilterToGridAndOpenOrder">
78+
<argument name="orderId" value="{$orderNumber}"/>
79+
</actionGroup>
80+
81+
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="verifyOrderStatus"/>
82+
<see selector="{{AdminOrderDetailsInformationSection.accountInformation}}" userInput="Customer" stepKey="verifyAccountInformation"/>
83+
<see selector="{{AdminOrderDetailsInformationSection.accountInformation}}" userInput="$$createCustomer.email$$" stepKey="verifyCustomerEmail"/>
84+
<see selector="{{AdminOrderDetailsInformationSection.accountInformation}}" userInput="Retail" stepKey="verifyCustomerGroup"/>
85+
<see selector="{{AdminOrderDetailsInformationSection.billingAddress}}" userInput="{{US_Address_TX.street[0]}}" stepKey="verifyBillingAddress"/>
86+
<see selector="{{AdminOrderDetailsInformationSection.shippingAddress}}" userInput="{{US_Address_TX.street[0]}}" stepKey="verifyShippingAddress"/>
87+
<see selector="{{AdminOrderDetailsInformationSection.itemsOrdered}}" userInput="$$createSimpleProduct.name$$" stepKey="verifyProductName"/>
88+
89+
</test>
90+
</tests>

app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFolder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace Magento\Cms\Controller\Adminhtml\Wysiwyg\Images;
1111

1212
use Magento\Framework\App\Action\HttpPostActionInterface;
13-
use Magento\Framework\App\Filesystem\DirectoryList;
1413

1514
/**
1615
* Delete image folder.

0 commit comments

Comments
 (0)