Skip to content

Commit e7e005d

Browse files
author
Dmytro Poperechnyy
committed
Merge remote-tracking branch 'origin/develop' into MAGETWO-28876
2 parents a51bd70 + 2b81885 commit e7e005d

File tree

261 files changed

+5536
-12921
lines changed

Some content is hidden

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

261 files changed

+5536
-12921
lines changed

app/code/Magento/Catalog/Model/Product.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,11 +1159,10 @@ public function setFinalPrice($price)
11591159
*/
11601160
public function getFinalPrice($qty = null)
11611161
{
1162-
$price = $this->_getData('final_price');
1163-
if ($price !== null) {
1164-
return $price;
1162+
if ($this->_getData('final_price') === null) {
1163+
$this->setFinalPrice($this->getPriceModel()->getFinalPrice($qty, $this));
11651164
}
1166-
return $this->getPriceModel()->getFinalPrice($qty, $this);
1165+
return $this->_getData('final_price');
11671166
}
11681167

11691168
/**

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,4 +1370,41 @@ protected function getPropertyValue(&$object, $property)
13701370

13711371
return $reflectionProperty->getValue($object);
13721372
}
1373+
1374+
public function testGetFinalPrice()
1375+
{
1376+
$finalPrice = 11;
1377+
$qty = 1;
1378+
$this->model->setQty($qty);
1379+
$productTypePriceMock = $this->getMock(
1380+
'Magento\Catalog\Model\Product\Type\Price',
1381+
['getFinalPrice'],
1382+
[],
1383+
'',
1384+
false
1385+
);
1386+
1387+
$productTypePriceMock->expects($this->any())
1388+
->method('getFinalPrice')
1389+
->with($qty, $this->model)
1390+
->will($this->returnValue($finalPrice));
1391+
1392+
$this->productTypeInstanceMock->expects($this->any())
1393+
->method('priceFactory')
1394+
->with($this->model->getTypeId())
1395+
->will($this->returnValue($productTypePriceMock));
1396+
1397+
$this->assertEquals($finalPrice, $this->model->getFinalPrice($qty));
1398+
$this->model->setFinalPrice(9.99);
1399+
}
1400+
1401+
public function testGetFinalPricePreset()
1402+
{
1403+
$finalPrice = 9.99;
1404+
$qty = 1;
1405+
$this->model->setQty($qty);
1406+
$this->model->setFinalPrice($finalPrice);
1407+
$this->productTypeInstanceMock->expects($this->never())->method('priceFactory');
1408+
$this->assertEquals($finalPrice, $this->model->getFinalPrice($qty));
1409+
}
13731410
}

app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Actions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ protected function _prepareForm()
140140
'stop_rules_processing',
141141
'select',
142142
[
143-
'label' => __('Subsequent rules'),
144-
'title' => __('Subsequent rules'),
143+
'label' => __('Discard subsequent rules'),
144+
'title' => __('Discard subsequent rules'),
145145
'name' => 'stop_rules_processing',
146146
'options' => ['1' => __('Yes'), '0' => __('No')]
147147
]

app/code/Magento/CatalogRule/Model/Indexer/AbstractIndexer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77

88
use Magento\Framework\Mview\ActionInterface as MviewActionInterface;
99
use Magento\Indexer\Model\ActionInterface as IndexerActionInterface;
10+
use Magento\Framework\Object\IdentityInterface as IdentityInterface;
1011

11-
abstract class AbstractIndexer implements IndexerActionInterface, MviewActionInterface
12+
abstract class AbstractIndexer implements IndexerActionInterface, MviewActionInterface, IdentityInterface
1213
{
1314
/**
1415
* @var IndexBuilder
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
9+
<event name="catalog_product_get_final_price">
10+
<observer name="catalogrule" instance="Magento\CatalogRule\Model\Observer" method="processFrontFinalPrice" />
11+
</event>
12+
<event name="prepare_catalog_product_collection_prices">
13+
<observer name="catalogrule" instance="Magento\CatalogRule\Model\Observer" method="prepareCatalogProductCollectionPrices" />
14+
</event>
15+
</config>

app/code/Magento/Checkout/Block/Cart/Item/Renderer.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Checkout\Block\Cart\Item\Renderer\Actions;
1212
use Magento\Framework\Pricing\PriceCurrencyInterface;
1313
use Magento\Framework\View\Element\AbstractBlock;
14-
use Magento\Quote\Model\Quote\Item;
14+
use Magento\Quote\Model\Quote\Item\AbstractItem;
1515
use Magento\Catalog\Pricing\Price\ConfiguredPriceInterface;
1616

1717
/**
@@ -31,7 +31,7 @@ class Renderer extends \Magento\Framework\View\Element\Template implements \Mage
3131
protected $_checkoutSession;
3232

3333
/**
34-
* @var Item
34+
* @var AbstractItem
3535
*/
3636
protected $_item;
3737

@@ -122,10 +122,10 @@ public function __construct(
122122
/**
123123
* Set item for render
124124
*
125-
* @param Item $item
125+
* @param AbstractItem $item
126126
* @return $this
127127
*/
128-
public function setItem(Item $item)
128+
public function setItem(AbstractItem $item)
129129
{
130130
$this->_item = $item;
131131
return $this;
@@ -134,7 +134,7 @@ public function setItem(Item $item)
134134
/**
135135
* Get quote item
136136
*
137-
* @return Item
137+
* @return AbstractItem
138138
*/
139139
public function getItem()
140140
{
@@ -518,10 +518,10 @@ public function convertPrice($amount, $format = false)
518518
/**
519519
* Return the unit price html
520520
*
521-
* @param Item $item
521+
* @param AbstractItem $item
522522
* @return string
523523
*/
524-
public function getUnitPriceHtml(Item $item)
524+
public function getUnitPriceHtml(AbstractItem $item)
525525
{
526526
/** @var Renderer $block */
527527
$block = $this->getLayout()->getBlock('checkout.item.price.unit');
@@ -532,10 +532,10 @@ public function getUnitPriceHtml(Item $item)
532532
/**
533533
* Return row total html
534534
*
535-
* @param Item $item
535+
* @param AbstractItem $item
536536
* @return string
537537
*/
538-
public function getRowTotalHtml(Item $item)
538+
public function getRowTotalHtml(AbstractItem $item)
539539
{
540540
/** @var Renderer $block */
541541
$block = $this->getLayout()->getBlock('checkout.item.price.row');
@@ -546,10 +546,10 @@ public function getRowTotalHtml(Item $item)
546546
/**
547547
* Return item price html for sidebar
548548
*
549-
* @param Item $item
549+
* @param AbstractItem $item
550550
* @return string
551551
*/
552-
public function getSidebarItemPriceHtml(Item $item)
552+
public function getSidebarItemPriceHtml(AbstractItem $item)
553553
{
554554
/** @var Renderer $block */
555555
$block = $this->getLayout()->getBlock('checkout.cart.item.price.sidebar');
@@ -560,10 +560,10 @@ public function getSidebarItemPriceHtml(Item $item)
560560
/**
561561
* Get unit price excluding tax html
562562
*
563-
* @param Item $item
563+
* @param AbstractItem $item
564564
* @return string
565565
*/
566-
public function getUnitPriceExclTaxHtml(Item $item)
566+
public function getUnitPriceExclTaxHtml(AbstractItem $item)
567567
{
568568
/** @var Renderer $block */
569569
$block = $this->getLayout()->getBlock('checkout.onepage.review.item.price.unit.excl');
@@ -574,10 +574,10 @@ public function getUnitPriceExclTaxHtml(Item $item)
574574
/**
575575
* Get unit price including tax html
576576
*
577-
* @param Item $item
577+
* @param AbstractItem $item
578578
* @return string
579579
*/
580-
public function getUnitPriceInclTaxHtml(Item $item)
580+
public function getUnitPriceInclTaxHtml(AbstractItem $item)
581581
{
582582
/** @var Renderer $block */
583583
$block = $this->getLayout()->getBlock('checkout.onepage.review.item.price.unit.incl');
@@ -588,10 +588,10 @@ public function getUnitPriceInclTaxHtml(Item $item)
588588
/**
589589
* Get row total excluding tax html
590590
*
591-
* @param Item $item
591+
* @param AbstractItem $item
592592
* @return string
593593
*/
594-
public function getRowTotalExclTaxHtml(Item $item)
594+
public function getRowTotalExclTaxHtml(AbstractItem $item)
595595
{
596596
/** @var Renderer $block */
597597
$block = $this->getLayout()->getBlock('checkout.onepage.review.item.price.rowtotal.excl');
@@ -602,10 +602,10 @@ public function getRowTotalExclTaxHtml(Item $item)
602602
/**
603603
* Get row total including tax html
604604
*
605-
* @param Item $item
605+
* @param AbstractItem $item
606606
* @return string
607607
*/
608-
public function getRowTotalInclTaxHtml(Item $item)
608+
public function getRowTotalInclTaxHtml(AbstractItem $item)
609609
{
610610
/** @var Renderer $block */
611611
$block = $this->getLayout()->getBlock('checkout.onepage.review.item.price.rowtotal.incl');
@@ -616,10 +616,10 @@ public function getRowTotalInclTaxHtml(Item $item)
616616
/**
617617
* Get row total including tax html
618618
*
619-
* @param Item $item
619+
* @param AbstractItem $item
620620
* @return string
621621
*/
622-
public function getActions(Item $item)
622+
public function getActions(AbstractItem $item)
623623
{
624624
/** @var Actions $block */
625625
$block = $this->getChildBlock('actions');

app/code/Magento/Checkout/Block/Cart/Item/Renderer/Actions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77

88
use Magento\Checkout\Block\Cart\Item\Renderer\Actions\Generic;
99
use Magento\Framework\View\Element\Text;
10-
use Magento\Quote\Model\Quote\Item;
10+
use Magento\Quote\Model\Quote\Item\AbstractItem;
1111

1212
class Actions extends Text
1313
{
1414
/**
15-
* @var Item
15+
* @var AbstractItem
1616
*/
1717
protected $item;
1818

1919
/**
2020
* Returns current quote item
2121
*
22-
* @return Item
22+
* @return AbstractItem
2323
*/
2424
public function getItem()
2525
{
@@ -29,10 +29,10 @@ public function getItem()
2929
/**
3030
* Set current quote item
3131
*
32-
* @param Item $item
32+
* @param AbstractItem $item
3333
* @return $this
3434
*/
35-
public function setItem(Item $item)
35+
public function setItem(AbstractItem $item)
3636
{
3737
$this->item = $item;
3838
return $this;

app/code/Magento/Checkout/Block/Cart/Item/Renderer/Actions/Generic.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
namespace Magento\Checkout\Block\Cart\Item\Renderer\Actions;
77

88
use Magento\Framework\View\Element\Template;
9-
use Magento\Quote\Model\Quote\Item;
9+
use Magento\Quote\Model\Quote\Item\AbstractItem;
1010

1111
class Generic extends Template
1212
{
1313
/**
14-
* @var Item
14+
* @var AbstractItem
1515
*/
1616
protected $item;
1717

1818
/**
1919
* Returns current quote item
2020
*
21-
* @return Item
21+
* @return AbstractItem
2222
*/
2323
public function getItem()
2424
{
@@ -28,10 +28,10 @@ public function getItem()
2828
/**
2929
* Set current quote item
3030
*
31-
* @param Item $item
31+
* @param AbstractItem $item
3232
* @return $this
3333
*/
34-
public function setItem(Item $item)
34+
public function setItem(AbstractItem $item)
3535
{
3636
$this->item = $item;
3737
return $this;

app/code/Magento/Checkout/Helper/Cart.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function getAddUrl($product, $additional = [])
9999
/**
100100
* Retrieve url for remove product from cart
101101
*
102-
* @param \Magento\Quote\Model\Quote\Item $item
102+
* @param \Magento\Quote\Model\Quote\Item\AbstractItem $item
103103
* @return string
104104
*/
105105
public function getRemoveUrl($item)
@@ -114,7 +114,7 @@ public function getRemoveUrl($item)
114114
/**
115115
* Get post parameters for delete from cart
116116
*
117-
* @param \Magento\Quote\Model\Quote\Item $item
117+
* @param \Magento\Quote\Model\Quote\Item\AbstractItem $item
118118
* @return string
119119
*/
120120
public function getDeletePostJson($item)

app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,21 @@
6868
<item name="displayArea" xsi:type="string">dataGridActions</item>
6969
</item>
7070
</argument>
71-
</container>
71+
</container>
72+
<container name="search">
73+
<argument name="data" xsi:type="array">
74+
<item name="config" xsi:type="array">
75+
<item name="component" xsi:type="string">Magento_Ui/js/grid/search/search</item>
76+
<item name="displayArea" xsi:type="string">dataGridFilters</item>
77+
<item name="provider" xsi:type="string">cms_block_listing.cms_block_listing_data_source</item>
78+
<item name="chipsProvider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.listing_filters_chips</item>
79+
<item name="storageConfig" xsi:type="array">
80+
<item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
81+
<item name="namespace" xsi:type="string">current.search</item>
82+
</item>
83+
</item>
84+
</argument>
85+
</container>
7286
<filters name="listing_filters">
7387
<argument name="data" xsi:type="array">
7488
<item name="config" xsi:type="array">
@@ -288,13 +302,19 @@
288302
<item name="namespace" xsi:type="string">current</item>
289303
</item>
290304
<item name="childDefaults" xsi:type="array">
305+
<item name="fieldAction" xsi:type="array">
306+
<item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns.actions</item>
307+
<item name="target" xsi:type="string">applyAction</item>
308+
<item name="params" xsi:type="array">
309+
<item name="0" xsi:type="string">edit</item>
310+
<item name="1" xsi:type="string">${ $.$data.rowIndex }</item>
311+
</item>
312+
</item>
291313
<item name="controlVisibility" xsi:type="boolean">true</item>
292-
<item name="actionField" xsi:type="string">actions</item>
293-
<item name="clickAction" xsi:type="string">edit</item>
294314
<item name="storageConfig" xsi:type="array">
295315
<item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
296316
<item name="root" xsi:type="string">columns.${ $.index }</item>
297-
<item name="namespace" xsi:type="string">current.${ $.storageConfig.root}</item>
317+
<item name="namespace" xsi:type="string">current.${ $.storageConfig.root }</item>
298318
</item>
299319
</item>
300320
</item>

0 commit comments

Comments
 (0)