Version Notes
- Display Reward Points in
* Product page
* Checkout page
* Order Success Page
- Configure
* points multiple for dollars purchased
* location of Rewards Tab on site pages
- Earn Reward Points at www.punchtab.com (reported when order completes successfully)
Download this release
Release Info
Developer | Magento Core Team |
Extension | punchtabpoints |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/PunchTab/Points/Block/Multishipping/Points.php +40 -0
- app/code/community/PunchTab/Points/Block/Points.php +57 -0
- app/code/community/PunchTab/Points/Helper/Data.php +64 -0
- app/code/community/PunchTab/Points/Model/Backend/Source/Position.php +15 -0
- app/code/community/PunchTab/Points/Model/Observer.php +117 -0
- app/code/community/PunchTab/Points/etc/config.xml +88 -0
- app/code/community/PunchTab/Points/etc/system.xml +62 -0
- app/design/frontend/base/default/layout/points.xml +46 -0
- app/design/frontend/base/default/template/points/multishipping/points.phtml +3 -0
- app/design/frontend/base/default/template/points/points.phtml +3 -0
- app/design/frontend/default/default/template/points/multishipping/points.phtml +3 -0
- app/design/frontend/default/default/template/points/points.phtml +3 -0
- app/etc/modules/PunchTab_Points.xml +16 -0
- package.xml +27 -0
app/code/community/PunchTab/Points/Block/Multishipping/Points.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PunchTab_Points_Block_Multishipping_Points extends Mage_Checkout_Block_Multishipping_Success
|
4 |
+
{
|
5 |
+
|
6 |
+
public function _construct()
|
7 |
+
{
|
8 |
+
parent::_construct();
|
9 |
+
$this->setTemplate('points/multishipping/points.phtml');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function getMessage()
|
13 |
+
{
|
14 |
+
$price = 0;
|
15 |
+
$app = Mage::app('default');
|
16 |
+
$core_session = Mage::getSingleton('core/session');
|
17 |
+
$visitor_data = $core_session->getVisitorData();
|
18 |
+
$uri = $visitor_data['request_uri'];
|
19 |
+
//Mage::Log($uri);
|
20 |
+
if(strpos($uri,'multishipping/overviewPost'))
|
21 |
+
{
|
22 |
+
$oids = Mage::getSingleton('core/session')->getOrderIds();
|
23 |
+
//Mage::Log("count oids ".count($oids));
|
24 |
+
if($oids && is_array($oids))
|
25 |
+
{
|
26 |
+
foreach($oids as $key => $value)
|
27 |
+
{
|
28 |
+
//Mage::Log($key);
|
29 |
+
//Mage::Log($value);
|
30 |
+
$order = Mage::getModel('sales/order');
|
31 |
+
$order->loadByIncrementId($value);
|
32 |
+
$price += $order->getSubtotal();
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
$points = floor($price*Mage::getStoreConfig('points/settings/multiple'));
|
37 |
+
return $points.' points';
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
app/code/community/PunchTab/Points/Block/Points.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PunchTab_Points_Block_Points extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
|
6 |
+
public function _construct()
|
7 |
+
{
|
8 |
+
parent::_construct();
|
9 |
+
$this->setTemplate('points/points.phtml');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function getMessage()
|
13 |
+
{
|
14 |
+
$price = 0;
|
15 |
+
$core_session = Mage::getSingleton('core/session');
|
16 |
+
$visitor_data = $core_session->getVisitorData();
|
17 |
+
$uri = $visitor_data['request_uri'];
|
18 |
+
|
19 |
+
if(strpos($uri,'checkout'))
|
20 |
+
{
|
21 |
+
$checkout_session = Mage::getSingleton('checkout/session');
|
22 |
+
if($checkout_session)
|
23 |
+
{
|
24 |
+
$sales_quote = $checkout_session->getQuote();
|
25 |
+
if($sales_quote)
|
26 |
+
$price = $sales_quote->getSubtotal();
|
27 |
+
//Mage::Log($uri);
|
28 |
+
if(strpos($uri,'onepage/saveOrder'))
|
29 |
+
{
|
30 |
+
$order_id = $checkout_session->getLastOrderId();
|
31 |
+
//Mage::Log("Last Order ID: ".$order_id);
|
32 |
+
$order = Mage::getModel('sales/order');
|
33 |
+
$order->load($order_id);
|
34 |
+
$price = $order->getSubtotal();
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
else
|
39 |
+
{
|
40 |
+
$catalog_session = Mage::getSingleton('catalog/session');
|
41 |
+
if($catalog_session)
|
42 |
+
{
|
43 |
+
$product_id = $catalog_session->getLastViewedProductId();
|
44 |
+
if($product_id)
|
45 |
+
{
|
46 |
+
$product = Mage::getModel('catalog/product')->load($product_id);
|
47 |
+
$price = $product->getPrice();
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
$points = floor($price*Mage::getStoreConfig('points/settings/multiple'));
|
52 |
+
//Mage::Log("Points ".$points);
|
53 |
+
return $points.' points';
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
}
|
app/code/community/PunchTab/Points/Helper/Data.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PunchTab_Points_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
public function getHeaderScript()
|
7 |
+
{
|
8 |
+
$scrpt = '';
|
9 |
+
return $scrpt;
|
10 |
+
}
|
11 |
+
|
12 |
+
public function getRewardsTabScript()
|
13 |
+
{
|
14 |
+
$key = Mage::getStoreConfig('points/settings/key');
|
15 |
+
Mage::Log("Key Length: ".strlen($key)." Key: ".$key);
|
16 |
+
if(strlen($key)==0)
|
17 |
+
{
|
18 |
+
return '';
|
19 |
+
}
|
20 |
+
|
21 |
+
$pthost = Mage::getStoreConfig('points/settings/pthost');
|
22 |
+
Mage::Log("PT HOST: ".$pthost);
|
23 |
+
if(strlen($pthost)==0)
|
24 |
+
{
|
25 |
+
$pthost = "www.punchtab.com";
|
26 |
+
Mage::getModel('core/config')->saveConfig('points/settings/pthost',$pthost);
|
27 |
+
}
|
28 |
+
$scrpt = '<script type="text/javascript" charset="utf-8">';
|
29 |
+
$scrpt .= 'var is_ssl = ("https:" == document.location.protocol);';
|
30 |
+
$scrpt .= 'var asset_host = is_ssl ? "https://';
|
31 |
+
$scrpt .= $pthost;
|
32 |
+
$scrpt .= '/static/" : "http://';
|
33 |
+
$scrpt .= $pthost;
|
34 |
+
$scrpt .= '/static/";';
|
35 |
+
$scrpt .= 'document.write(unescape("%3Cscript src=\'" + asset_host + "js/pt.js\' type=\'text/javascript\'%3E%3C/script%3E"));';
|
36 |
+
$scrpt .= 'document.write(unescape("%3Cscript src=\'" + asset_host + "js/pt_magento.js\' type=\'text/javascript\'%3E%3C/script%3E"));';
|
37 |
+
$scrpt .= '</script>';
|
38 |
+
|
39 |
+
$scrpt .= '<script type="text/javascript" charset="utf-8">';
|
40 |
+
$scrpt .= 'var _ptq = _ptq || [];';
|
41 |
+
$scrpt .= 'var reward_widget_options = {};';
|
42 |
+
$scrpt .= 'reward_widget_options.key = "';
|
43 |
+
$scrpt .= $key;
|
44 |
+
$scrpt .= '";';
|
45 |
+
$scrpt .= 'reward_widget_options.display = "tab";';
|
46 |
+
switch(Mage::getStoreConfig('points/settings/position'))
|
47 |
+
{
|
48 |
+
case 'top-left': $scrpt .= 'reward_widget_options.position = {x:"left",y:"top"};';break;
|
49 |
+
case 'top-right': $scrpt .= 'reward_widget_options.position = {x:"right",y:"top"};';break;
|
50 |
+
case 'bottom-left': $scrpt .= 'reward_widget_options.position = {x:"left",y:"bottom"};';break;
|
51 |
+
case 'bottom-right': $scrpt .= 'reward_widget_options.position = {x:"right",y:"bottom"};';break;
|
52 |
+
default: $scrpt .= 'reward_widget_options.position = {x:"right",y:"bottom"};';break;
|
53 |
+
}
|
54 |
+
$scrpt .= 'var reward_widget = new PT.reward_widget(reward_widget_options);';
|
55 |
+
$scrpt .= 'window.ptAsyncInit = function() {';
|
56 |
+
$scrpt .= ' if(typeof pt_magento !== "undefined")';
|
57 |
+
$scrpt .= ' pt_magento.check_and_show_login_button();';
|
58 |
+
$scrpt .= '}';
|
59 |
+
$scrpt .= '</script>';
|
60 |
+
|
61 |
+
return $scrpt;
|
62 |
+
}
|
63 |
+
|
64 |
+
}
|
app/code/community/PunchTab/Points/Model/Backend/Source/Position.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PunchTab_Points_Model_Backend_Source_Position
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array('value' => 'top-left', 'label'=> Mage::helper('points')->__('Top Left')),
|
9 |
+
array('value' => 'top-right', 'label'=> Mage::helper('points')->__('Top Right')),
|
10 |
+
array('value' => 'bottom-left', 'label'=> Mage::helper('points')->__('Bottom Left')),
|
11 |
+
array('value' => 'bottom-right', 'label'=> Mage::helper('points')->__('Bottom Right')),
|
12 |
+
);
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
app/code/community/PunchTab/Points/Model/Observer.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PunchTab_Points_Model_Observer
|
4 |
+
{
|
5 |
+
|
6 |
+
public function coreBlockAbstractToHtmlAfter($observer)
|
7 |
+
{
|
8 |
+
$transport = $observer->getEvent()->getTransport();
|
9 |
+
$block = $observer->getEvent()->getBlock();
|
10 |
+
|
11 |
+
//Mage::Log("Name in Layout ".$block->getNameInLayout());
|
12 |
+
if($block->getNameInLayout() == 'head') {
|
13 |
+
$layout = Mage::app()->getLayout();
|
14 |
+
$html = $transport->getHtml()."\n".Mage::helper('points')->getHeaderScript();
|
15 |
+
$transport->setHtml($html);
|
16 |
+
}
|
17 |
+
if($block->getNameInLayout() == 'before_body_end')
|
18 |
+
{
|
19 |
+
$html = $transport->getHtml()."\n".Mage::helper('points')->getRewardsTabScript();
|
20 |
+
$transport->setHtml($html);
|
21 |
+
}
|
22 |
+
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function checkoutOnepageControllerSuccessAction($observer)
|
27 |
+
{
|
28 |
+
|
29 |
+
$orders = $observer->getEvent()->getOrderIds();
|
30 |
+
//Mage::Log("Count: ".count($orders));
|
31 |
+
//Mage::Log("order ".$orders['0']);
|
32 |
+
$order_id = $orders['0'];
|
33 |
+
|
34 |
+
$this->postPointsToPunchTab($order_id);
|
35 |
+
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function checkoutMultishippingControllerSuccessAction($observer)
|
40 |
+
{
|
41 |
+
$orders = $observer->getEvent()->getOrderIds();
|
42 |
+
//Mage::Log("Count: ".count($orders));
|
43 |
+
foreach($orders as $oid => $order_id)
|
44 |
+
{
|
45 |
+
//Mage::Log("order ".$order_id);
|
46 |
+
$this->postPointsToPunchTab($order_id);
|
47 |
+
}
|
48 |
+
return $this;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function postPointsToPunchTab($order_id)
|
52 |
+
{
|
53 |
+
$app = Mage::app('default');
|
54 |
+
|
55 |
+
$session = Mage::getSingleton('customer/session',array('name'=>'frontend'));
|
56 |
+
if($session->isLoggedIn())
|
57 |
+
{
|
58 |
+
//Mage::Log("User logged in");
|
59 |
+
$customer = $session->getCustomer();
|
60 |
+
//Mage::Log("Customer Info: ".$customer->getEmail()." ".$customer->getFirstname()." ".$customer->getLastname());
|
61 |
+
}
|
62 |
+
|
63 |
+
$cookie = Mage::getSingleton('core/cookie');
|
64 |
+
$token = $cookie->get('ptfbst');
|
65 |
+
|
66 |
+
$core_session = Mage::getSingleton('core/session');
|
67 |
+
$visitor_data = $core_session->getVisitorData();
|
68 |
+
|
69 |
+
$price = 0;
|
70 |
+
$order = Mage::getModel('sales/order');
|
71 |
+
$order->load($order_id);
|
72 |
+
//Mage::Log($order->getData());
|
73 |
+
//Mage::Log("Subtotal: ".$order->getSubtotal());
|
74 |
+
$points = floor($order->getSubtotal()*Mage::getStoreConfig('points/settings/multiple'));
|
75 |
+
$http_host = $visitor_data['http_host'];
|
76 |
+
$http_referer = $visitor_data['http_referer'];
|
77 |
+
$remote_addr = long2ip($visitor_data['remote_addr']);
|
78 |
+
|
79 |
+
$host = "http://".Mage::getStoreConfig('points/settings/pthost');
|
80 |
+
$url_path = "/api/v1/activity/purchase/magento";
|
81 |
+
$query_parameters = "?method=POST";
|
82 |
+
$query_parameters .= "&key=".Mage::getStoreConfig('points/settings/key');
|
83 |
+
$query_parameters .= "&token=".$token;
|
84 |
+
$query_parameters .= "&installation=magento";
|
85 |
+
$url = $host.$url_path.$query_parameters;
|
86 |
+
//Mage::Log("URL ".$url);
|
87 |
+
|
88 |
+
//$post_data = '{';
|
89 |
+
//$post_data .= '"order_id":"'.$order->getIncrementId().'",';
|
90 |
+
//$post_data .= '"browser_ip":"'.$remote_addr.'",';
|
91 |
+
//$post_data .= '"points":"'.$points.'",';
|
92 |
+
//$post_data .= '"referer":"'.$http_referer.'"';
|
93 |
+
//$post_data .= '}';
|
94 |
+
$post_data = "order_id=".$order->getIncrementId()."&";
|
95 |
+
$post_data .= "browser_ip=".$remote_addr."&";
|
96 |
+
$post_data .= "points=".$points."&";
|
97 |
+
$post_data .= "referer=".$http_referer;
|
98 |
+
Mage::Log("post data ".$post_data);
|
99 |
+
|
100 |
+
$pt_site = curl_init();
|
101 |
+
curl_setopt($pt_site, CURLOPT_URL,$url);
|
102 |
+
curl_setopt($pt_site, CURLOPT_FAILONERROR, 1);
|
103 |
+
curl_setopt($pt_site, CURLOPT_FOLLOWLOCATION, 1);
|
104 |
+
curl_setopt($pt_site, CURLOPT_RETURNTRANSFER,1);
|
105 |
+
curl_setopt($pt_site, CURLOPT_TIMEOUT, 30);
|
106 |
+
curl_setopt($pt_site, CURLOPT_REFERER,$http_referer);
|
107 |
+
curl_setopt($pt_site, CURLOPT_POST, 1);
|
108 |
+
curl_setopt($pt_site, CURLOPT_POSTFIELDS,$post_data);
|
109 |
+
$result = curl_exec($pt_site);
|
110 |
+
//Mage::Log($result);
|
111 |
+
//Mage::Log(curl_getinfo($pt_site));
|
112 |
+
curl_close($pt_site);
|
113 |
+
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
117 |
+
|
app/code/community/PunchTab/Points/etc/config.xml
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<PunchTab_Points>
|
6 |
+
<version>0.0.2</version>
|
7 |
+
</PunchTab_Points>
|
8 |
+
</modules>
|
9 |
+
|
10 |
+
<global>
|
11 |
+
<blocks>
|
12 |
+
<points>
|
13 |
+
<class>PunchTab_Points_Block</class>
|
14 |
+
</points>
|
15 |
+
</blocks>
|
16 |
+
<helpers>
|
17 |
+
<points>
|
18 |
+
<class>PunchTab_Points_Helper</class>
|
19 |
+
</points>
|
20 |
+
</helpers>
|
21 |
+
<models>
|
22 |
+
<points>
|
23 |
+
<class>PunchTab_Points_Model</class>
|
24 |
+
</points>
|
25 |
+
</models>
|
26 |
+
<events>
|
27 |
+
<core_block_abstract_to_html_after>
|
28 |
+
<observers>
|
29 |
+
<points_observer>
|
30 |
+
<type>singleton</type>
|
31 |
+
<class>PunchTab_Points_Model_Observer</class>
|
32 |
+
<method>coreBlockAbstractToHtmlAfter</method>
|
33 |
+
</points_observer>
|
34 |
+
</observers>
|
35 |
+
</core_block_abstract_to_html_after>
|
36 |
+
<checkout_onepage_controller_success_action>
|
37 |
+
<observers>
|
38 |
+
<points_observer>
|
39 |
+
<type>singleton</type>
|
40 |
+
<class>PunchTab_Points_Model_Observer</class>
|
41 |
+
<method>checkoutOnepageControllerSuccessAction</method>
|
42 |
+
</points_observer>
|
43 |
+
</observers>
|
44 |
+
</checkout_onepage_controller_success_action>
|
45 |
+
<checkout_multishipping_controller_success_action>
|
46 |
+
<observers>
|
47 |
+
<points_observer>
|
48 |
+
<type>singleton</type>
|
49 |
+
<class>PunchTab_Points_Model_Observer</class>
|
50 |
+
<method>checkoutMultishippingControllerSuccessAction</method>
|
51 |
+
</points_observer>
|
52 |
+
</observers>
|
53 |
+
</checkout_multishipping_controller_success_action>
|
54 |
+
</events>
|
55 |
+
</global>
|
56 |
+
|
57 |
+
<frontend>
|
58 |
+
<layout>
|
59 |
+
<updates>
|
60 |
+
<points>
|
61 |
+
<file>points.xml</file>
|
62 |
+
</points>
|
63 |
+
</updates>
|
64 |
+
</layout>
|
65 |
+
</frontend>
|
66 |
+
|
67 |
+
<adminhtml>
|
68 |
+
<acl>
|
69 |
+
<resources>
|
70 |
+
<admin>
|
71 |
+
<children>
|
72 |
+
<system>
|
73 |
+
<children>
|
74 |
+
<config>
|
75 |
+
<children>
|
76 |
+
<points translate="title" module="points">
|
77 |
+
<title>Points</title>
|
78 |
+
</points>
|
79 |
+
</children>
|
80 |
+
</config>
|
81 |
+
</children>
|
82 |
+
</system>
|
83 |
+
</children>
|
84 |
+
</admin>
|
85 |
+
</resources>
|
86 |
+
</acl>
|
87 |
+
</adminhtml>
|
88 |
+
</config>
|
app/code/community/PunchTab/Points/etc/system.xml
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
|
4 |
+
<sections>
|
5 |
+
<points translate="label" module="points">
|
6 |
+
<label>Points</label>
|
7 |
+
<tab>catalog</tab>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>1000</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<groups>
|
14 |
+
<settings translate="label">
|
15 |
+
<label>Settings</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>1</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<fields>
|
22 |
+
<position translate="label">
|
23 |
+
<label>Rewards Tab Position</label>
|
24 |
+
<frontend_type>select</frontend_type>
|
25 |
+
<source_model>points/backend_source_position</source_model>
|
26 |
+
<sort_order>1</sort_order>
|
27 |
+
<show_in_default>1</show_in_default>
|
28 |
+
<show_in_website>1</show_in_website>
|
29 |
+
<show_in_store>1</show_in_store>
|
30 |
+
</position>
|
31 |
+
<key translate="label">
|
32 |
+
<label>Key</label>
|
33 |
+
<frontend_type>text</frontend_type>
|
34 |
+
<sort_order>2</sort_order>
|
35 |
+
<show_in_default>1</show_in_default>
|
36 |
+
<show_in_website>1</show_in_website>
|
37 |
+
<show_in_store>1</show_in_store>
|
38 |
+
</key>
|
39 |
+
<multiple translate="label">
|
40 |
+
<label>Points Multiple</label>
|
41 |
+
<frontend_type>text</frontend_type>
|
42 |
+
<sort_order>3</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</multiple>
|
47 |
+
<pthost translate="label">
|
48 |
+
<label>PunchTab Host</label>
|
49 |
+
<frontend_type>text</frontend_type>
|
50 |
+
<sort_order>4</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>1</show_in_website>
|
53 |
+
<show_in_store>1</show_in_store>
|
54 |
+
</pthost>
|
55 |
+
</fields>
|
56 |
+
</settings>
|
57 |
+
</groups>
|
58 |
+
</points>
|
59 |
+
</sections>
|
60 |
+
|
61 |
+
</config>
|
62 |
+
|
app/design/frontend/base/default/layout/points.xml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.0.1">
|
3 |
+
|
4 |
+
<default>
|
5 |
+
<block type="points/points" name="points" />
|
6 |
+
<block type="points/multishipping_points" name="multishipping_points" />
|
7 |
+
</default>
|
8 |
+
|
9 |
+
<catalog_product_view>
|
10 |
+
<reference name="product.info.extrahint">
|
11 |
+
<block type="points/points" name="points_points" before="-" />
|
12 |
+
</reference>
|
13 |
+
</catalog_product_view>
|
14 |
+
|
15 |
+
<checkout_cart_index>
|
16 |
+
<reference name="checkout.cart.methods">
|
17 |
+
<block type="points/points" name="points_points" before="-" />
|
18 |
+
</reference>
|
19 |
+
</checkout_cart_index>
|
20 |
+
|
21 |
+
<checkout_onepage_index>
|
22 |
+
<reference name="right">
|
23 |
+
<block type="points/points" name="points_points" after="-" />
|
24 |
+
</reference>
|
25 |
+
</checkout_onepage_index>
|
26 |
+
|
27 |
+
<checkout_multishipping_overview>
|
28 |
+
<reference name="checkout.multishipping.overview.items.after">
|
29 |
+
<block type="points/points" name="points_points" after="-" />
|
30 |
+
</reference>
|
31 |
+
</checkout_multishipping_overview>
|
32 |
+
|
33 |
+
<checkout_onepage_success>
|
34 |
+
<reference name="checkout.success">
|
35 |
+
<block type="points/points" name="points_points" after="-" />
|
36 |
+
</reference>
|
37 |
+
</checkout_onepage_success>
|
38 |
+
|
39 |
+
<checkout_multishipping_success>
|
40 |
+
<reference name="checkout_success">
|
41 |
+
<block type="points/multishipping_points" name="multishipping_points" after="-" />
|
42 |
+
</reference>
|
43 |
+
</checkout_multishipping_success>
|
44 |
+
|
45 |
+
</layout>
|
46 |
+
|
app/design/frontend/base/default/template/points/multishipping/points.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<div id="magento_points" class="regular-price">
|
2 |
+
<span style="color:#FF9933;"><?php echo $this->getMessage();?></span>
|
3 |
+
</div>
|
app/design/frontend/base/default/template/points/points.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<div id="magento_points" class="regular-price">
|
2 |
+
<span style="color:#FF9933;"><?php echo $this->getMessage();?></span>
|
3 |
+
</div>
|
app/design/frontend/default/default/template/points/multishipping/points.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<div id="magento_points" class="regular-price">
|
2 |
+
<span style="color:#FF9933;"><?php echo $this->getMessage();?></span>
|
3 |
+
</div>
|
app/design/frontend/default/default/template/points/points.phtml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<div id="magento_points" class="regular-price">
|
2 |
+
<span style="color:#FF9933;"><?php echo $this->getMessage();?></span>
|
3 |
+
</div>
|
app/etc/modules/PunchTab_Points.xml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category PunchTab
|
5 |
+
* @package PunchTab_Points
|
6 |
+
*/
|
7 |
+
-->
|
8 |
+
<config>
|
9 |
+
<modules>
|
10 |
+
<PunchTab_Points>
|
11 |
+
<active>true</active>
|
12 |
+
<codePool>community</codePool>
|
13 |
+
</PunchTab_Points>
|
14 |
+
</modules>
|
15 |
+
</config>
|
16 |
+
|
package.xml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>punchtabpoints</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.gnu.org/licenses/lgpl-3.0.html">LGPL 3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Earn reward points for purchases</summary>
|
10 |
+
<description>Add a loyalty program to your Magento site, instantly.
|
11 |
+

|
12 |
+
From purchases to social sharing, reward-enable any action you want to incentivize your users to take on your Magento eCommerce site.</description>
|
13 |
+
<notes>- Display Reward Points in
|
14 |
+
* Product page
|
15 |
+
* Checkout page
|
16 |
+
* Order Success Page
|
17 |
+
- Configure 
|
18 |
+
* points multiple for dollars purchased
|
19 |
+
* location of Rewards Tab on site pages
|
20 |
+
- Earn Reward Points at www.punchtab.com (reported when order completes successfully)</notes>
|
21 |
+
<authors><author><name>punchtab</name><user>auto-converted</user><email>apps@punchtab.com</email></author></authors>
|
22 |
+
<date>2011-11-11</date>
|
23 |
+
<time>00:26:43</time>
|
24 |
+
<contents><target name="magecommunity"><dir name="PunchTab"><dir name="Points"><dir name="Block"><dir name="Multishipping"><file name="Points.php" hash="2904825280ac274f1d89f84d363a32e2"/></dir><file name="Points.php" hash="5b7578288edc1fe6743b7eed502a5a5f"/></dir><dir name="Helper"><file name="Data.php" hash="cd5a2c2eb1de4cad64a5c53a59bda794"/></dir><dir name="Model"><dir name="Backend"><dir name="Source"><file name="Position.php" hash="a5f3cf3176d1ef59ea8b7bfab6eb3e0d"/></dir></dir><file name="Observer.php" hash="6ef272e3d44a67755f81048451f21ae3"/></dir><dir name="etc"><file name="config.xml" hash="1eff0bf8cfc14a0c281f0262018c7736"/><file name="system.xml" hash="dedadfa472e466e85f1e93ca625dc372"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PunchTab_Points.xml" hash="c4c05dc493146f8f6a04277724f544e3"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="points.xml" hash="cc22d9c35ab447191b34b584d1b7ea41"/></dir><dir name="template"><dir name="points"><dir name="multishipping"><file name="points.phtml" hash="01721ffe180b1cbd5abddea82ea66710"/></dir><file name="points.phtml" hash="01721ffe180b1cbd5abddea82ea66710"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="points"><dir name="multishipping"><file name="points.phtml" hash="01721ffe180b1cbd5abddea82ea66710"/></dir><file name="points.phtml" hash="01721ffe180b1cbd5abddea82ea66710"/></dir></dir><file name="layout" hash=""/></dir></dir></dir></target></contents>
|
25 |
+
<compatible/>
|
26 |
+
<dependencies/>
|
27 |
+
</package>
|