Skip to content

Commit cce6b67

Browse files
committed
Merge remote-tracking branch 'kiwis/develop' into MAGETWO-41948
2 parents ddeffdb + 5de0d5d commit cce6b67

File tree

176 files changed

+1009
-7646
lines changed

Some content is hidden

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

176 files changed

+1009
-7646
lines changed

app/code/Magento/Backend/App/AbstractAction.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ protected function _processLocaleSettings()
300300
/**
301301
* Set redirect into response
302302
*
303-
* @deprecated
304303
* @TODO MAGETWO-28356: Refactor controller actions to new ResultInterface
305304
* @param string $path
306305
* @param array $arguments
@@ -316,7 +315,6 @@ protected function _redirect($path, $arguments = [])
316315
/**
317316
* Forward to action
318317
*
319-
* @deprecated
320318
* @TODO MAGETWO-28356: Refactor controller actions to new ResultInterface
321319
* @param string $action
322320
* @param string|null $controller

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* @method \Magento\Quote\Model\Quote setHideFormElement(boolean $value) Hide Form element to prevent IE errors
1212
* @method boolean getHideFormElement()
1313
* @author Magento Core Team <core@magentocommerce.com>
14-
* @deprecated support Magento 1.x grid massaction implementation
1514
* @TODO MAGETWO-31510: Remove deprecated class
1615
*/
1716
class Extended extends \Magento\Backend\Block\Widget

app/code/Magento/Backend/view/adminhtml/templates/widget/grid/massaction_extended.phtml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
// @codingStandardsIgnoreFile
88

9-
/**
10-
* @deprecated support Magento 1.x grid massaction implementation
11-
*/
129
?>
1310
<div id="<?php echo $block->getHtmlId() ?>" class="admin__grid-massaction">
1411

app/code/Magento/Bundle/Model/Product/Price.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ public function getIsPricesCalculatedByIndex()
9797
*
9898
* @param \Magento\Catalog\Model\Product $product
9999
* @return float
100-
*
101-
* @deprecated (MAGETWO-31476)
102100
*/
103101
public function getPrice($product)
104102
{
@@ -375,7 +373,6 @@ public function getOptions($product)
375373
* @param null|bool $multiplyQty Whether to multiply selection's price by its quantity
376374
* @return float
377375
*
378-
* @deprecated after 1.6.2.0 (MAGETWO-31475)
379376
* @see \Magento\Bundle\Model\Product\Price::getSelectionFinalTotalPrice()
380377
*/
381378
public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty = null, $multiplyQty = true)

app/code/Magento/Bundle/Pricing/Render/FinalPriceBox.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,33 @@
88

99
use Magento\Bundle\Pricing\Price;
1010
use Magento\Catalog\Pricing\Render as CatalogRender;
11+
use Magento\Catalog\Pricing\Price\CustomOptionPrice;
1112

1213
/**
1314
* Class for final_price rendering
1415
*/
1516
class FinalPriceBox extends CatalogRender\FinalPriceBox
1617
{
1718
/**
18-
* Check if bundle product has one more custom option with different prices
19+
* Check if bundle product has one or more options, or custom options, with different prices
1920
*
2021
* @return bool
2122
*/
2223
public function showRangePrice()
2324
{
24-
/** @var Price\BundleOptionPrice $optionPrice */
25-
$optionPrice = $this->getPriceType(Price\BundleOptionPrice::PRICE_CODE);
26-
return $optionPrice->getValue() !== $optionPrice->getMaxValue();
25+
//Check the bundle options
26+
/** @var Price\BundleOptionPrice $bundleOptionPrice */
27+
$bundleOptionPrice = $this->getPriceType(Price\BundleOptionPrice::PRICE_CODE);
28+
$showRange = $bundleOptionPrice->getValue() != $bundleOptionPrice->getMaxValue();
29+
30+
if (!$showRange) {
31+
//Check the custom options, if any
32+
/** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */
33+
$customOptionPrice = $this->getPriceType(CustomOptionPrice::PRICE_CODE);
34+
$showRange =
35+
$customOptionPrice->getCustomOptionRange(true) != $customOptionPrice->getCustomOptionRange(false);
36+
}
37+
38+
return $showRange;
2739
}
2840
}

app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php

Lines changed: 62 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66
namespace Magento\Bundle\Test\Unit\Pricing\Render;
77

8-
use \Magento\Bundle\Pricing\Render\FinalPriceBox;
9-
8+
use Magento\Bundle\Pricing\Render\FinalPriceBox;
109
use Magento\Bundle\Pricing\Price;
10+
use Magento\Catalog\Pricing\Price\CustomOptionPrice;
1111

1212
class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase
1313
{
@@ -34,31 +34,50 @@ public function setUp()
3434
/**
3535
* @dataProvider showRangePriceDataProvider
3636
*/
37-
public function testShowRangePrice($value, $maxValue, $result)
37+
public function testShowRangePrice($optMinValue, $optMaxValue, $custMinValue, $custMaxValue, $expectedShowRange)
3838
{
39+
$enableCustomOptionMocks = ($optMinValue == $optMaxValue);
40+
3941
$priceInfo = $this->getMock('Magento\Framework\Pricing\PriceInfo\Base', [], [], '', false);
40-
$optionPrice = $this->getMockBuilder('Magento\Bundle\Pricing\Price\BundleOptionPrice')
42+
$bundleOptionPrice = $this->getMockBuilder('Magento\Bundle\Pricing\Price\BundleOptionPrice')
43+
->disableOriginalConstructor()
44+
->getMock();
45+
$customOptionPrice = $this->getMockBuilder('Magento\Catalog\Pricing\Price\CustomOptionPrice')
4146
->disableOriginalConstructor()
4247
->getMock();
4348

4449
$this->saleableItem->expects($this->atLeastOnce())
4550
->method('getPriceInfo')
4651
->will($this->returnValue($priceInfo));
4752

48-
$priceInfo->expects($this->atLeastOnce())
53+
$priceInfo->expects($this->at(0))
4954
->method('getPrice')
5055
->with(Price\BundleOptionPrice::PRICE_CODE)
51-
->will($this->returnValue($optionPrice));
56+
->will($this->returnValue($bundleOptionPrice));
57+
if ($enableCustomOptionMocks) {
58+
$priceInfo->expects($this->at(1))
59+
->method('getPrice')
60+
->with(CustomOptionPrice::PRICE_CODE)
61+
->will($this->returnValue($customOptionPrice));
62+
}
5263

53-
$optionPrice->expects($this->once())
64+
$bundleOptionPrice->expects($this->once())
5465
->method('getValue')
55-
->will($this->returnValue($value));
56-
57-
$optionPrice->expects($this->once())
66+
->will($this->returnValue($optMinValue));
67+
$bundleOptionPrice->expects($this->once())
5868
->method('getMaxValue')
59-
->will($this->returnValue($maxValue));
69+
->will($this->returnValue($optMaxValue));
6070

61-
$this->assertEquals($result, $this->model->showRangePrice());
71+
if ($enableCustomOptionMocks) {
72+
$customOptionPrice->expects($this->at(0))
73+
->method('getCustomOptionRange')
74+
->will($this->returnValue($custMinValue));
75+
$customOptionPrice->expects($this->at(1))
76+
->method('getCustomOptionRange')
77+
->will($this->returnValue($custMaxValue));
78+
}
79+
80+
$this->assertEquals($expectedShowRange, $this->model->showRangePrice());
6281
}
6382

6483
/**
@@ -67,9 +86,37 @@ public function testShowRangePrice($value, $maxValue, $result)
6786
public function showRangePriceDataProvider()
6887
{
6988
return [
70-
['value' => 40.2, 'maxValue' => 45., 'result' => true],
71-
['value' => false, 'maxValue' => false, 'result' => false],
72-
['value' => 45.0, 'maxValue' => 45., 'result' => false],
89+
'bundle options different, custom options noop' => [
90+
'optMinValue' => 40.2,
91+
'optMaxValue' => 45.,
92+
'custMinValue' => 0,
93+
'custMaxValue' => 0,
94+
'expectedShowRange' => true
95+
],
96+
97+
'bundle options same boolean, custom options same boolean' => [
98+
'optMinValue' => false,
99+
'optMaxValue' => false,
100+
'custMinValue' => false,
101+
'custMaxValue' => false,
102+
'expectedShowRange' => false
103+
],
104+
105+
'bundle options same numeric, custom options same' => [
106+
'optMinValue' => 45.0,
107+
'optMaxValue' => 45,
108+
'custMinValue' => 1.0,
109+
'custMaxValue' => 1,
110+
'expectedShowRange' => false
111+
],
112+
113+
'bundle options same numeric, custom options different' => [
114+
'optMinValue' => 45.0,
115+
'optMaxValue' => 45.,
116+
'custMinValue' => 0,
117+
'custMaxValue' => 1,
118+
'expectedShowRange' => true
119+
],
73120
];
74121
}
75122
}

app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ public function getStoreConfigurationUrl()
142142

143143
/**
144144
* @return string
145-
* @deprecated (MAGETWO-31464)
146145
*/
147146
public function getDeleteButtonHtml()
148147
{
@@ -151,7 +150,6 @@ public function getDeleteButtonHtml()
151150

152151
/**
153152
* @return string
154-
* @deprecated (MAGETWO-31464)
155153
*/
156154
public function getSaveButtonHtml()
157155
{
@@ -163,7 +161,6 @@ public function getSaveButtonHtml()
163161

164162
/**
165163
* @return string
166-
* @deprecated (MAGETWO-31464)
167164
*/
168165
public function getResetButtonHtml()
169166
{

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,6 @@ public function setTierPrices(array $tierPrices = null)
10891089
*
10901090
* @param float $qty
10911091
* @return float|array
1092-
* @deprecated (MAGETWO-31465)
10931092
*/
10941093
public function getTierPrice($qty = null)
10951094
{

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ protected function _applyTierPrice($product, $qty, $finalPrice)
254254
* @param float $qty
255255
* @param Product $product
256256
* @return float|array
257-
* @deprecated (MAGETWO-31465)
258257
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
259258
* @SuppressWarnings(PHPMD.NPathComplexity)
260259
*/
@@ -438,7 +437,6 @@ protected function _applySpecialPrice($product, $finalPrice)
438437
*
439438
* @param Product $product
440439
* @return int
441-
* @deprecated
442440
*/
443441
public function getTierPriceCount($product)
444442
{
@@ -452,7 +450,6 @@ public function getTierPriceCount($product)
452450
* @param float $qty
453451
* @param Product $product
454452
* @return array|float
455-
* @deprecated
456453
*/
457454
public function getFormatedTierPrice($qty, $product)
458455
{
@@ -488,7 +485,6 @@ public function getFormatedPrice($product)
488485
* @param int $qty
489486
* @param float $finalPrice
490487
* @return float
491-
* @deprecated (MAGETWO-31469)
492488
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
493489
*/
494490
protected function _applyOptionsPrice($product, $qty, $finalPrice)

app/code/Magento/Catalog/view/adminhtml/templates/product/grid/massaction_extended.phtml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
// @codingStandardsIgnoreFile
88

9-
/**
10-
* @deprecated support Magento 1.x grid massaction implementation (MAGETWO-11122)
11-
*/
129
?>
1310
<div id="<?php echo $block->getHtmlId() ?>" class="admin__grid-massaction">
1411
<?php if ($block->getHideFormElement() !== true):?>

0 commit comments

Comments
 (0)