Skip to content

Commit c1d42fc

Browse files
committed
#10558: Option to send currency in Google Adwords when using dynamic value
- Fixes per failed tests
1 parent 99fd6aa commit c1d42fc

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ public function execute(\Magento\Framework\Event\Observer $observer)
6161

6262
$conversionValue = 0;
6363
$conversionCurrency = false;
64-
$orderHasSendCurrency = $this->_helper->hasSendCurrency();
64+
$sendOrderCurrency = $this->_helper->hasSendCurrency();
6565
foreach ($this->_collection as $order) {
66-
/** @var $order \Magento\Sales\Model\Order */
67-
$conversionValue += $orderHasSendCurrency ? $order->getGrandTotal() : $order->getBaseGrandTotal();
68-
$conversionCurrency = $orderHasSendCurrency ? $order->getOrderCurrencyCode() : false;
66+
/** @var $order \Magento\Sales\Api\Data\OrderInterface */
67+
$conversionValue += $sendOrderCurrency ? $order->getGrandTotal() : $order->getBaseGrandTotal();
68+
$conversionCurrency = $sendOrderCurrency ? $order->getOrderCurrencyCode() : false;
6969
}
7070
$this->_registry->register(
7171
\Magento\GoogleAdwords\Helper\Data::CONVERSION_VALUE_CURRENCY_REGISTRY_NAME,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ public function testGetConversionValueDynamic()
225225
$this->returnValue($returnValue)
226226
);
227227

228-
229228
$this->assertEquals($returnValue, $this->_helper->getConversionValue());
230229
}
231230

0 commit comments

Comments
 (0)