Skip to content

Commit 74e5671

Browse files
committed
review requested changes
1 parent c1d42fc commit 74e5671

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
6464

6565
const XML_PATH_CONVERSION_VALUE = 'google/adwords/conversion_value';
6666

67+
/**
68+
* Google Adwords send order conversion value currency when using dynamic value
69+
*/
6770
const XML_PATH_SEND_CURRENCY = 'google/adwords/send_currency';
6871

6972
/**#@-*/
@@ -277,7 +280,7 @@ public function getConversionValue()
277280
*
278281
* @return boolean
279282
*/
280-
public function hasSendCurrency()
283+
public function hasSendConversionValueCurrency()
281284
{
282285
return $this->scopeConfig->isSetFlag(
283286
self::XML_PATH_SEND_CURRENCY,
@@ -288,11 +291,11 @@ public function hasSendCurrency()
288291
/**
289292
* Get Google AdWords conversion value currency
290293
*
291-
* @return float
294+
* @return string|false
292295
*/
293296
public function getConversionValueCurrency()
294297
{
295-
if ($this->hasSendCurrency()) {
298+
if ($this->hasSendConversionValueCurrency()) {
296299
return (string) $this->_registry->registry(self::CONVERSION_VALUE_CURRENCY_REGISTRY_NAME);
297300
}
298301
return false;

app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
6161

6262
$conversionValue = 0;
6363
$conversionCurrency = false;
64-
$sendOrderCurrency = $this->_helper->hasSendCurrency();
64+
$sendOrderCurrency = $this->_helper->hasSendConversionValueCurrency();
6565
foreach ($this->_collection as $order) {
6666
/** @var $order \Magento\Sales\Api\Data\OrderInterface */
6767
$conversionValue += $sendOrderCurrency ? $order->getGrandTotal() : $order->getBaseGrandTotal();

app/code/Magento/GoogleAdwords/Test/Unit/Helper/DataTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ public function testGetStoreConfigValue($method, $xmlPath, $returnValue)
196196
$this->assertEquals($returnValue, $this->_helper->{$method}());
197197
}
198198

199-
public function testHasSendCurrency()
199+
public function testHasSendConversionValueCurrency()
200200
{
201201
$this->_scopeConfigMock->expects($this->once())->method('isSetFlag')->willReturn(true);
202202

203-
$this->assertTrue($this->_helper->hasSendCurrency());
203+
$this->assertTrue($this->_helper->hasSendConversionValueCurrency());
204204
}
205205

206206
public function testGetConversionValueDynamic()

app/code/Magento/GoogleAdwords/Test/Unit/Observer/SetConversionValueObserverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function testSetConversionValueWhenAdwordsActiveWithOrdersIds()
127127
$conversionCurrency = 'USD';
128128
$this->_helperMock->expects($this->once())->method('isGoogleAdwordsActive')->will($this->returnValue(true));
129129
$this->_helperMock->expects($this->once())->method('isDynamicConversionValue')->will($this->returnValue(true));
130-
$this->_helperMock->expects($this->once())->method('hasSendCurrency')->will($this->returnValue(true));
130+
$this->_helperMock->expects($this->once())->method('hasSendConversionValueCurrency')->will($this->returnValue(true));
131131
$this->_eventMock->expects($this->once())->method('getOrderIds')->will($this->returnValue($ordersIds));
132132
$this->_eventObserverMock->expects(
133133
$this->once()

app/code/Magento/GoogleAdwords/view/frontend/templates/code.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
var google_conversion_color = "<?= /* @escapeNotVerified */ $block->getHelper()->getConversionColor() ?>";
1919
var google_conversion_label = "<?= /* @escapeNotVerified */ $block->getHelper()->getConversionLabel() ?>";
2020
var google_conversion_value = <?= /* @escapeNotVerified */ $block->getHelper()->getConversionValue() ?>;
21-
<?php if($block->getHelper()->hasSendCurrency() && $block->getHelper()->getConversionValueCurrency()): ?>
21+
<?php if($block->getHelper()->hasSendConversionValueCurrency() && $block->getHelper()->getConversionValueCurrency()): ?>
2222
var google_conversion_currency = "<?= /* @escapeNotVerified */ $block->getHelper()->getConversionValueCurrency() ?>";
2323
<?php endif; ?>
2424
/* ]]> */

0 commit comments

Comments
 (0)