Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
srenon committed Oct 8, 2017
1 parent d466263 commit 711a11a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function getAccountId() {
* @return float
*/
public function formatPrice($price){
return sprintf('%.2F', $price);
return (float)sprintf('%.2F', $price);
}


Expand Down
6 changes: 3 additions & 3 deletions Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public function getOrderLayer()
'event' => 'gtm.orderComplete',
'transactionId' => is_numeric($order->getIncrementId()) ? (int)$order->getIncrementId() : $order->getIncrementId(),
'transactionAffiliation' => $this->escapeJsQuote($this->_storeManager->getStore()->getFrontendName()),
'transactionTotal' => (float)$this->gtmHelper->formatPrice($order->getBaseGrandTotal()),
'transactionTotal' => $this->gtmHelper->formatPrice($order->getBaseGrandTotal()),
'transactionSubTotal' => $this->gtmHelper->formatPrice($order->getBaseSubtotal()),
'transactionShipping' => (float)$this->gtmHelper->formatPrice($order->getBaseShippingAmount()),
'transactionTax' => (float)$this->gtmHelper->formatPrice($order->getTaxAmount()),
'transactionShipping' => $this->gtmHelper->formatPrice($order->getBaseShippingAmount()),
'transactionTax' => $this->gtmHelper->formatPrice($order->getTaxAmount()),
'transactionCouponCode' => $order->getCouponCode(),
'transactionDiscount' => $this->gtmHelper->formatPrice($order->getDiscountAmount()),
'transactionProducts' => $products
Expand Down

0 comments on commit 711a11a

Please sign in to comment.