Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit c429462

Browse files
authored
Merge pull request #9 from magento/2.3-develop
2.3-update
2 parents 2f60707 + 7755eef commit c429462

File tree

65 files changed

+1391
-417
lines changed

Some content is hidden

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

65 files changed

+1391
-417
lines changed

app/code/Magento/Backend/Block/Widget/Form.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ protected function _construct()
5959
parent::_construct();
6060

6161
$this->setDestElementId('edit_form');
62-
$this->setShowGlobalIcon(false);
6362
}
6463

6564
/**

app/code/Magento/Backend/Block/Widget/Grid.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @api
1313
* @deprecated 100.2.0 in favour of UI component implementation
1414
* @method string getRowClickCallback() getRowClickCallback()
15-
* @method \Magento\Backend\Block\Widget\Grid setRowClickCallback() setRowClickCallback(string $value)
15+
* @method \Magento\Backend\Block\Widget\Grid setRowClickCallback(string $value)
1616
* @SuppressWarnings(PHPMD.TooManyFields)
1717
* @since 100.0.2
1818
*/
@@ -150,7 +150,10 @@ public function __construct(
150150
}
151151

152152
/**
153+
* Internal constructor, that is called from real constructor
154+
*
153155
* @return void
156+
*
154157
* @SuppressWarnings(PHPMD.NPathComplexity)
155158
*/
156159
protected function _construct()
@@ -709,6 +712,7 @@ public function getGridUrl()
709712

710713
/**
711714
* Grid url getter
715+
*
712716
* Version of getGridUrl() but with parameters
713717
*
714718
* @param array $params url parameters

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ public function __construct(
6464
parent::__construct($context, $registry, $formFactory, $data);
6565
}
6666

67-
/**
68-
* Construct block
69-
*
70-
* @return void
71-
*/
72-
protected function _construct()
73-
{
74-
parent::_construct();
75-
$this->setShowGlobalIcon(true);
76-
}
77-
7867
/**
7968
* Prepares form
8069
*

app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
namespace Magento\Catalog\Block\Product\ProductList;
1111

12+
/**
13+
* Crosssell block for product
14+
*/
1215
class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct
1316
{
1417
/**
@@ -25,7 +28,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct
2528
*/
2629
protected function _prepareData()
2730
{
28-
$product = $this->_coreRegistry->registry('product');
31+
$product = $this->getProduct();
2932
/* @var $product \Magento\Catalog\Model\Product */
3033

3134
$this->_itemCollection = $product->getCrossSellProductCollection()->addAttributeToSelect(
@@ -43,6 +46,7 @@ protected function _prepareData()
4346

4447
/**
4548
* Before rendering html process
49+
*
4650
* Prepare items collection
4751
*
4852
* @return \Magento\Catalog\Block\Product\ProductList\Crosssell

app/code/Magento/Catalog/Block/Product/ProductList/Related.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ public function __construct(
7777
}
7878

7979
/**
80+
* Prepare data
81+
*
8082
* @return $this
8183
*/
8284
protected function _prepareData()
8385
{
84-
$product = $this->_coreRegistry->registry('product');
86+
$product = $this->getProduct();
8587
/* @var $product \Magento\Catalog\Model\Product */
8688

8789
$this->_itemCollection = $product->getRelatedProductCollection()->addAttributeToSelect(
@@ -103,6 +105,8 @@ protected function _prepareData()
103105
}
104106

105107
/**
108+
* Before to html handler
109+
*
106110
* @return $this
107111
*/
108112
protected function _beforeToHtml()
@@ -112,6 +116,8 @@ protected function _beforeToHtml()
112116
}
113117

114118
/**
119+
* Get collection items
120+
*
115121
* @return Collection
116122
*/
117123
public function getItems()

app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ public function __construct(
9191
}
9292

9393
/**
94+
* Prepare data
95+
*
9496
* @return $this
9597
*/
9698
protected function _prepareData()
9799
{
98-
$product = $this->_coreRegistry->registry('product');
100+
$product = $this->getProduct();
99101
/* @var $product \Magento\Catalog\Model\Product */
100102
$this->_itemCollection = $product->getUpSellProductCollection()->setPositionOrder()->addStoreFilter();
101103
if ($this->moduleManager->isEnabled('Magento_Checkout')) {
@@ -121,6 +123,8 @@ protected function _prepareData()
121123
}
122124

123125
/**
126+
* Before to html handler
127+
*
124128
* @return $this
125129
*/
126130
protected function _beforeToHtml()
@@ -130,6 +134,8 @@ protected function _beforeToHtml()
130134
}
131135

132136
/**
137+
* Get items collection
138+
*
133139
* @return Collection
134140
*/
135141
public function getItemCollection()
@@ -145,6 +151,8 @@ public function getItemCollection()
145151
}
146152

147153
/**
154+
* Get collection items
155+
*
148156
* @return \Magento\Framework\DataObject[]
149157
*/
150158
public function getItems()
@@ -156,6 +164,8 @@ public function getItems()
156164
}
157165

158166
/**
167+
* Get row count
168+
*
159169
* @return float
160170
*/
161171
public function getRowCount()
@@ -164,6 +174,8 @@ public function getRowCount()
164174
}
165175

166176
/**
177+
* Set column count
178+
*
167179
* @param string $columns
168180
* @return $this
169181
*/
@@ -176,6 +188,8 @@ public function setColumnCount($columns)
176188
}
177189

178190
/**
191+
* Get column count
192+
*
179193
* @return int
180194
*/
181195
public function getColumnCount()
@@ -184,6 +198,8 @@ public function getColumnCount()
184198
}
185199

186200
/**
201+
* Reset items iterator
202+
*
187203
* @return void
188204
*/
189205
public function resetItemsIterator()
@@ -193,6 +209,8 @@ public function resetItemsIterator()
193209
}
194210

195211
/**
212+
* Get iterable item
213+
*
196214
* @return mixed
197215
*/
198216
public function getIterableItem()
@@ -204,6 +222,7 @@ public function getIterableItem()
204222

205223
/**
206224
* Set how many items we need to show in upsell block
225+
*
207226
* Notice: this parameter will be also applied
208227
*
209228
* @param string $type
@@ -219,6 +238,8 @@ public function setItemLimit($type, $limit)
219238
}
220239

221240
/**
241+
* Get item limit
242+
*
222243
* @param string $type
223244
* @return array|int
224245
*/

app/code/Magento/Catalog/Controller/Product/Compare.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Catalog\Controller\Product;
77

88
use Magento\Catalog\Api\ProductRepositoryInterface;
9+
use Magento\Framework\App\Action\HttpGetActionInterface;
910
use Magento\Framework\Data\Form\FormKey\Validator;
1011
use Magento\Framework\View\Result\PageFactory;
1112

@@ -15,7 +16,7 @@
1516
* @SuppressWarnings(PHPMD.LongVariable)
1617
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1718
*/
18-
abstract class Compare extends \Magento\Framework\App\Action\Action
19+
abstract class Compare extends \Magento\Framework\App\Action\Action implements HttpGetActionInterface
1920
{
2021
/**
2122
* Customer id
@@ -139,4 +140,15 @@ public function setCustomerId($customerId)
139140
$this->_customerId = $customerId;
140141
return $this;
141142
}
143+
144+
/**
145+
* @inheritdoc
146+
*/
147+
public function execute()
148+
{
149+
$resultRedirect = $this->resultRedirectFactory->create();
150+
$resultRedirect->setPath('catalog/product_compare');
151+
152+
return $resultRedirect;
153+
}
142154
}

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,28 @@
213213
<conditionalClick selector="{{AdminProductGridTableHeaderSection.id('descend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('ascend')}}" visible="false" stepKey="sortById"/>
214214
<waitForPageLoad stepKey="waitForPageLoad"/>
215215
</actionGroup>
216+
217+
<!--Disabled a product by filtering grid and using change status action-->
218+
<actionGroup name="ChangeStatusProductUsingProductGridActionGroup">
219+
<arguments>
220+
<argument name="product"/>
221+
<argument name="status" defaultValue="Enable" type="string" />
222+
</arguments>
223+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
224+
<waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/>
225+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
226+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
227+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
228+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
229+
<see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/>
230+
<click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/>
231+
<click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/>
232+
233+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
234+
<click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/>
235+
<click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled" parameterized="true"/>
236+
<see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/>
237+
<waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/>
238+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>
239+
</actionGroup>
216240
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
<element name="productGridNameProduct" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/>
3131
<element name="productGridContentsOnRow" type="checkbox" selector="//*[@id='container']//tr[{{row}}]/td" parameterized="true"/>
3232
<element name="selectRowBasedOnName" type="input" selector="//td/div[text()='{{var1}}']" parameterized="true"/>
33+
<element name="changeStatus" type="button" selector="//div[contains(@class,'admin__data-grid-header-row') and contains(@class, 'row')]//div[contains(@class, 'action-menu-item')]//ul/li/span[text() = '{{status}}']" parameterized="true"/>
3334
</section>
3435
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959

6060
<!--Step5. Open *Advanced Inventory* pop-up. Set *Enable Qty Increments* to *Yes*. Fill *.5* in *Qty Increments*-->
6161
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink2"/>
62+
<waitForPageLoad stepKey="waitForPageLoad"/>
6263
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrements}}" stepKey="scrollToEnableQtyIncrements"/>
6364
<click selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrementsUseConfigSettings}}" stepKey="clickOnEnableQtyIncrementsUseConfigSettingsCheckbox"/>
6465
<click selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrements}}" stepKey="clickOnEnableQtyIncrements"/>

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Catalog\Model\Attribute\ScopeOverriddenValue;
1212
use Magento\Catalog\Model\Locator\LocatorInterface;
1313
use Magento\Catalog\Model\Product;
14+
use Magento\Catalog\Model\Product\Type as ProductType;
1415
use Magento\Catalog\Model\ResourceModel\Eav\Attribute as EavAttribute;
1516
use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory as EavAttributeFactory;
1617
use Magento\Catalog\Ui\DataProvider\CatalogEavValidationRules;
@@ -419,7 +420,7 @@ public function modifyData(array $data)
419420

420421
foreach ($attributes as $attribute) {
421422
if (null !== ($attributeValue = $this->setupAttributeData($attribute))) {
422-
if ($attribute->getFrontendInput() === 'price' && is_scalar($attributeValue)) {
423+
if ($this->isPriceAttribute($attribute, $attributeValue)) {
423424
$attributeValue = $this->formatPrice($attributeValue);
424425
}
425426
$data[$productId][self::DATA_SOURCE_DEFAULT][$attribute->getAttributeCode()] = $attributeValue;
@@ -430,6 +431,32 @@ public function modifyData(array $data)
430431
return $data;
431432
}
432433

434+
/**
435+
* Obtain if given attribute is a price
436+
*
437+
* @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
438+
* @param string|integer $attributeValue
439+
* @return bool
440+
*/
441+
private function isPriceAttribute(ProductAttributeInterface $attribute, $attributeValue)
442+
{
443+
return $attribute->getFrontendInput() === 'price'
444+
&& is_scalar($attributeValue)
445+
&& !$this->isBundleSpecialPrice($attribute);
446+
}
447+
448+
/**
449+
* Obtain if current product is bundle and given attribute is special_price
450+
*
451+
* @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
452+
* @return bool
453+
*/
454+
private function isBundleSpecialPrice(ProductAttributeInterface $attribute)
455+
{
456+
return $this->locator->getProduct()->getTypeId() === ProductType::TYPE_BUNDLE
457+
&& $attribute->getAttributeCode() === ProductAttributeInterface::CODE_SPECIAL_PRICE;
458+
}
459+
433460
/**
434461
* Resolve data persistence
435462
*

0 commit comments

Comments
 (0)