Version Notes
Sales tracking call was added to the order confirmation page.
Download this release
Release Info
Developer | Magento Core Team |
Extension | IncentiBox_Communityrewards |
Version | 1.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.7
app/code/community/IncentiBox/Communityrewards/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<IncentiBox_Communityrewards>
|
5 |
-
<version>1.0.
|
6 |
</IncentiBox_Communityrewards>
|
7 |
</modules>
|
8 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<IncentiBox_Communityrewards>
|
5 |
+
<version>1.0.7</version>
|
6 |
</IncentiBox_Communityrewards>
|
7 |
</modules>
|
8 |
|
app/design/frontend/base/default/layout/communityrewards.xml
CHANGED
@@ -7,4 +7,10 @@
|
|
7 |
<block type="core/template" name="incentibox.footer.script" as="incentibox_footer_script" template="communityrewards/footer_script.phtml"/>
|
8 |
</reference>
|
9 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
</layout>
|
7 |
<block type="core/template" name="incentibox.footer.script" as="incentibox_footer_script" template="communityrewards/footer_script.phtml"/>
|
8 |
</reference>
|
9 |
</default>
|
10 |
+
|
11 |
+
<checkout_onepage_success>
|
12 |
+
<reference name="content">
|
13 |
+
<block type="checkout/onepage_success" name="incentibox.communityrewards.success.script" template="communityrewards/checkout/success/script.phtml" after="checkout.success" />
|
14 |
+
</reference>
|
15 |
+
</checkout_onepage_success>
|
16 |
</layout>
|
app/design/frontend/base/default/template/communityrewards/checkout/success/script.phtml
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if(Mage::getStoreConfig("communityrewards/communityrewards_settings/active")){ ?>
|
2 |
+
<?php $_programeId = Mage::getStoreConfig("communityrewards/communityrewards_settings/program_id"); ?>
|
3 |
+
<?php if ($this->getOrderId() && $_programeId):
|
4 |
+
$incrementId = $this->getOrderId();
|
5 |
+
$_orderObj = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
|
6 |
+
|
7 |
+
$total = $_orderObj->getbase_grand_total();
|
8 |
+
|
9 |
+
// Look up the customer's order_id and order_total from DB
|
10 |
+
$ORDER_ID = $incrementId;
|
11 |
+
$ORDER_TOTAL = $total;
|
12 |
+
|
13 |
+
$incentibox_order_info = "incentiboxTracker.add_order_info(" . $ORDER_ID . "," . $ORDER_TOTAL . ");";
|
14 |
+
$incentibox_item_string = "";
|
15 |
+
|
16 |
+
// Loop through each item in the customer's order to build incentibox_item_string
|
17 |
+
foreach ($_orderObj->getAllItems() as $_item):
|
18 |
+
$_productId = $_item->getproduct_id();
|
19 |
+
$_productName = $_item->getname();
|
20 |
+
|
21 |
+
// get category
|
22 |
+
// to get category get product id => get product model -> get product category -> get name of the category
|
23 |
+
$product = Mage::getModel('catalog/product')->load($_item->getproduct_id());
|
24 |
+
$productCategories = $product->getCategoryIds();
|
25 |
+
$categoryName = "";
|
26 |
+
if(isset($productCategories[count($productCategories)-1])){
|
27 |
+
$categoryId = $productCategories[count($productCategories)-1];
|
28 |
+
$categoryName = Mage::getModel('catalog/category')->load($categoryId)->getName();
|
29 |
+
}
|
30 |
+
|
31 |
+
$_unitPrice = $_item->getprice();
|
32 |
+
$orderedQty = $_item->getqty_ordered();
|
33 |
+
|
34 |
+
$incentibox_item_string .= "incentiboxTracker.add_item('Product Id [" . addslashes($_productId) . "] Product [" . addslashes($_productName) . "] Category [" . addslashes($categoryName) . "] Unit Price [$" . str_replace(",", "", number_format($_unitPrice, 2)) . "] Quantity [" . $orderedQty . "]'); ";
|
35 |
+
endforeach; ?>
|
36 |
+
<!-- EMBED THIS IN FOOTER OF THE CHECKOUT SUCCESS PAGE -->
|
37 |
+
<script type='text/javascript'>
|
38 |
+
(function() {
|
39 |
+
var iBx = document.createElement('script'); iBx.type = 'text/javascript'; iBx.async = true; iBx.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.incentibox.com/ib_track.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(iBx);
|
40 |
+
})();
|
41 |
+
|
42 |
+
var iBready = function(){
|
43 |
+
incentiboxTracker.set_program_id('<?php echo $_programeId; ?>');
|
44 |
+
// item details can have $ amount, name, product ID, etc. other relevant info
|
45 |
+
<?php echo $incentibox_item_string; ?>
|
46 |
+
// order id, order total
|
47 |
+
<?php echo $incentibox_order_info; ?>
|
48 |
+
incentiboxTracker.send();
|
49 |
+
};
|
50 |
+
</script>
|
51 |
+
<?php
|
52 |
+
endif; ?>
|
53 |
+
<?php } ?>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>IncentiBox_Communityrewards</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</license>
|
7 |
<channel>community</channel>
|
@@ -16,11 +16,11 @@ Coupon codes are auto-generated, and will show up in the admin panel, so you can
|
|
16 |


Example: Give participants a $5 off coupon when they share about your products with their social networks. You gain valuable word-of-mouth advertising for your Magento store, AND generate additional sales when participants and their friends redeem their store credit!


|
17 |

|
18 |
Notes: This extension interfaces with incentiBox, and communicates through the incentiBox API. For more information, and to sign up for incentiBox for API access, please see www.incentibox.com.</description>
|
19 |
-
<notes>
|
20 |
<authors><author><name>incentiBox</name><user>auto-converted</user><email>support@incentibox.com</email></author></authors>
|
21 |
-
<date>2011-
|
22 |
-
<time>
|
23 |
-
<contents><target name="magelib"><dir name="IncentiBox"><file name="incentibox_api.php" hash="06490bf2d59166ab0ad4cec6f33d9398"/></dir></target><target name="magecommunity"><dir name="IncentiBox"><dir name="Communityrewards"><dir name="Block"><dir name="Communityrewards"><file name="Grid.php" hash="d3aed2d0bdcebcc08522f6786547db18"/></dir><file name="Communityrewards.php" hash="f6726f9479326221dbdffd3762f539c0"/></dir><dir name="Helper"><file name="Data.php" hash="13c5e3a3be9ffe04ba7c22c88e4fb4ee"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Listener"><file name="Collection.php" hash="db440e47cbdef4a38e2465233eab31b4"/></dir><file name="Listener.php" hash="7ab66261411770446f6dd3a9ab6ce469"/></dir><file name="Listener.php" hash="ba27fae5d984f3f892fac14c6d644c9d"/></dir><dir name="controllers"><file name="CommunityrewardsController.php" hash="fec1796b16a7d13e0fd8d77e832b9081"/><file name="ListenerController.php" hash="ea26509860f67661f321ffb1983a2b0b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0e809c3d1e05c6cfce33cdf0c6fc1d95"/><file name="config.xml" hash="
|
24 |
<compatible/>
|
25 |
<dependencies/>
|
26 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>IncentiBox_Communityrewards</name>
|
4 |
+
<version>1.0.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</license>
|
7 |
<channel>community</channel>
|
16 |


Example: Give participants a $5 off coupon when they share about your products with their social networks. You gain valuable word-of-mouth advertising for your Magento store, AND generate additional sales when participants and their friends redeem their store credit!


|
17 |

|
18 |
Notes: This extension interfaces with incentiBox, and communicates through the incentiBox API. For more information, and to sign up for incentiBox for API access, please see www.incentibox.com.</description>
|
19 |
+
<notes>Sales tracking call was added to the order confirmation page.</notes>
|
20 |
<authors><author><name>incentiBox</name><user>auto-converted</user><email>support@incentibox.com</email></author></authors>
|
21 |
+
<date>2011-11-22</date>
|
22 |
+
<time>07:27:03</time>
|
23 |
+
<contents><target name="magelib"><dir name="IncentiBox"><file name="incentibox_api.php" hash="06490bf2d59166ab0ad4cec6f33d9398"/></dir></target><target name="magecommunity"><dir name="IncentiBox"><dir name="Communityrewards"><dir name="Block"><dir name="Communityrewards"><file name="Grid.php" hash="d3aed2d0bdcebcc08522f6786547db18"/></dir><file name="Communityrewards.php" hash="f6726f9479326221dbdffd3762f539c0"/></dir><dir name="Helper"><file name="Data.php" hash="13c5e3a3be9ffe04ba7c22c88e4fb4ee"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Listener"><file name="Collection.php" hash="db440e47cbdef4a38e2465233eab31b4"/></dir><file name="Listener.php" hash="7ab66261411770446f6dd3a9ab6ce469"/></dir><file name="Listener.php" hash="ba27fae5d984f3f892fac14c6d644c9d"/></dir><dir name="controllers"><file name="CommunityrewardsController.php" hash="fec1796b16a7d13e0fd8d77e832b9081"/><file name="ListenerController.php" hash="ea26509860f67661f321ffb1983a2b0b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0e809c3d1e05c6cfce33cdf0c6fc1d95"/><file name="config.xml" hash="ea0a7496f4ba50b07f96194fb514a7cc"/><file name="system.xml" hash="b436d1b7d1f98e4b108b474102cdeb80"/></dir><dir name="sql"><dir name="communityrewards_setup"><file name="mysql4-install-1.0.1.php" hash="3ddbd3bcc4ec5ab995a52bcc0b563fe7"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="communityrewards.xml" hash="384dd484ddce3264fb17cfb107c02f9a"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="communityrewards.xml" hash="3580cf8018e496ec48a8a799a92322e1"/></dir><dir name="template"><dir name="communityrewards"><dir name="checkout"><dir name="success"><file name="script.phtml" hash="40010de5b1c63ba4932eed4d4d1ab222"/></dir></dir><file name="footer_script.phtml" hash="4202d828ae1370916ba041c7bf4747f7"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="IncentiBox_Communityrewards.xml" hash="13e38120f4fc14fde6f23c0b95e63ebf"/></dir></target><target name="magelocale"><dir name="en_US"><file name="IncentiBox_Communityrewards.csv" hash="b957c5e9040d798f9ce2a838fce55ee8"/></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies/>
|
26 |
</package>
|