Shopalizes_Purchase_Sharing_Widget - Version 1.1.6

Version Notes

Update tracking code and remove merchant id from configuration

Download this release

Release Info

Developer Aditya Kothadiya
Extension Shopalizes_Purchase_Sharing_Widget
Version 1.1.6
Comparing to
See all releases


Code changes from version 1.1.5 to 1.1.6

app/code/community/Shopalize/Purchasesharing/Block/Success.php CHANGED
@@ -20,11 +20,11 @@ class Shopalize_Purchasesharing_Block_Success extends Mage_Checkout_Block_Succes
20
  * Product Shopalized Merchant Id
21
  */
22
  public function getShopalizeMerchantId(){
23
- if(Mage::getStoreConfig('purchasesharing/settings/active')){
24
  return Mage::getStoreConfig('purchasesharing/settings/merchant_id');
25
  }else{
26
  return Mage::getStoreConfig('productsharing/settings/merchant_id');
27
- }
28
  }
29
 
30
  /**
20
  * Product Shopalized Merchant Id
21
  */
22
  public function getShopalizeMerchantId(){
23
+ /* if(Mage::getStoreConfig('purchasesharing/settings/active')){
24
  return Mage::getStoreConfig('purchasesharing/settings/merchant_id');
25
  }else{
26
  return Mage::getStoreConfig('productsharing/settings/merchant_id');
27
+ }*/
28
  }
29
 
30
  /**
app/code/community/Shopalize/Purchasesharing/Helper/Data.php CHANGED
@@ -11,7 +11,7 @@ class Shopalize_Purchasesharing_Helper_Data extends Mage_Core_Helper_Abstract{
11
  const PRODUCT_IMAGE_SIZE = 256;
12
 
13
  public function getWidget($order_id) {
14
-
15
  if($order_id){
16
 
17
  $order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
@@ -28,14 +28,13 @@ class Shopalize_Purchasesharing_Helper_Data extends Mage_Core_Helper_Abstract{
28
  $_output.="\nvar Shopalize = window.Shopalize || {};
29
  (function() {
30
  // Populate Purchase Order details
31
- var order_details = {'is_debug' : false, 'merchant_id': '', 'widget_width': '', 'campaign_id': '', 'customer_email': '', 'order_number': '', 'order_total': '', 'order_currency': '', 'order_date': '', 'items' : []},
32
  num_items = '".$_count."';
33
- for(var cnt = 0; cnt < num_items; cnt++) { order_details.items[cnt] = {'id':'', 'title':'', 'current_price':'', 'list_price':'', 'url':'', 'image_url':''};}
34
 
35
  // Provide Merchant account, Order, and Product Details\n";
36
 
37
- $_output.="\n\torder_details['is_debug'] = true;";
38
- $_output.="\n\torder_details['widget_width'] = '".Mage::getStoreConfig('purchasesharingwidget/settings/widget_width')."px';";
39
  $_output.="\n\torder_details['customer_email'] = '".$this->escapeHtml($order->getCustomerEmail())."';";
40
  $_output.="\n\torder_details['order_number'] = '".$order_id."';";
41
  $_output.="\n\torder_details['order_total'] = '".$this->escapeHtml($order->getGrandTotal())."';";
@@ -90,7 +89,17 @@ class Shopalize_Purchasesharing_Helper_Data extends Mage_Core_Helper_Abstract{
90
  $product_url=$_product->getProductUrl();
91
 
92
  }
93
-
 
 
 
 
 
 
 
 
 
 
94
  /*additional changes for configurable products*/
95
  $_helper = Mage::helper('catalog/output');
96
 
@@ -109,7 +118,7 @@ class Shopalize_Purchasesharing_Helper_Data extends Mage_Core_Helper_Abstract{
109
 
110
  if($_item->getPrice()==$_product->getPrice()):
111
  $price=$_item->getPrice(); $special_price=$price;
112
- else:
113
  $price=$_product->getPrice(); $special_price=$_item->getPrice();
114
  endif;
115
 
@@ -121,7 +130,8 @@ class Shopalize_Purchasesharing_Helper_Data extends Mage_Core_Helper_Abstract{
121
  $_output.="\n\torder_details['items'][".$k."]['url'] = '".$product_url."';";
122
  $_output.="\n\torder_details['items'][".$k."]['image_url'] = '".$_img."';";
123
  $_output.="\n\torder_details['items'][".$k."]['description'] = '". $this->_sanitizeDescription($_product). "';";
124
-
 
125
  $k++;
126
  endforeach;
127
 
11
  const PRODUCT_IMAGE_SIZE = 256;
12
 
13
  public function getWidget($order_id) {
14
+
15
  if($order_id){
16
 
17
  $order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
28
  $_output.="\nvar Shopalize = window.Shopalize || {};
29
  (function() {
30
  // Populate Purchase Order details
31
+ var order_details = {'is_debug' : false, 'customer_email': '', 'order_number': '', 'order_total': '', 'order_currency': '', 'order_date': '', 'items' : []},
32
  num_items = '".$_count."';
33
+ for(var cnt = 0; cnt < num_items; cnt++) { order_details.items[cnt] = {'id':'', 'title':'', 'current_price':'', 'list_price':'', 'url':'', 'image_url':'', 'description':'', 'category_name':'', 'category_url':''};}
34
 
35
  // Provide Merchant account, Order, and Product Details\n";
36
 
37
+ $_output.="\n\torder_details['is_debug'] = false;";
 
38
  $_output.="\n\torder_details['customer_email'] = '".$this->escapeHtml($order->getCustomerEmail())."';";
39
  $_output.="\n\torder_details['order_number'] = '".$order_id."';";
40
  $_output.="\n\torder_details['order_total'] = '".$this->escapeHtml($order->getGrandTotal())."';";
89
  $product_url=$_product->getProductUrl();
90
 
91
  }
92
+
93
+ $categories = $_product->getCategoryIds();
94
+ $cat_name = '';
95
+ $cat_url = '';
96
+ foreach($categories as $k => $_category_id):
97
+ $_category = Mage::getModel('catalog/category')->load($_category_id);
98
+ $cat_url = $_category->getUrl();
99
+ $cat_name = $_category->getName();
100
+ break;
101
+ endforeach;
102
+
103
  /*additional changes for configurable products*/
104
  $_helper = Mage::helper('catalog/output');
105
 
118
 
119
  if($_item->getPrice()==$_product->getPrice()):
120
  $price=$_item->getPrice(); $special_price=$price;
121
+ else:
122
  $price=$_product->getPrice(); $special_price=$_item->getPrice();
123
  endif;
124
 
130
  $_output.="\n\torder_details['items'][".$k."]['url'] = '".$product_url."';";
131
  $_output.="\n\torder_details['items'][".$k."]['image_url'] = '".$_img."';";
132
  $_output.="\n\torder_details['items'][".$k."]['description'] = '". $this->_sanitizeDescription($_product). "';";
133
+ $_output.="\n\torder_details['items'][".$k."]['category_name'] = '".$cat_name."';";
134
+ $_output.="\n\torder_details['items'][".$k."]['category_url'] = '".$cat_url."';";
135
  $k++;
136
  endforeach;
137
 
app/code/community/Shopalize/Purchasesharing/etc/system.xml CHANGED
@@ -56,14 +56,14 @@
56
  <show_in_website>1</show_in_website>
57
  <show_in_store>1</show_in_store>
58
  </active>
59
- <merchant_id translate="label">
60
  <label>Merchant Id</label>
61
  <frontend_type>text</frontend_type>
62
  <sort_order>20</sort_order><show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
  <comment><![CDATA[Get Shopalize Merchant ID by signing up at <a target="_blank" href="http://www.shopalize.com">www.shopalize.com</a>. Look for Account ID value on Settings or Integration Guide page.]]></comment>
66
- </merchant_id>
67
  <store_id translate="label">
68
  <label>Store Id</label>
69
  <frontend_type>text</frontend_type>
56
  <show_in_website>1</show_in_website>
57
  <show_in_store>1</show_in_store>
58
  </active>
59
+ <!-- <merchant_id translate="label">
60
  <label>Merchant Id</label>
61
  <frontend_type>text</frontend_type>
62
  <sort_order>20</sort_order><show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
  <comment><![CDATA[Get Shopalize Merchant ID by signing up at <a target="_blank" href="http://www.shopalize.com">www.shopalize.com</a>. Look for Account ID value on Settings or Integration Guide page.]]></comment>
66
+ </merchant_id> -->
67
  <store_id translate="label">
68
  <label>Store Id</label>
69
  <frontend_type>text</frontend_type>
app/design/frontend/default/default/template/shopalizepurchasesharing/basic_integration.phtml CHANGED
@@ -5,10 +5,8 @@ if($this->isEnabled()){ ?>
5
  (function(w, d, id) {
6
  if (d.getElementById(id)) return;
7
  Shopalize = w.Shopalize || {};
8
- Shopalize.merchant_id = '<?php echo $this->getShopalizeMerchantId() ?>';
9
  Shopalize.store_id = '<?php echo $this->getShopalizeStoreId() ?>';
10
- Shopalize.currency = '<?php echo Mage::app()->getStore()->getCurrentCurrencyCode() ?>';
11
- Shopalize.base_url = ('https:'== d.location.protocol ? 'https://' : 'http://') + 'shopalize.com';
12
  var script = d.createElement('script'), entry; script.type = 'text/javascript'; script.id = id;
13
  script.async = true; script.src = Shopalize.base_url + '/js/all.js';
14
  entry = d.getElementsByTagName('script')[0]; entry.parentNode.insertBefore(script, entry);
5
  (function(w, d, id) {
6
  if (d.getElementById(id)) return;
7
  Shopalize = w.Shopalize || {};
 
8
  Shopalize.store_id = '<?php echo $this->getShopalizeStoreId() ?>';
9
+ Shopalize.base_url = ('https:'== d.location.protocol ? 'https://' : 'http://') + 'www.shopalize.com';
 
10
  var script = d.createElement('script'), entry; script.type = 'text/javascript'; script.id = id;
11
  script.async = true; script.src = Shopalize.base_url + '/js/all.js';
12
  entry = d.getElementsByTagName('script')[0]; entry.parentNode.insertBefore(script, entry);
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shopalizes_Purchase_Sharing_Widget</name>
4
- <version>1.1.5</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Shopalize helps Online Retailers to increase social sharing and customer referrals from Social Media.</summary>
10
- <description>Shopalize's Post Purchase Sharing Plugin appears on your store's order confirmation page i.e. after checkout is complete. After every purchase is complete, shoppers are prompted and rewarded for sharing their purchase or your store with their friends on Facebook or Twitter. Shopalize also provide an A/B Testing platform to experiment with various campaigns and social analytics suite to measure ROI and track influential customers. Once you integrate Shopalize's plugin to your storefront and kick start few campaigns, then you don't need any involvement maintaining these campaigns. Just sit back</description>
11
- <notes>Make basic tracking code separate and load it before end of body task</notes>
12
- <authors><author><name>Aditya Kothadiya</name><user>auto-converted</user><email>aditya@shopalize.com</email></author></authors>
13
- <date>2012-08-20</date>
14
- <time>20:01:30</time>
15
- <contents><target name="magecommunity"><dir name="Shopalize"><dir name="Purchasesharing"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Info"><file name="About.php" hash="e91ca06ff51e185ed65356e617132cad"/></dir><file name="Info.php" hash="988eee568f62409fc28d9d6e02afb55a"/></dir></dir><file name="Success.php" hash="f38a7b649ed58f4c947f6599d7174609"/></dir><dir name="Helper"><file name="Data.php" hash="1b889ec3159f11e6927c9cb8b6cb761b"/><file name="Event.php" hash="8c2791b583f6393756a889278a29da0e"/></dir><dir name="controllers"><file name="IndexController.php" hash="823fa27af1e085fa49406192b83401cb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9939e2a4c2a8d89d952d8a4e2764fec8"/><file name="config.xml" hash="85911ce0b14cbc0d98cb3d7dc2683e1c"/><file name="system.xml" hash="d1d9eaefff35e4b426bb7bb10bb56012"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="shopalizepurchasesharing.xml" hash="44725eda273b3779956670f0728b6289"/></dir><dir name="template"><dir name="shopalizepurchasesharing"><file name="basic_integration.phtml" hash="5cf89471ad2ef9b386585a709bf86d3e"/><file name="purchase_integration.phtml" hash="9c74f7fc7b4708207b1dd534a44b9b51"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopalize_Purchasesharing.xml" hash="3bd5d06ea4b65aecee757be25be639bb"/></dir></target></contents>
16
  <compatible/>
17
- <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shopalizes_Purchase_Sharing_Widget</name>
4
+ <version>1.1.6</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Shopalize helps Online Retailers to increase social sharing and customer referrals from Social Media.</summary>
10
+ <description>Shopalize's Post Purchase Sharing Plugin appears on your store's order confirmation page i.e. after checkout is complete. After every purchase is complete, shoppers are prompted and rewarded for sharing their purchase or your store with their friends on Facebook or Twitter. Shopalize also provide an A/B Testing platform to experiment with various campaigns and social analytics suite to measure ROI and track influential customers. Once you integrate Shopalize's plugin to your storefront and kick start few campaigns, then you don't need any involvement maintaining these campaigns. Just sit back &amp;amp; relax or focus on other tasks at your hand, and let Shopalize drive social traffic and sales to your store. Seriously, it's the easiest and most powerful marketing solution out there.</description>
11
+ <notes>Update tracking code and remove merchant id from configuration</notes>
12
+ <authors><author><name>Aditya Kothadiya</name><user>shopalize</user><email>aditya@shopalize.com</email></author></authors>
13
+ <date>2012-10-19</date>
14
+ <time>17:34:05</time>
15
+ <contents><target name="magecommunity"><dir name="Shopalize"><dir name="Purchasesharing"><dir name="Block"><file name="Success.php" hash="5ab2055a9808bd872bae6e5ae321a9ca"/><dir name="System"><dir name="Config"><dir name="Info"><file name="About.php" hash="e91ca06ff51e185ed65356e617132cad"/></dir><file name="Info.php" hash="988eee568f62409fc28d9d6e02afb55a"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="88a956f01be0e730194fb1584063c7b8"/><file name="Event.php" hash="8c2791b583f6393756a889278a29da0e"/></dir><dir name="controllers"><file name="IndexController.php" hash="823fa27af1e085fa49406192b83401cb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9939e2a4c2a8d89d952d8a4e2764fec8"/><file name="config.xml" hash="85911ce0b14cbc0d98cb3d7dc2683e1c"/><file name="system.xml" hash="b8e0acd5aa0986f6ce2590683ae5471a"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="shopalizepurchasesharing.xml" hash="44725eda273b3779956670f0728b6289"/></dir><dir name="template"><dir name="shopalizepurchasesharing"><file name="basic_integration.phtml" hash="17a041b94877eae442d3333986875f65"/><file name="purchase_integration.phtml" hash="9c74f7fc7b4708207b1dd534a44b9b51"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopalize_Purchasesharing.xml" hash="3bd5d06ea4b65aecee757be25be639bb"/></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>100.0.0</max></php></required></dependencies>
18
  </package>