Skip to content

Commit 6468260

Browse files
committed
Merge branch '2.2-develop' of github.com:magento/magento2 into 2.2-develop
2 parents f8c9b03 + 0b2fcf1 commit 6468260

File tree

33 files changed

+480
-2680
lines changed

33 files changed

+480
-2680
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
/**
1313
* Class FlatTableBuilder
14+
*
1415
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1516
*/
1617
class FlatTableBuilder
@@ -354,6 +355,7 @@ protected function _updateTemporaryTableByStoreValues(
354355
//Update not simple attributes (eg. dropdown)
355356
$columnName = $attributeCode . $valueFieldSuffix;
356357
if (isset($flatColumns[$columnName])) {
358+
$columnValue = $this->_connection->getIfNullSql('ts.value', 't0.value');
357359
$select = $this->_connection->select();
358360
$select->joinLeft(
359361
['t0' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
@@ -364,8 +366,8 @@ protected function _updateTemporaryTableByStoreValues(
364366
'ts.option_id = et.' . $attributeCode . ' AND ts.store_id = ' . $storeId,
365367
[]
366368
)->columns(
367-
[$columnName => $this->_connection->getIfNullSql('ts.value', 't0.value')]
368-
)->where($attributeCode . ' IS NOT NULL');
369+
[$columnName => $columnValue]
370+
)->where($columnValue . ' IS NOT NULL');
369371
if (!empty($changedIds)) {
370372
$select->where($this->_connection->quoteInto('et.entity_id IN (?)', $changedIds));
371373
}
@@ -389,7 +391,7 @@ protected function _getTemporaryTableName($tableName)
389391
}
390392

391393
/**
392-
* Get MetadataPool
394+
* Get metadata pool
393395
*
394396
* @return \Magento\Framework\EntityManager\MetadataPool
395397
*/

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
*/
66
namespace Magento\Catalog\Model\Product\Attribute\Backend\TierPrice;
77

8-
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
98
use Magento\Catalog\Api\Data\ProductInterface;
9+
use Magento\Framework\App\ObjectManager;
10+
use Magento\Framework\Locale\FormatInterface;
1011
use Magento\Store\Model\StoreManagerInterface;
1112
use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
1213
use Magento\Customer\Api\GroupManagementInterface;
@@ -38,26 +39,34 @@ class UpdateHandler extends AbstractHandler
3839
*/
3940
private $tierPriceResource;
4041

42+
/**
43+
* @var FormatInterface
44+
*/
45+
private $localeFormat;
46+
4147
/**
4248
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
4349
* @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository
4450
* @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
4551
* @param \Magento\Framework\EntityManager\MetadataPool $metadataPool
4652
* @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice $tierPriceResource
53+
* @param FormatInterface|null $localeFormat
4754
*/
4855
public function __construct(
4956
StoreManagerInterface $storeManager,
5057
ProductAttributeRepositoryInterface $attributeRepository,
5158
GroupManagementInterface $groupManagement,
5259
MetadataPool $metadataPool,
53-
Tierprice $tierPriceResource
60+
Tierprice $tierPriceResource,
61+
FormatInterface $localeFormat = null
5462
) {
5563
parent::__construct($groupManagement);
5664

5765
$this->storeManager = $storeManager;
5866
$this->attributeRepository = $attributeRepository;
5967
$this->metadataPoll = $metadataPool;
6068
$this->tierPriceResource = $tierPriceResource;
69+
$this->localeFormat = $localeFormat ?: ObjectManager::getInstance()->get(FormatInterface::class);
6170
}
6271

6372
/**
@@ -116,8 +125,9 @@ private function updateValues(array $valuesToUpdate, array $oldValues): bool
116125
{
117126
$isChanged = false;
118127
foreach ($valuesToUpdate as $key => $value) {
119-
if ((!empty($value['value']) && (float)$oldValues[$key]['price'] !== (float)$value['value'])
120-
|| $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
128+
if ((!empty($value['value'])
129+
&& (float)$oldValues[$key]['price'] !== $this->localeFormat->getNumber($value['value'])
130+
) || $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
121131
) {
122132
$price = new \Magento\Framework\DataObject(
123133
[

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,14 @@
248248
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
249249
</actionGroup>
250250

251-
<actionGroup name="AdminAssignProductToCategory">
251+
<actionGroup name="AdminAssignProductToCategory" extends="AdminProductAssignCategory">
252252
<arguments>
253253
<argument name="productId" type="string"/>
254-
<argument name="categoryName" type="string"/>
255254
</arguments>
256-
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="amOnPage"/>
257-
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="selectCategory"/>
258-
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
259-
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/>
255+
<amOnPage url="{{AdminProductEditPage.url(productId)}}" before="searchAndSelectCategory" stepKey="amOnPage"/>
256+
<click selector="{{AdminProductFormActionSection.saveButton}}" after="searchAndSelectCategory" stepKey="clickOnSaveButton"/>
257+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickOnSaveButton" stepKey="waitForSaveProductMessage"/>
258+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." after="waitForSaveProductMessage" stepKey="seeSaveProductMessage"/>
260259
</actionGroup>
261260

262261
<actionGroup name="AdminChangeProductAttributeSet">
@@ -269,4 +268,19 @@
269268
<waitForElementVisible selector="{{AdminProductFormSection.attributeSetFilterResultByName(attributeSet.attribute_set_name)}}" stepKey="waitForNewAttributeSetIsShown"/>
270269
<click selector="{{AdminProductFormSection.attributeSetFilterResultByName(attributeSet.attribute_set_name)}}" stepKey="selectAttributeSet"/>
271270
</actionGroup>
271+
272+
<actionGroup name="AdminProductAssignCategory">
273+
<arguments>
274+
<argument name="categoryName" type="string"/>
275+
</arguments>
276+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="searchAndSelectCategory"/>
277+
</actionGroup>
278+
279+
<!--Navigate to created product page directly via ID-->
280+
<actionGroup name="goToProductPageViaID">
281+
<arguments>
282+
<argument name="productId" type="string"/>
283+
</arguments>
284+
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/>
285+
</actionGroup>
272286
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
<element name="productPriceOld" type="text" selector="//span[@data-price-type='oldPrice']//span[@class='price'][contains(., '{{var1}}')]" parameterized="true"/>
2525
<element name="productPriceLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]" parameterized="true"/>
2626
<element name="productPriceLinkAfterLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]/following::span[contains(text(), '{{var2}}')]" parameterized="true"/>
27+
<element name="productStockUnavailableByName" type="text" selector="//a[contains(@class, 'product-item-link') and normalize-space(text())='{{productName}}']/ancestor::div[contains(@class, 'product-item-details')]//span[contains(text(),'Out of stock')]" parameterized="true"/>
2728
</section>
2829
</sections>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-15740"/>
1919
<useCaseId value="MAGETWO-73157"/>
20+
<skip>
21+
<issueId value="MC-16313"/>
22+
</skip>
2023
<group value="catalog"/>
2124
</annotations>
2225
<before>
@@ -28,6 +31,8 @@
2831
<requiredEntity createDataKey="createCategory"/>
2932
</createData>
3033
<updateData createDataKey="createFirstProduct" entity="ProductWithFieldOptions" stepKey="updateProductCustomOptions" />
34+
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
35+
<magentoCLI stepKey="flushCache" command="cache:flush"/>
3136
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
3237
</before>
3338
<after>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="StockOptionsDisplayOutOfStockProductsEnable">
12+
<data key="path">cataloginventory/options/show_out_of_stock</data>
13+
<data key="scope_id">0</data>
14+
<data key="label">Yes</data>
15+
<data key="value">1</data>
16+
</entity>
17+
<entity name="StockOptionsDisplayOutOfStockProductsDisable">
18+
<data key="path">cataloginventory/options/show_out_of_stock</data>
19+
<data key="scope_id">0</data>
20+
<data key="label">No</data>
21+
<data key="value">0</data>
22+
</entity>
23+
</entities>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminCreateApiConfigurableProductActionGroup">
1212
<arguments>
13-
<argument name="productName" defaultValue="ApiConfigurableProductWithOutCategory" type="string"/>
13+
<argument name="productName" defaultValue="{{ApiConfigurableProductWithOutCategory.name}}" type="string"/>
1414
</arguments>
1515

1616
<!-- Create the configurable product based on the data in the /data folder -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<!-- Check for the product link. -->
12+
<!-- Assumes web client is on Grouped Product Page -->
13+
<actionGroup name="AssertLinkPresenceOnGroupedProductPage">
14+
<arguments>
15+
<argument name="productName" type="string"/>
16+
</arguments>
17+
<see selector="{{StorefrontProductInfoMainSection.groupedProductsTable}}" userInput="{{productName}}" stepKey="seeFirstStagedGroupedProduct"/>
18+
</actionGroup>
19+
</actionGroups>
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="StorefrontProductInfoMainSection">
12+
<element name="groupedProductsTable" type="text" selector="#super-product-table .product-item-name"/>
13+
</section>
14+
</sections>

app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
9-
<group id="paypal_payflowpro_with_express_checkout" translate="label comment" extends="payment_all_paypal/paypal_payflowpro">
9+
<group id="paypal_payflowpro_with_express_checkout" translate="label" extends="payment_all_paypal/paypal_payflowpro">
1010
<label>Payflow Pro</label>
1111
<attribute type="paypal_ec_separate">0</attribute>
1212
<group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10">
@@ -30,11 +30,11 @@
3030
<field id="enable_paypal_payflow"/>
3131
</requires>
3232
</field>
33-
<field id="enable_express_checkout_bml_payflow" translate="label" type="select" sortOrder="21" showInWebsite="1" showInDefault="1">
33+
<field id="enable_express_checkout_bml_payflow" translate="label comment" type="select" sortOrder="21" showInWebsite="1" showInDefault="1">
3434
<label>Enable PayPal Credit</label>
3535
<comment><![CDATA[PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
3636
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.
37-
<a href="https:/www.paypal.com/webapps/mpp/promotional-financing" target="_blank">Learn More</a>]]>
37+
<a href="https://www.paypal.com/webapps/mpp/promotional-financing" target="_blank">Learn More</a>]]>
3838
</comment>
3939
<config_path>payment/payflow_express_bml/active</config_path>
4040
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>

app/code/Magento/Paypal/i18n/en_US.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,3 +697,8 @@ User,User
697697
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
698698
or more. <a href=""https:/financing.paypal.com/ppfinportal/content/forrester"" target=""_blank"">See Details</a>.
699699
"
700+
"PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
701+
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.
702+
<a href=""https://www.paypal.com/webapps/mpp/promotional-financing"" target=""_blank"">Learn More</a>","PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
703+
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.
704+
<a href=""https://www.paypal.com/webapps/mpp/promotional-financing"" target=""_blank"">Learn More</a>"

0 commit comments

Comments
 (0)