Skip to content

Commit b5500f7

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into refactor/mftf-customer
# Conflicts: # app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml
2 parents 0652d0e + 7ccd640 commit b5500f7

File tree

92 files changed

+2153
-421
lines changed

Some content is hidden

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

92 files changed

+2153
-421
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminLogoutActionGroup">
12+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/Backend/view/adminhtml/layout/adminhtml_cache_block.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
<argument name="type" xsi:type="string">options</argument>
8181
<argument name="width" xsi:type="string">120</argument>
8282
<argument name="align" xsi:type="string">left</argument>
83+
<argument name="sortable" xsi:type="string">0</argument>
8384
<argument name="options" xsi:type="array">
8485
<item name="disabled" xsi:type="array">
8586
<item name="value" xsi:type="string">0</item>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<waitForPageLoad stepKey="waitForElementAdded"/>
8080

8181
<!-- Go to the shopping cart page and grab the value of the option title -->
82-
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart"/>
82+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart"/>
8383
<waitForPageLoad stepKey="waitForCartPageLoad"/>
8484
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/>
8585

@@ -100,7 +100,7 @@
100100
<see stepKey="assertSuccess2" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/>
101101

102102
<!-- Go to the shopping cart page and make sure the title has changed -->
103-
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart1"/>
103+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart1"/>
104104
<waitForPageLoad stepKey="waitForCartPageLoad1"/>
105105
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalAfter"/>
106106
<assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
<waitForPageLoad stepKey="waitForElementAdded2"/>
8787

8888
<!-- Go to the shopping cart page and edit the first product -->
89-
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart"/>
89+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart"/>
9090
<waitForPageLoad stepKey="waitForCartPageLoad"/>
9191
<waitForElementVisible stepKey="waitForInfoDropdown" selector="{{CheckoutCartSummarySection.total}}"/>
9292
<waitForPageLoad stepKey="waitForCartPageLoad3"/>
@@ -104,7 +104,7 @@
104104
<waitForPageLoad stepKey="waitForElementAdded3"/>
105105

106106
<!-- Go to the shopping cart page -->
107-
<amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart2"/>
107+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart2"/>
108108
<waitForPageLoad stepKey="waitForCartPageLoad2"/>
109109

110110
<!-- Assert that the options are both there and the proce no longer matches -->

app/code/Magento/Captcha/Test/Mftf/Section/CaptchaFormsDisplayingSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="CaptchaFormsDisplayingSection">
1212
<element name="store" type="button" selector="#menu-magento-backend-stores"/>
1313
<element name="config" type="button" selector="//li[@data-ui-id='menu-magento-config-system-config']//span"/>

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

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
/**
8-
* Product options abstract type block
9-
*
10-
* @author Magento Core Team <[email protected]>
11-
*/
6+
declare(strict_types=1);
127

138
namespace Magento\Catalog\Block\Product\View\Options;
149

10+
use Magento\Catalog\Pricing\Price\BasePrice;
11+
use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule;
1512
use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;
13+
use Magento\Framework\App\ObjectManager;
1614

1715
/**
1816
* Product options section abstract block.
@@ -47,20 +45,29 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template
4745
*/
4846
protected $_catalogHelper;
4947

48+
/**
49+
* @var CalculateCustomOptionCatalogRule
50+
*/
51+
private $calculateCustomOptionCatalogRule;
52+
5053
/**
5154
* @param \Magento\Framework\View\Element\Template\Context $context
5255
* @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
5356
* @param \Magento\Catalog\Helper\Data $catalogData
5457
* @param array $data
58+
* @param CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule
5559
*/
5660
public function __construct(
5761
\Magento\Framework\View\Element\Template\Context $context,
5862
\Magento\Framework\Pricing\Helper\Data $pricingHelper,
5963
\Magento\Catalog\Helper\Data $catalogData,
60-
array $data = []
64+
array $data = [],
65+
CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule = null
6166
) {
6267
$this->pricingHelper = $pricingHelper;
6368
$this->_catalogHelper = $catalogData;
69+
$this->calculateCustomOptionCatalogRule = $calculateCustomOptionCatalogRule
70+
?? ObjectManager::getInstance()->get(CalculateCustomOptionCatalogRule::class);
6471
parent::__construct($context, $data);
6572
}
6673

@@ -161,6 +168,15 @@ protected function _formatPrice($value, $flag = true)
161168
$priceStr = $sign;
162169

163170
$customOptionPrice = $this->getProduct()->getPriceInfo()->getPrice('custom_option_price');
171+
172+
if (!$value['is_percent']) {
173+
$value['pricing_value'] = $this->calculateCustomOptionCatalogRule->execute(
174+
$this->getProduct(),
175+
(float)$value['pricing_value'],
176+
(bool)$value['is_percent']
177+
);
178+
}
179+
164180
$context = [CustomOptionPriceInterface::CONFIGURATION_OPTION_FLAG => true];
165181
$optionAmount = $customOptionPrice->getCustomAmount($value['pricing_value'], null, $context);
166182
$priceStr .= $this->getLayout()->getBlock('product.price.render.default')->renderAmount(

0 commit comments

Comments
 (0)