Skip to content

Commit 797f409

Browse files
author
Robert He
committed
Merge branch 'FearlessKiwis-MAGETWO-43908-rename_weee_functions' of https://github.corp.magento.com/magento-fearless-kiwis/magento2ce into develop-PR
Conflicts: app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php
2 parents 3f30755 + 226bd12 commit 797f409

File tree

4 files changed

+32
-17
lines changed

4 files changed

+32
-17
lines changed

app/code/Magento/Weee/Helper/Data.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -739,12 +739,12 @@ public function getTotalAmounts($items, $store = null)
739739
}
740740

741741
/**
742-
* get FPT DISPLAY_INCL setting
742+
* Get FPT DISPLAY_INCL setting
743743
*
744744
* @param int|null $storeId
745745
* @return bool
746746
*/
747-
public function geDisplayIncl($storeId = null)
747+
public function isDisplayIncl($storeId = null)
748748
{
749749
return $this->typeOfDisplay(
750750
WeeeDisplayConfig::DISPLAY_INCL,
@@ -754,12 +754,27 @@ public function geDisplayIncl($storeId = null)
754754
}
755755

756756
/**
757-
* get FPT DISPLAY_EXCL_DESCR_INCL setting
757+
* Get FPT DISPLAY_INCL_DESCR setting
758758
*
759759
* @param int|null $storeId
760760
* @return bool
761761
*/
762-
public function geDisplayExlDescIncl($storeId = null)
762+
public function isDisplayInclDesc($storeId = null)
763+
{
764+
return $this->typeOfDisplay(
765+
WeeeDisplayConfig::DISPLAY_INCL_DESCR,
766+
\Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW,
767+
$storeId
768+
);
769+
}
770+
771+
/**
772+
* Get FPT DISPLAY_EXCL_DESCR_INCL setting
773+
*
774+
* @param int|null $storeId
775+
* @return bool
776+
*/
777+
public function isDisplayExclDescIncl($storeId = null)
763778
{
764779
return $this->typeOfDisplay(
765780
WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL,
@@ -769,12 +784,12 @@ public function geDisplayExlDescIncl($storeId = null)
769784
}
770785

771786
/**
772-
* get FPT DISPLAY_EXCL setting
787+
* Get FPT DISPLAY_EXCL setting
773788
*
774789
* @param int|null $storeId
775790
* @return bool
776791
*/
777-
public function geDisplayExcl($storeId = null)
792+
public function isDisplayExcl($storeId = null)
778793
{
779794
return $this->typeOfDisplay(
780795
WeeeDisplayConfig::DISPLAY_EXCL,

app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ private function insertWeeePrice($holder, $key, $weeeAttributes)
142142
protected function getWhichCalcPriceToUse($storeId = null)
143143
{
144144
$calcPrice = 'finalPrice';
145-
if ($this->weeeData->geDisplayExcl($storeId) ||
146-
$this->weeeData->geDisplayExlDescIncl($storeId) ||
145+
if ($this->weeeData->isDisplayExcl($storeId) ||
146+
$this->weeeData->isDisplayExclDescIncl($storeId) ||
147147
($this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax())
148148
) {
149149
$calcPrice = 'basePrice';

app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public function execute(\Magento\Framework\Event\Observer $observer)
7575
. '<% } %>';
7676
}
7777

78-
if (!$this->weeeData->geDisplayIncl($product->getStoreId()) &&
79-
!$this->weeeData->geDisplayExcl($product->getStoreId())) {
78+
if (!$this->weeeData->isDisplayIncl($product->getStoreId()) &&
79+
!$this->weeeData->isDisplayExcl($product->getStoreId())) {
8080
// we need to display the individual Weee amounts
8181
foreach ($this->weeeData->getWeeeAttributesForBundle($product) as $weeeAttributes) {
8282
foreach ($weeeAttributes as $weeeAttribute) {
@@ -93,7 +93,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
9393
}
9494
}
9595

96-
if ($this->weeeData->geDisplayExlDescIncl($product->getStoreId())) {
96+
if ($this->weeeData->isDisplayExclDescIncl($product->getStoreId())) {
9797
$options['optionTemplate'] .= sprintf(
9898
' <%% if (data.weeePrice) { %%>'
9999
. '<%%- data.weeePrice.formatted %%>'
@@ -114,9 +114,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
114114
protected function getWhichCalcPriceToUse($storeId = null)
115115
{
116116
$calcPrice = 'finalPrice';
117-
if ($this->weeeData->geDisplayExlDescIncl($storeId)) {
118-
$calcPrice = 'basePrice';
119-
} elseif ($this->weeeData->geDisplayExcl($storeId) && $this->taxData->displayPriceExcludingTax()) {
117+
118+
if ($this->weeeData->isDisplayExclDescIncl($storeId) ||
119+
($this->weeeData->isDisplayExcl($storeId) && $this->taxData->displayPriceExcludingTax())) {
120120
$calcPrice = 'basePrice';
121121
}
122122
return $calcPrice;

app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public function testUpdateProductOptions($initialArray, $weeeEnabled, $weeeDispl
5050
->method('isEnabled')
5151
->will($this->returnValue($weeeEnabled));
5252
$weeeHelper->expects($this->any())
53-
->method('geDisplayIncl')
53+
->method('isDisplayIncl')
5454
->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_INCL));
5555
$weeeHelper->expects($this->any())
56-
->method('geDisplayExlDescIncl')
56+
->method('isDisplayExclDescIncl')
5757
->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL));
5858
$weeeHelper->expects($this->any())
59-
->method('geDisplayExcl')
59+
->method('isDisplayExcl')
6060
->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_EXCL));
6161
$weeeHelper->expects($this->any())
6262
->method('getWeeeAttributesForBundle')

0 commit comments

Comments
 (0)