Skip to content

Commit

Permalink
Merge branch '2.2-develop' of github.com:magento/magento2 into 2.2-de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
david-fuehr committed May 9, 2019
2 parents f8c9b03 + 0b2fcf1 commit 6468260
Show file tree
Hide file tree
Showing 33 changed files with 480 additions and 2,680 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/**
* Class FlatTableBuilder
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class FlatTableBuilder
Expand Down Expand Up @@ -354,6 +355,7 @@ protected function _updateTemporaryTableByStoreValues(
//Update not simple attributes (eg. dropdown)
$columnName = $attributeCode . $valueFieldSuffix;
if (isset($flatColumns[$columnName])) {
$columnValue = $this->_connection->getIfNullSql('ts.value', 't0.value');
$select = $this->_connection->select();
$select->joinLeft(
['t0' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
Expand All @@ -364,8 +366,8 @@ protected function _updateTemporaryTableByStoreValues(
'ts.option_id = et.' . $attributeCode . ' AND ts.store_id = ' . $storeId,
[]
)->columns(
[$columnName => $this->_connection->getIfNullSql('ts.value', 't0.value')]
)->where($attributeCode . ' IS NOT NULL');
[$columnName => $columnValue]
)->where($columnValue . ' IS NOT NULL');
if (!empty($changedIds)) {
$select->where($this->_connection->quoteInto('et.entity_id IN (?)', $changedIds));
}
Expand All @@ -389,7 +391,7 @@ protected function _getTemporaryTableName($tableName)
}

/**
* Get MetadataPool
* Get metadata pool
*
* @return \Magento\Framework\EntityManager\MetadataPool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/
namespace Magento\Catalog\Model\Product\Attribute\Backend\TierPrice;

use Magento\Framework\EntityManager\Operation\ExtensionInterface;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Locale\FormatInterface;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
use Magento\Customer\Api\GroupManagementInterface;
Expand Down Expand Up @@ -38,26 +39,34 @@ class UpdateHandler extends AbstractHandler
*/
private $tierPriceResource;

/**
* @var FormatInterface
*/
private $localeFormat;

/**
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository
* @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
* @param \Magento\Framework\EntityManager\MetadataPool $metadataPool
* @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice $tierPriceResource
* @param FormatInterface|null $localeFormat
*/
public function __construct(
StoreManagerInterface $storeManager,
ProductAttributeRepositoryInterface $attributeRepository,
GroupManagementInterface $groupManagement,
MetadataPool $metadataPool,
Tierprice $tierPriceResource
Tierprice $tierPriceResource,
FormatInterface $localeFormat = null
) {
parent::__construct($groupManagement);

$this->storeManager = $storeManager;
$this->attributeRepository = $attributeRepository;
$this->metadataPoll = $metadataPool;
$this->tierPriceResource = $tierPriceResource;
$this->localeFormat = $localeFormat ?: ObjectManager::getInstance()->get(FormatInterface::class);
}

/**
Expand Down Expand Up @@ -116,8 +125,9 @@ private function updateValues(array $valuesToUpdate, array $oldValues): bool
{
$isChanged = false;
foreach ($valuesToUpdate as $key => $value) {
if ((!empty($value['value']) && (float)$oldValues[$key]['price'] !== (float)$value['value'])
|| $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
if ((!empty($value['value'])
&& (float)$oldValues[$key]['price'] !== $this->localeFormat->getNumber($value['value'])
) || $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
) {
$price = new \Magento\Framework\DataObject(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,14 @@
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
</actionGroup>

<actionGroup name="AdminAssignProductToCategory">
<actionGroup name="AdminAssignProductToCategory" extends="AdminProductAssignCategory">
<arguments>
<argument name="productId" type="string"/>
<argument name="categoryName" type="string"/>
</arguments>
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="amOnPage"/>
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="selectCategory"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/>
<amOnPage url="{{AdminProductEditPage.url(productId)}}" before="searchAndSelectCategory" stepKey="amOnPage"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" after="searchAndSelectCategory" stepKey="clickOnSaveButton"/>
<waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickOnSaveButton" stepKey="waitForSaveProductMessage"/>
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." after="waitForSaveProductMessage" stepKey="seeSaveProductMessage"/>
</actionGroup>

<actionGroup name="AdminChangeProductAttributeSet">
Expand All @@ -269,4 +268,19 @@
<waitForElementVisible selector="{{AdminProductFormSection.attributeSetFilterResultByName(attributeSet.attribute_set_name)}}" stepKey="waitForNewAttributeSetIsShown"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResultByName(attributeSet.attribute_set_name)}}" stepKey="selectAttributeSet"/>
</actionGroup>

<actionGroup name="AdminProductAssignCategory">
<arguments>
<argument name="categoryName" type="string"/>
</arguments>
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="searchAndSelectCategory"/>
</actionGroup>

<!--Navigate to created product page directly via ID-->
<actionGroup name="goToProductPageViaID">
<arguments>
<argument name="productId" type="string"/>
</arguments>
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
<element name="productPriceOld" type="text" selector="//span[@data-price-type='oldPrice']//span[@class='price'][contains(., '{{var1}}')]" parameterized="true"/>
<element name="productPriceLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]" parameterized="true"/>
<element name="productPriceLinkAfterLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]/following::span[contains(text(), '{{var2}}')]" parameterized="true"/>
<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"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<severity value="MAJOR"/>
<testCaseId value="MC-15740"/>
<useCaseId value="MAGETWO-73157"/>
<skip>
<issueId value="MC-16313"/>
</skip>
<group value="catalog"/>
</annotations>
<before>
Expand All @@ -28,6 +31,8 @@
<requiredEntity createDataKey="createCategory"/>
</createData>
<updateData createDataKey="createFirstProduct" entity="ProductWithFieldOptions" stepKey="updateProductCustomOptions" />
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
<magentoCLI stepKey="flushCache" command="cache:flush"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="StockOptionsDisplayOutOfStockProductsEnable">
<data key="path">cataloginventory/options/show_out_of_stock</data>
<data key="scope_id">0</data>
<data key="label">Yes</data>
<data key="value">1</data>
</entity>
<entity name="StockOptionsDisplayOutOfStockProductsDisable">
<data key="path">cataloginventory/options/show_out_of_stock</data>
<data key="scope_id">0</data>
<data key="label">No</data>
<data key="value">0</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCreateApiConfigurableProductActionGroup">
<arguments>
<argument name="productName" defaultValue="ApiConfigurableProductWithOutCategory" type="string"/>
<argument name="productName" defaultValue="{{ApiConfigurableProductWithOutCategory.name}}" type="string"/>
</arguments>

<!-- Create the configurable product based on the data in the /data folder -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!-- Check for the product link. -->
<!-- Assumes web client is on Grouped Product Page -->
<actionGroup name="AssertLinkPresenceOnGroupedProductPage">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<see selector="{{StorefrontProductInfoMainSection.groupedProductsTable}}" userInput="{{productName}}" stepKey="seeFirstStagedGroupedProduct"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontProductInfoMainSection">
<element name="groupedProductsTable" type="text" selector="#super-product-table .product-item-name"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="paypal_payflowpro_with_express_checkout" translate="label comment" extends="payment_all_paypal/paypal_payflowpro">
<group id="paypal_payflowpro_with_express_checkout" translate="label" extends="payment_all_paypal/paypal_payflowpro">
<label>Payflow Pro</label>
<attribute type="paypal_ec_separate">0</attribute>
<group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10">
Expand All @@ -30,11 +30,11 @@
<field id="enable_paypal_payflow"/>
</requires>
</field>
<field id="enable_express_checkout_bml_payflow" translate="label" type="select" sortOrder="21" showInWebsite="1" showInDefault="1">
<field id="enable_express_checkout_bml_payflow" translate="label comment" type="select" sortOrder="21" showInWebsite="1" showInDefault="1">
<label>Enable PayPal Credit</label>
<comment><![CDATA[PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
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;.
<a href="https:/www.paypal.com/webapps/mpp/promotional-financing" target="_blank">Learn More</a>]]>
<a href="https://www.paypal.com/webapps/mpp/promotional-financing" target="_blank">Learn More</a>]]>
</comment>
<config_path>payment/payflow_express_bml/active</config_path>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
Expand Down
5 changes: 5 additions & 0 deletions app/code/Magento/Paypal/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -697,3 +697,8 @@ User,User
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
or more. <a href=""https:/financing.paypal.com/ppfinportal/content/forrester"" target=""_blank"">See Details</a>.
"
"PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
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;.
<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.
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;.
<a href=""https://www.paypal.com/webapps/mpp/promotional-financing"" target=""_blank"">Learn More</a>"
Loading

0 comments on commit 6468260

Please sign in to comment.