Skip to content

Commit

Permalink
Dev v2.1.0 (#16)
Browse files Browse the repository at this point in the history
* Update for confirm order tracking pixel to track data for enhanced analytics

* version update
  • Loading branch information
nandadubey authored Aug 17, 2018
1 parent 7774c34 commit ecbeb90
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions Block/Promotion/Pixel/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ public function getOrdersTrackingCode()
}

$result[] = sprintf("affirm.analytics.trackOrderConfirmed({
'affiliation': '%s',
'storeName': '%s',
'orderId': '%s',
'currency': '%s',
'total': '%s',
'tax': '%s',
'shipping': '%s',
'paymentMethod': '%s'
});",
},[",
$this->escapeJsQuote($this->_storeManager->getStore()->getFrontendName()),
$order->getIncrementId(),
$order->getOrderCurrencyCode(),
Expand All @@ -117,6 +117,20 @@ public function getOrdersTrackingCode()
Util::formatToCents($order->getBaseShippingAmount()),
$order->getPayment()->getMethod()
);
foreach ($order->getAllVisibleItems() as $item) {
$result[] = sprintf("{
'productId': '%s',
'name': '%s',
'price': '%s',
'quantity': '%s'
},",
$this->escapeJsQuote($item->getSku()),
$this->escapeJsQuote($item->getName()),
Util::formatToCents($item->getBasePrice()),
$item->getQtyOrdered()
);
}
$result[] = sprintf("]);");
}
return implode("\n", $result);
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "affirm/magento2",
"description": "Affirm's extension for the Magento 2 https://www.affirm.com/",
"type": "magento2-module",
"version": "2.0.9",
"version": "2.1.0",
"license": [
"BSD-3-Clause"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Astound_Affirm" setup_version="2.0.9">
<module name="Astound_Affirm" setup_version="2.1.0">
<sequence>
<module name="Magento_Checkout"/>
<module name="Magento_Sales"/>
Expand Down

0 comments on commit ecbeb90

Please sign in to comment.