Version Notes
Changes 1.0.1 -> 1.0.2
* (CHANGE) Improved string handling for javascript (line breaks will now be removed)
* (CHANGE) Error handling if order or address not found
* (CHANGE) Snoobi code for orders now at the bottom of the page - should make it easier to use with old templates (after_body_start -> before_body_end)
Download this release
Release Info
Developer | Magento Core Team |
Extension | Eepohs_Snoobi |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- Eepohs_Snoobi/English Magento Snoobi E-commerce Analytics.pdf +0 -0
- Eepohs_Snoobi/Svenska Magento Snoobi E-commerce Analytics.pdf +0 -0
- app/code/community/Eepohs/Snoobi/Block/Order.php +34 -17
- app/code/community/Eepohs/Snoobi/etc/config.xml +1 -1
- app/design/frontend/default/default/layout/snoobi.xml +2 -2
- package.xml +9 -6
- skin/adminhtml/default/default/images/snoobi/snoobi_logo.gif +0 -0
Eepohs_Snoobi/English Magento Snoobi E-commerce Analytics.pdf
DELETED
Binary file
|
Eepohs_Snoobi/Svenska Magento Snoobi E-commerce Analytics.pdf
DELETED
Binary file
|
app/code/community/Eepohs/Snoobi/Block/Order.php
CHANGED
@@ -11,9 +11,19 @@ class Eepohs_Snoobi_Block_Order extends Mage_Core_Block_Text
|
|
11 |
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
12 |
if ($orderId) {
|
13 |
$order = Mage::getModel('sales/order')->load($orderId);
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
} else {
|
16 |
-
Mage::log('No
|
|
|
17 |
return parent::_toHtml();
|
18 |
}
|
19 |
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
@@ -33,23 +43,30 @@ class Eepohs_Snoobi_Block_Order extends Mage_Core_Block_Text
|
|
33 |
var snoobiTrans = new SnoobiTrans();
|
34 |
var snoobiOrder = snoobiTrans.order("' . $order->getIncrementId() . '");
|
35 |
snoobiOrder.total = "' . $order->getBaseGrandTotal() . '";
|
36 |
-
snoobiOrder.currency =
|
37 |
snoobiOrder.discount = "' . $order->getDiscountAmount() . '";
|
38 |
snoobiOrder.discountPct = "' . $discountPct . '";
|
39 |
snoobiOrder.tax = "' . $order->getBaseTaxAmount() . '";
|
40 |
-
snoobiOrder.
|
41 |
-
snoobiOrder.
|
42 |
-
snoobiOrder.address = "' . $this->jsQuoteEscape($address->getStreetFull(), '"') . '";
|
43 |
-
snoobiOrder.area = "' . $this->jsQuoteEscape($address->getRegion(), '"') . '";
|
44 |
-
snoobiOrder.zip = "' . $address->getPostcode() . '";
|
45 |
-
snoobiOrder.customername = "' . $this->jsQuoteEscape($customerName, '"') . '";
|
46 |
-
snoobiOrder.customeremail ="' . $this->jsQuoteEscape($customerEmail, '"') . '";
|
47 |
snoobiOrder.customerid = "' . $customerId . '";
|
48 |
snoobiOrder.shippingcost = "' . $order->getBaseShippingAmount() . '";
|
49 |
-
snoobiOrder.payment_method =
|
50 |
-
snoobiOrder.shipping_method =
|
51 |
-
snoobiOrder.coupons =
|
52 |
');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
foreach ($order->getAllItems() as $item) {
|
55 |
if ($item->getParentItemId()) {
|
@@ -70,19 +87,19 @@ class Eepohs_Snoobi_Block_Order extends Mage_Core_Block_Text
|
|
70 |
}
|
71 |
$this->addText('
|
72 |
var snoobiItem = snoobiOrder.item("' . $this->jsQuoteEscape($item->getSku(), '"') . '");
|
73 |
-
snoobiItem.name =
|
74 |
snoobiItem.price = "' . $item->getBasePrice() . '";
|
75 |
-
snoobiItem.currency =
|
76 |
snoobiItem.amount = "' . $item->getQtyOrdered() . '";
|
77 |
snoobiItem.discount = "' . $item->getDiscountAmount() . '";
|
78 |
snoobiItem.discountPct = "' . $item->getDiscountPercent() . '";
|
79 |
-
snoobiItem.categoryName =
|
80 |
snoobiItem.categoryId = "' . $categoryId . '";
|
81 |
');
|
82 |
|
83 |
if (count($categoryAllNames) > 1) {
|
84 |
$this->addText('
|
85 |
-
snoobiItem.categoryAllNames =
|
86 |
snoobiItem.categoryAllIds = "' . implode(":",$categoryAllIds) . '";
|
87 |
');
|
88 |
}
|
11 |
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
12 |
if ($orderId) {
|
13 |
$order = Mage::getModel('sales/order')->load($orderId);
|
14 |
+
if ($order) {
|
15 |
+
$address = $order->getShippingAddress();
|
16 |
+
if (!$address) {
|
17 |
+
$address = $order->getBillingAddress();
|
18 |
+
}
|
19 |
+
} else {
|
20 |
+
Mage::log('Eepohs_Snoobi: Could not load order!');
|
21 |
+
$this->addText('<!-- Eepohs_Snoobi: Could not load order -->');
|
22 |
+
return parent::_toHtml();
|
23 |
+
}
|
24 |
} else {
|
25 |
+
Mage::log('Eepohs_Snoobi: No order ID!');
|
26 |
+
$this->addText('<!-- Eepohs_Snoobi: No order ID -->');
|
27 |
return parent::_toHtml();
|
28 |
}
|
29 |
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
43 |
var snoobiTrans = new SnoobiTrans();
|
44 |
var snoobiOrder = snoobiTrans.order("' . $order->getIncrementId() . '");
|
45 |
snoobiOrder.total = "' . $order->getBaseGrandTotal() . '";
|
46 |
+
snoobiOrder.currency =' . json_encode($order->getOrderCurrencyCode()) . ';
|
47 |
snoobiOrder.discount = "' . $order->getDiscountAmount() . '";
|
48 |
snoobiOrder.discountPct = "' . $discountPct . '";
|
49 |
snoobiOrder.tax = "' . $order->getBaseTaxAmount() . '";
|
50 |
+
snoobiOrder.customername = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $this->jsQuoteEscape($customerName, '"'))) . ';
|
51 |
+
snoobiOrder.customeremail =' . json_encode($this->jsQuoteEscape($customerEmail, '"')) . ';
|
|
|
|
|
|
|
|
|
|
|
52 |
snoobiOrder.customerid = "' . $customerId . '";
|
53 |
snoobiOrder.shippingcost = "' . $order->getBaseShippingAmount() . '";
|
54 |
+
snoobiOrder.payment_method = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $order->getPayment()->getMethod())) . ';
|
55 |
+
snoobiOrder.shipping_method = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $order->getShippingMethod())) . ';
|
56 |
+
snoobiOrder.coupons = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $order->getCouponCode())) . ';
|
57 |
');
|
58 |
+
if ($address) {
|
59 |
+
$this->addText('
|
60 |
+
snoobiOrder.address = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $this->jsQuoteEscape($address->getStreetFull(), '"'))) . ';
|
61 |
+
snoobiOrder.city = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $this->jsQuoteEscape($address->getCity(), '"'))) . ';
|
62 |
+
snoobiOrder.area = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $this->jsQuoteEscape($address->getRegion(), '"'))) . ';
|
63 |
+
snoobiOrder.zip = ' . json_encode($address->getPostcode()) . ';
|
64 |
+
snoobiOrder.country = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $this->jsQuoteEscape($address->getCountry(), '"'))) . ';
|
65 |
+
');
|
66 |
+
} else {
|
67 |
+
$this->addText('
|
68 |
+
<!-- Eepohs_Snoobi: Could not get address -->');
|
69 |
+
}
|
70 |
|
71 |
foreach ($order->getAllItems() as $item) {
|
72 |
if ($item->getParentItemId()) {
|
87 |
}
|
88 |
$this->addText('
|
89 |
var snoobiItem = snoobiOrder.item("' . $this->jsQuoteEscape($item->getSku(), '"') . '");
|
90 |
+
snoobiItem.name = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $this->jsQuoteEscape($item->getName(), '"'))) . ';
|
91 |
snoobiItem.price = "' . $item->getBasePrice() . '";
|
92 |
+
snoobiItem.currency = ' . json_encode($order->getOrderCurrencyCode()) . ';
|
93 |
snoobiItem.amount = "' . $item->getQtyOrdered() . '";
|
94 |
snoobiItem.discount = "' . $item->getDiscountAmount() . '";
|
95 |
snoobiItem.discountPct = "' . $item->getDiscountPercent() . '";
|
96 |
+
snoobiItem.categoryName = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", $categoryName)) . ';
|
97 |
snoobiItem.categoryId = "' . $categoryId . '";
|
98 |
');
|
99 |
|
100 |
if (count($categoryAllNames) > 1) {
|
101 |
$this->addText('
|
102 |
+
snoobiItem.categoryAllNames = ' . json_encode(ereg_replace("(\r\n|\n|\r)", " ", implode(":",$categoryAllNames))) . ';
|
103 |
snoobiItem.categoryAllIds = "' . implode(":",$categoryAllIds) . '";
|
104 |
');
|
105 |
}
|
app/code/community/Eepohs/Snoobi/etc/config.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<config>
|
2 |
<modules>
|
3 |
<Eepohs_Snoobi>
|
4 |
-
<version>1.0.
|
5 |
</Eepohs_Snoobi>
|
6 |
</modules>
|
7 |
|
1 |
<config>
|
2 |
<modules>
|
3 |
<Eepohs_Snoobi>
|
4 |
+
<version>1.0.2</version>
|
5 |
</Eepohs_Snoobi>
|
6 |
</modules>
|
7 |
|
app/design/frontend/default/default/layout/snoobi.xml
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
<reference name="head">
|
9 |
<block type="page/html_head" name="snoobi_js" as="snoobi_js" template="snoobi/js.phtml" />
|
10 |
</reference>
|
11 |
-
<reference name="
|
12 |
<block type="snoobi/order" name="snoobi_order" as="snoobi_order" />
|
13 |
</reference>
|
14 |
</checkout_onepage_success>
|
@@ -16,7 +16,7 @@
|
|
16 |
<reference name="head">
|
17 |
<block type="page/html_head" name="snoobi_js" as="snoobi_js" template="snoobi/js.phtml" />
|
18 |
</reference>
|
19 |
-
<reference name="
|
20 |
<block type="snoobi/order" name="snoobi_order" as="snoobi_order" />
|
21 |
</reference>
|
22 |
</checkout_multishipping_success>
|
8 |
<reference name="head">
|
9 |
<block type="page/html_head" name="snoobi_js" as="snoobi_js" template="snoobi/js.phtml" />
|
10 |
</reference>
|
11 |
+
<reference name="before_body_end">
|
12 |
<block type="snoobi/order" name="snoobi_order" as="snoobi_order" />
|
13 |
</reference>
|
14 |
</checkout_onepage_success>
|
16 |
<reference name="head">
|
17 |
<block type="page/html_head" name="snoobi_js" as="snoobi_js" template="snoobi/js.phtml" />
|
18 |
</reference>
|
19 |
+
<reference name="before_body_end">
|
20 |
<block type="snoobi/order" name="snoobi_order" as="snoobi_order" />
|
21 |
</reference>
|
22 |
</checkout_multishipping_success>
|
package.xml
CHANGED
@@ -1,18 +1,21 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Eepohs_Snoobi</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Snoobi’s e-Commerce Analytics module is a Magento extension that seamlessly integrates Snoobi’s paid analytics service with web stores.</summary>
|
10 |
<description>Snoobi’s e-Commerce Analytics module is a free of charge Magento extension that seamlessly integrates Snoobi’s paid analytics service with web stores, requiring no technical knowledge and very little experience with either Magento or Snoobi’s service. Its features include page tracking, shopping cart tracking, product tracking, coupon tracking and the analysis of visitors to increase sales.</description>
|
11 |
-
<notes>
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
<
|
|
|
|
|
|
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Eepohs_Snoobi</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Snoobi’s e-Commerce Analytics module is a Magento extension that seamlessly integrates Snoobi’s paid analytics service with web stores.</summary>
|
10 |
<description>Snoobi’s e-Commerce Analytics module is a free of charge Magento extension that seamlessly integrates Snoobi’s paid analytics service with web stores, requiring no technical knowledge and very little experience with either Magento or Snoobi’s service. Its features include page tracking, shopping cart tracking, product tracking, coupon tracking and the analysis of visitors to increase sales.</description>
|
11 |
+
<notes>Changes 1.0.1 -> 1.0.2
|
12 |
+
* (CHANGE) Improved string handling for javascript (line breaks will now be removed)
|
13 |
+
* (CHANGE) Error handling if order or address not found
|
14 |
+
* (CHANGE) Snoobi code for orders now at the bottom of the page - should make it easier to use with old templates (after_body_start -> before_body_end)</notes>
|
15 |
+
<authors><author><name>Eepohs Consulting</name><user>auto-converted</user><email>all@eepohs.com</email></author><author><name>Marie Fischer</name><user>auto-converted</user><email>marie@eepohs.com</email></author><author><name>Tanel Raja</name><user>auto-converted</user><email>tanel.raja@eepohs.com</email></author></authors>
|
16 |
+
<date>2011-05-18</date>
|
17 |
+
<time>12:45:18</time>
|
18 |
+
<contents><target name="magecommunity"><dir name="Eepohs"><dir name="Snoobi"><dir name="Block"><file name="Info.php" hash="9e647cd9ceaa0f7ced9ab1d9b421b15a"/><file name="Order.php" hash="4611fa9ffa930edbe491afc1055096db"/><file name="Tag.php" hash="3416a0cf8b11abbf9d146f98c51eb15e"/></dir><dir name="Helper"><file name="Data.php" hash="a8591bdd702e3cba5f39265283683816"/></dir><dir name="controllers"><file name="IndexController.php" hash="ba39d8b3656cb43c0099ed52933b1ad2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5a2c761b911570a3fc805b5330984532"/><file name="config.xml" hash="e7b793d46fcffc87b66c045cbd531c9f"/><file name="system.xml" hash="84322aeaf253d48a602560ada8d1d09e"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="snoobi.xml" hash="a19c719fbf9c89dd00715d45831e92dd"/></dir><dir name="template"><dir name="snoobi"><file name="js.phtml" hash="a87dacb2466c18d48c48914bd82909ac"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eepohs_Snoobi.xml" hash="eb97d10b18ca825860bc5bd134d42ee9"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Eepohs_Snoobi.csv" hash="631f85d7faa14f9dd8fe5d45539fa3f9"/></dir><dir name="et_EE"><file name="Eepohs_Snoobi.csv" hash="72883c0f49b59e40739eaf553a89466f"/></dir><dir name="nl_NL"><file name="Eepohs_Snoobi.csv" hash="f1d0f9161b9eba33c38f15d9d6b16f0d"/></dir><dir name="sv_SE"><file name="Eepohs_Snoobi.csv" hash="06592e7a451344f09c01f8017138e654"/></dir><dir name="fi_FI"><file name="Eepohs_Snoobi.csv" hash="e64cdeb2e368cb2ab1fe276880deed30"/></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies/>
|
21 |
</package>
|
skin/adminhtml/default/default/images/snoobi/snoobi_logo.gif
DELETED
Binary file
|