Skip to content

Commit

Permalink
Merge pull request magento#3878 from magento-arcticfoxes/2.3.1-qwerty-pr
Browse files Browse the repository at this point in the history
[2.3.1-qwerty] Sync with 2.3.1-release
  • Loading branch information
joanhe authored Mar 9, 2019
2 parents f66e072 + 4303cb7 commit b838e74
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 3,775 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,6 @@ protected function modifyPriceData($object, $data)
/** @var \Magento\Catalog\Model\Product $object */
$data = parent::modifyPriceData($object, $data);
$price = $object->getPrice();

$specialPrice = $object->getSpecialPrice();
$specialPriceFromDate = $object->getSpecialFromDate();
$specialPriceToDate = $object->getSpecialToDate();
$today = time();

if ($specialPrice && ($object->getPrice() > $object->getFinalPrice())) {
if ($today >= strtotime($specialPriceFromDate) && $today <= strtotime($specialPriceToDate) ||
$today >= strtotime($specialPriceFromDate) && $specialPriceToDate === null) {
$price = $specialPrice;
}
}

foreach ($data as $key => $tierPrice) {
$percentageValue = $this->getPercentage($tierPrice);
if ($percentageValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ public function getFields(array $context = []): array

$groups = $this->groupRepository->getList($searchCriteria)->getItems();
$priceAttribute = $this->attributeAdapterProvider->getByAttributeCode('price');
$ctx = isset($context['websiteId']) ? ['websiteId' => $context['websiteId']] : [];
foreach ($groups as $group) {
$ctx['customerGroupId'] = $group->getId();
$groupPriceKey = $this->fieldNameResolver->getFieldName(
$priceAttribute,
['customerGroupId' => $group->getId(), 'websiteId' => $context['websiteId']]
$ctx
);
$allAttributes[$groupPriceKey] = [
'type' => $this->fieldTypeConverter->convert(FieldTypeConverterInterface::INTERNAL_DATA_TYPE_FLOAT),
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Elasticsearch6/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<type name="Magento\Search\Model\Search\PageSizeProvider">
<arguments>
<argument name="pageSizeBySearchEngine" xsi:type="array">
<item name="elasticsearch6" xsi:type="number">2147483647</item>
<item name="elasticsearch6" xsi:type="number">10000</item>
</argument>
</arguments>
</type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ protected function _prepareForm()
$this->_addAttributesToForm($attributes, $fieldset);

$this->_form->addFieldNameSuffix('order[account]');
$storeId = (int)$this->_sessionQuote->getStoreId();
$this->_form->setValues($this->extractValuesFromAttributes($attributes, $storeId));
$this->_form->setValues($this->extractValuesFromAttributes($attributes));

return $this;
}
Expand Down Expand Up @@ -192,37 +191,18 @@ public function getFormValues()
* Extract the form values from attributes.
*
* @param array $attributes
* @param int $storeId
* @return array
*/
private function extractValuesFromAttributes(array $attributes, int $storeId): array
private function extractValuesFromAttributes(array $attributes): array
{
$formValues = $this->getFormValues();
foreach ($attributes as $code => $attribute) {
$defaultValue = $attribute->getDefaultValue();
if (isset($defaultValue) && !isset($formValues[$code])) {
$formValues[$code] = $defaultValue;
}
if ($code === 'group_id' && empty($defaultValue)) {
$formValues[$code] = $this->getDefaultCustomerGroup($storeId);
}
}

return $formValues;
}

/**
* Gets default customer group.
*
* @param int $storeId
* @return string|null
*/
private function getDefaultCustomerGroup(int $storeId): ?string
{
return $this->_scopeConfig->getValue(
'customer/create_account/default_group',
ScopeInterface::SCOPE_STORE,
$storeId
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminChangeCustomerGroupInNewOrder">
<annotations>
<title value="Customer account group cannot be selected while creating a new customer in order"/>
<stories value="MC-15290: Customer account group cannot be selected while creating a new customer in order"/>
<description value="Customer account group cannot be selected while creating a new customer in order"/>
<severity value="MAJOR"/>
<testCaseId value="MC-15290"/>
<useCaseId value="MC-15289"/>
<group value="sales"/>
</annotations>

<before>
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="openNewOrder"/>
<selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="Retailer" stepKey="selectCustomerGroup"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<grabValueFrom selector="{{AdminOrderFormAccountSection.group}}" stepKey="grabGroupValue"/>
<assertEquals stepKey="assertValueIsStillSelected">
<actualResult type="variable">$grabGroupValue</actualResult>
<expectedResult type="string">3</expectedResult>
</assertEquals>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
</arguments>
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnTheStorePage"/>
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickOnResetButton"/>
<waitForPageLoad stepKey="waitForPageLoadAfterResetButtonClicked" time="10"/>
<fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillSearchWebsiteField"/>
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton" />
<waitForPageLoad stepKey="waitForPageLoadAfterSearch" time="10"/>
<see userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="verifyThatCorrectWebsiteFound"/>
<click selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="clickEditExistingWebsite"/>

<waitForPageLoad stepKey="waitForPageLoadAfterWebsiteSelected" time="30"/>
<click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteWebsiteButtonOnEditStorePage"/>
<selectOption userInput="No" selector="{{AdminStoresDeleteWebsiteSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/>
<click selector="{{AdminStoresDeleteWebsiteSection.deleteButton}}" stepKey="clickDeleteButtonOnDeleteWebsitePage"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the website." stepKey="checkSuccessMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminStoresDeleteWebsiteSection">
<element name="createDbBackup" type="select" selector="#store_create_backup"/>
<element name="deleteButton" type="button" selector="#delete" timeout="30"/>
<element name="deleteButton" type="button" selector="#delete" timeout="120"/>
</section>
</sections>
175 changes: 0 additions & 175 deletions dev/tests/acceptance/RoboFile.php

This file was deleted.

25 changes: 0 additions & 25 deletions dev/tests/acceptance/composer.json

This file was deleted.

Loading

0 comments on commit b838e74

Please sign in to comment.