Shopalizes_Product_Sharing_Widget - Version 1.0.7

Version Notes

Added Category URL in tracking code

Download this release

Release Info

Developer Aditya Kothadiya
Extension Shopalizes_Product_Sharing_Widget
Version 1.0.7
Comparing to
See all releases


Code changes from version 1.0.6 to 1.0.7

app/code/community/Shopalize/Productsharing/Block/Button.php CHANGED
@@ -1,150 +1,167 @@
1
- <?php
2
- /**
3
- * @company Bytes Technolab<www.bytestechnolab.com>
4
- * @author Bytes Technolab<info@bytestechnolab.com>
5
- */
6
-
7
- class Shopalize_Productsharing_Block_Button extends Mage_Core_Block_Template{
8
-
9
- protected $_isIntegration = false;
10
- const PRODUCT_IMAGE_SIZE = 256;
11
-
12
- public function isIntegration(){
13
- $this->_isIntegration = true;
14
- return $this;
15
- }
16
-
17
- /**
18
- * Product
19
- *
20
- * @return Mage_Catalog_Model_Product
21
- */
22
- public function getProduct(){
23
-
24
- if ($product = Mage::registry('current_product')){
25
- return $product;
26
- }
27
- return false;
28
- }
29
-
30
- /**
31
- * Product URL
32
- */
33
- public function getCanonicalUrl(){
34
- $params = array();
35
- if (Mage::helper('catalog/product')->canUseCanonicalTag()){
36
- $params = array('_ignore_category'=>true);
37
- }
38
-
39
- /** @var Mage_Catalog_Model_Product $product */
40
- $product = $this->getProduct();
41
- return $product->getUrlModel()->getUrl($product, $params);
42
- }
43
-
44
- /**
45
- * Product URL
46
- */
47
- public function getProductUrl(){
48
- return $this->getCanonicalUrl();
49
- }
50
-
51
- /**
52
- * Product Short Description
53
- */
54
- public function getShortDescription($_product){
55
- $shortDescription = strip_tags($_product->getShortDescription());
56
- $shortDescription = Mage::helper('catalog/output')->productAttribute($_product, strip_tags(str_replace(array("\r\n", "\r", "\n", "\t"), ' ', $shortDescription)), 'short_description');
57
- $shortDescription = str_replace('\'', '\\\'', $shortDescription);
58
-
59
- return $shortDescription;
60
- }
61
-
62
- /**
63
- * Product Name
64
- */
65
- public function getProductName(){
66
- $name = strip_tags($this->getProduct()->getName());
67
- $name = str_replace("'", "", $name);
68
- return addslashes($name);
69
- }
70
-
71
- /**
72
- * Product Image
73
- */
74
- public function getProductImage($_product){
75
- return Mage::helper('catalog/image')->init($_product, 'image', $_product->getImage())->resize(self::PRODUCT_IMAGE_SIZE)->__toString();
76
- }
77
-
78
- /**
79
- * Product Price
80
- */
81
- public function getProductPrice($_product){
82
- if($this->getProduct()->getTypeId() == 'bundle'){
83
- $_priceModel = $_product->getPriceModel();
84
- list($_minimalPriceInclTax, $_maximalPriceInclTax) = $_priceModel->getTotalPrices($_product, null, true, false);
85
- return $_minimalPriceInclTax;
86
- } else {
87
- return $this->getProduct()->getPrice();
88
- }
89
- }
90
-
91
- /**
92
- * Product Special Price
93
- */
94
- public function getProductSpecialPrice($_product){
95
- if($this->getProduct()->getTypeId() == 'bundle'){
96
- $_priceModel = $_product->getPriceModel();
97
- list($_minimalPriceInclTax, $_maximalPriceInclTax) = $_priceModel->getTotalPrices($_product, null, true, false);
98
- return $_minimalPriceInclTax;
99
- } else {
100
- $special_price = $this->getProduct()->getSpecialPrice();
101
-
102
- if($special_price == '')
103
- return $this->getProduct()->getProductPrice();
104
- else
105
- return $special_price;
106
- }
107
- }
108
-
109
- /**
110
- * Shopalized Product Sharing Enabled
111
- */
112
- public function isEnabled(){
113
- return Mage::getStoreConfig('productsharing/settings/active');
114
- }
115
-
116
- /**
117
- * Product Shopalized Merchant Id
118
- */
119
- public function getShopalizeMerchantId(){
120
- /* if(Mage::getStoreConfig('purchasesharing/settings/active')){
121
- return Mage::getStoreConfig('purchasesharing/settings/merchant_id');
122
- }else{
123
- return Mage::getStoreConfig('productsharing/settings/merchant_id');
124
- }*/
125
- }
126
-
127
- /**
128
- * Product Shopalized Store Id
129
- */
130
- public function getShopalizeStoreId(){
131
- if(Mage::getStoreConfig('purchasesharing/settings/active')){
132
- return Mage::getStoreConfig('purchasesharing/settings/store_id');
133
- }else{
134
- return Mage::getStoreConfig('productsharing/settings/store_id');
135
- }
136
- }
137
-
138
- public function isPurchaseSharingEnabled(){
139
- return Mage::getStoreConfig('purchasesharing/settings/active');
140
- }
141
-
142
- public function getButtonClassName(){
143
- return Mage::getStoreConfig('productsharing/settings/share_button_class');
144
- }
145
-
146
- public function getButtonTextName(){
147
- return Mage::getStoreConfig('productsharing/settings/share_button_text');
148
- }
149
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  }
1
+ <?php
2
+ /**
3
+ * @company Bytes Technolab<www.bytestechnolab.com>
4
+ * @author Bytes Technolab<info@bytestechnolab.com>
5
+ */
6
+
7
+ class Shopalize_Productsharing_Block_Button extends Mage_Core_Block_Template{
8
+
9
+ protected $_isIntegration = false;
10
+ const PRODUCT_IMAGE_SIZE = 256;
11
+
12
+ public function isIntegration(){
13
+ $this->_isIntegration = true;
14
+ return $this;
15
+ }
16
+
17
+ /**
18
+ * Product
19
+ *
20
+ * @return Mage_Catalog_Model_Product
21
+ */
22
+ public function getProduct(){
23
+
24
+ if ($product = Mage::registry('current_product')){
25
+ return $product;
26
+ }
27
+ return false;
28
+ }
29
+
30
+ /**
31
+ * Product URL
32
+ */
33
+ public function getCanonicalUrl(){
34
+ $params = array();
35
+ if (Mage::helper('catalog/product')->canUseCanonicalTag()){
36
+ $params = array('_ignore_category'=>true);
37
+ }
38
+
39
+ /** @var Mage_Catalog_Model_Product $product */
40
+ $product = $this->getProduct();
41
+ return $product->getUrlModel()->getUrl($product, $params);
42
+ }
43
+
44
+ /**
45
+ * Product URL
46
+ */
47
+ public function getProductUrl(){
48
+ return $this->getCanonicalUrl();
49
+ }
50
+
51
+ /**
52
+ * Product Short Description
53
+ */
54
+ public function getShortDescription($_product){
55
+ $shortDescription = strip_tags($_product->getShortDescription());
56
+ $shortDescription = Mage::helper('catalog/output')->productAttribute($_product, strip_tags(str_replace(array("\r\n", "\r", "\n", "\t"), ' ', $shortDescription)), 'short_description');
57
+ $shortDescription = str_replace('\'', '\\\'', $shortDescription);
58
+
59
+ return $shortDescription;
60
+ }
61
+
62
+ /**
63
+ * Product Name
64
+ */
65
+ public function getProductName(){
66
+ $name = strip_tags($this->getProduct()->getName());
67
+ $name = str_replace("'", "", $name);
68
+ return addslashes($name);
69
+ }
70
+
71
+ /**
72
+ * Product Image
73
+ */
74
+ public function getProductImage($_product){
75
+ return Mage::helper('catalog/image')->init($_product, 'image', $_product->getImage())->resize(self::PRODUCT_IMAGE_SIZE)->__toString();
76
+ }
77
+
78
+ /**
79
+ * Product Price
80
+ */
81
+ public function getProductPrice($_product){
82
+ if($this->getProduct()->getTypeId() == 'bundle'){
83
+ $_priceModel = $_product->getPriceModel();
84
+ list($_minimalPriceInclTax, $_maximalPriceInclTax) = $_priceModel->getTotalPrices($_product, null, true, false);
85
+ return $_minimalPriceInclTax;
86
+ } else {
87
+ return $this->getProduct()->getPrice();
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Product Special Price
93
+ */
94
+ public function getProductSpecialPrice($_product){
95
+ if($this->getProduct()->getTypeId() == 'bundle'){
96
+ $_priceModel = $_product->getPriceModel();
97
+ list($_minimalPriceInclTax, $_maximalPriceInclTax) = $_priceModel->getTotalPrices($_product, null, true, false);
98
+ return $_minimalPriceInclTax;
99
+ } else {
100
+ $special_price = $this->getProduct()->getSpecialPrice();
101
+
102
+ if($special_price == '')
103
+ return $this->getProduct()->getProductPrice();
104
+ else
105
+ return $special_price;
106
+ }
107
+ }
108
+
109
+ /*
110
+ * Get Product Category URL
111
+ */
112
+ public function getProductCategoryURL($_product){
113
+ $categories = $_product->getCategoryIds();
114
+
115
+ $cat_name = '';
116
+ $cat_url = '';
117
+ foreach($categories as $k => $_category_id):
118
+ $_category = Mage::getModel('catalog/category')->load($_category_id);
119
+ $cat_url = $_category->getUrl();
120
+ break;
121
+ endforeach;
122
+
123
+ return $cat_url;
124
+ }
125
+
126
+ /**
127
+ * Shopalized Product Sharing Enabled
128
+ */
129
+ public function isEnabled(){
130
+ return Mage::getStoreConfig('productsharing/settings/active');
131
+ }
132
+
133
+ /**
134
+ * Product Shopalized Merchant Id
135
+ */
136
+ public function getShopalizeMerchantId(){
137
+ /* if(Mage::getStoreConfig('purchasesharing/settings/active')){
138
+ return Mage::getStoreConfig('purchasesharing/settings/merchant_id');
139
+ }else{
140
+ return Mage::getStoreConfig('productsharing/settings/merchant_id');
141
+ }*/
142
+ }
143
+
144
+ /**
145
+ * Product Shopalized Store Id
146
+ */
147
+ public function getShopalizeStoreId(){
148
+ if(Mage::getStoreConfig('purchasesharing/settings/active')){
149
+ return Mage::getStoreConfig('purchasesharing/settings/store_id');
150
+ }else{
151
+ return Mage::getStoreConfig('productsharing/settings/store_id');
152
+ }
153
+ }
154
+
155
+ public function isPurchaseSharingEnabled(){
156
+ return Mage::getStoreConfig('purchasesharing/settings/active');
157
+ }
158
+
159
+ public function getButtonClassName(){
160
+ return Mage::getStoreConfig('productsharing/settings/share_button_class');
161
+ }
162
+
163
+ public function getButtonTextName(){
164
+ return Mage::getStoreConfig('productsharing/settings/share_button_text');
165
+ }
166
+
167
  }
app/design/frontend/default/default/template/shopalizeproductsharing/product_integration.phtml CHANGED
@@ -2,6 +2,8 @@
2
  if($this->isEnabled()){
3
 
4
  $_product = $this->getProduct();
 
 
5
 
6
  ?><!-- Shopalize Button Code BEGIN -->
7
  <div class="shopalize-product-sharing"
@@ -12,7 +14,8 @@ if($this->isEnabled()){
12
  data-image-url = "<?php echo $this->getProductImage($_product)?>"
13
  data-list-price = "<?php echo $this->getProductPrice($_product); ?>"
14
  data-current-price = "<?php echo $this->getProductSpecialPrice($_product); ?>"
15
- data-currency = "<?php echo Mage::app()->getStore()->getCurrentCurrencyCode() ?>">
 
16
  </div>
17
  <!-- Shopalize Button Code END -->
18
  <?php } ?>
2
  if($this->isEnabled()){
3
 
4
  $_product = $this->getProduct();
5
+ $cat_url = '';
6
+ $cat_url = $this->getProductCategoryURL($_product);
7
 
8
  ?><!-- Shopalize Button Code BEGIN -->
9
  <div class="shopalize-product-sharing"
14
  data-image-url = "<?php echo $this->getProductImage($_product)?>"
15
  data-list-price = "<?php echo $this->getProductPrice($_product); ?>"
16
  data-current-price = "<?php echo $this->getProductSpecialPrice($_product); ?>"
17
+ data-currency = "<?php echo Mage::app()->getStore()->getCurrentCurrencyCode() ?>"
18
+ data-category-url="<?php echo $cat_url; ?>">
19
  </div>
20
  <!-- Shopalize Button Code END -->
21
  <?php } ?>
package.xml CHANGED
@@ -1,29 +1,53 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shopalizes_Product_Sharing_Widget</name>
4
- <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Enables seamless sharing of Products you like with rewards to leading social platforms</summary>
10
- <description>&lt;p&gt;Shopalize's Product Sharing Plugin appears on your store's Product page. Shoppers are prompted and rewarded for sharing the Products they like with their friends on Facebook, Twitter, Pinterest and Email.&lt;/p&gt;&#xD;
11
  &#xD;
12
  &lt;p&gt;Once you integrate Shopalize's plugin to your store and start few campaigns, then you don't need any involvement maintaining these campaigns. Just sit back and let Shopalize drive social traffic and sales to your store. Seriously, it's the easiest and most powerful marketing solution out there.&lt;/p&gt;&#xD;
13
  &#xD;
14
- &lt;p&gt;Shopalize also provide an A/B Testing platform to experiment with various campaigns and social analytics suite to measure ROI and track influential customers.&lt;/p&gt;&#xD;
15
  &#xD;
16
- &lt;p&gt;&lt;a href="http://www.shopalize.com"&gt;Learn more about Shopalize.com&lt;/a&gt;.&lt;/p&gt;&#xD;
17
  &#xD;
18
  &lt;h1&gt;Installation Steps&lt;/h1&gt;&#xD;
19
  &#xD;
20
  &lt;ol&gt;&#xD;
21
- &lt;li&gt;Register an account with &lt;a href="http://www.shopalize.com"&gt;Shopalize.com&lt;/a&gt; before you start the installation to get your Account</description>
22
- <notes>Improve code and remove merchant id from configuration</notes>
23
- <authors><author><name>Aditya Kothadiya</name><user>auto-converted</user><email>aditya@shopalize.com</email></author></authors>
24
- <date>2012-10-11</date>
25
- <time>12:16:02</time>
26
- <contents><target name="magecommunity"><dir name="Shopalize"><dir name="Productsharing"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Info"><file name="About.php" hash="85ddeb0452ac49f57c6cba1c5767c6f0"/></dir><file name="Info.php" hash="722ed6078214cb852016f46fe4d0a2d7"/></dir></dir><file name="Button.php" hash="940d0a3e182c4c852cd22342dd1a656c"/></dir><dir name="Helper"><file name="Data.php" hash="bcb1c942f01fc227d50bd8a764a69a9a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ccd6eae72f74df2ccfca174e646027b3"/><file name="config.xml" hash="e44ccde85201ddae175315210a997104"/><file name="system.xml" hash="6f1882d5c2ba0284a6ce2dc96bbd475d"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="shopalizeproductsharing.xml" hash="c40655923a1c754b7d491e2cbcd9945c"/></dir><dir name="template"><dir name="shopalizeproductsharing"><file name="basic_integration.phtml" hash="6c38dac0803f2632e9d01b384e6d0b39"/><file name="product_integration.phtml" hash="48e7d88a7fb6d39c491a404f9f880e2d"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopalize_Productsharing.xml" hash="0fe28b06eef40ed847db7d9b41f8c6c2"/></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  <compatible/>
28
- <dependencies/>
29
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shopalizes_Product_Sharing_Widget</name>
4
+ <version>1.0.7</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Enables seamless sharing of Products you like with rewards to leading social platforms &amp; drives new referrals</summary>
10
+ <description>&lt;p&gt;Shopalize's Product Page Social Sharing plugin appears on your store's each Product page. Shoppers are enabled and rewarded for sharing products they like with their friends on Facebook, Twitter, Pinterest and Email.&lt;/p&gt;&#xD;
11
  &#xD;
12
  &lt;p&gt;Once you integrate Shopalize's plugin to your store and start few campaigns, then you don't need any involvement maintaining these campaigns. Just sit back and let Shopalize drive social traffic and sales to your store. Seriously, it's the easiest and most powerful marketing solution out there.&lt;/p&gt;&#xD;
13
  &#xD;
14
+ &lt;p&gt;Shopalize also provides an A/B Testing platform to experiment with various rewards, messaging and styles. It also provides detailed social analytics to measure key metrics, ROI and track influential customers.&lt;/p&gt;&#xD;
15
  &#xD;
16
+ &lt;p&gt;To learn more about Shopalize, visit our website: &lt;a href="http://www.shopalize.com/?utm_source=magento&amp;utm_medium=showcase&amp;utm_campaign=product"&gt;http://www.shopalize.com&lt;/a&gt;.&lt;/p&gt;&#xD;
17
  &#xD;
18
  &lt;h1&gt;Installation Steps&lt;/h1&gt;&#xD;
19
  &#xD;
20
  &lt;ol&gt;&#xD;
21
+ &lt;li&gt;Register an account with &lt;a href="http://www.shopalize.com/?utm_source=magento&amp;utm_medium=showcase&amp;utm_campaign=product"&gt;Shopalize.com&lt;/a&gt; before you start the installation to get your Account &amp; Store ID from Shopalize system.&lt;/li&gt;&#xD;
22
+ &lt;li&gt;Then &lt;a href="http://www.shopalize.com/help/integration/magento?utm_source=magento&amp;utm_medium=showcase&amp;utm_campaign=product"&gt;follow these guidelines to install this extension&lt;/a&gt;.&lt;/li&gt;&#xD;
23
+ &lt;/ol&gt;&#xD;
24
+ &#xD;
25
+ &lt;p&gt;That's it! You'll be all set to increase your customer referrals through social recommendations!&lt;/p&gt;&#xD;
26
+ &#xD;
27
+ &lt;h1&gt;Feature List&lt;/h1&gt;&#xD;
28
+ &#xD;
29
+ &lt;ol&gt;&#xD;
30
+ &lt;li&gt;Customers share actual links of Products they like with their friends&lt;/li&gt;&#xD;
31
+ &lt;li&gt;Customers share products they like on Facebook, Twitter, Pinterest and Email&lt;/li&gt;&#xD;
32
+ &lt;li&gt;You can reward customers for various actions: Sharing Products, Referring Sales or Referring Traffic.&lt;/li&gt;&#xD;
33
+ &lt;li&gt;You can reward customers with Coupons or Shopalize Points&lt;/li&gt;&#xD;
34
+ &lt;li&gt;Coupons can be Percentage based, fixed amount based or Free Shipping based. They can be Unique one-time usage codes or single Common code&lt;/li&gt;&#xD;
35
+ &lt;li&gt;Shopalize Points can be redeemed as Cash back or donated to charity&lt;/li&gt;&#xD;
36
+ &lt;li&gt;Widget&#x2019;s text, color and messaging is completely customizable&lt;/li&gt;&#xD;
37
+ &lt;li&gt;You get beautiful dashboard of key metrics - Shares, Posts, Clicks, Sales, Revenue, etc.&lt;/li&gt;&#xD;
38
+ &lt;li&gt;View or download detailed reports of rewards that are distributed to your customers&lt;/li&gt;&#xD;
39
+ &lt;li&gt;Identify your top influential customers using real-time leaderboard&lt;/li&gt;&#xD;
40
+ &lt;li&gt;View all sharing activity feed in real-time to see which customers are sharing what products&lt;/li&gt;&#xD;
41
+ &lt;li&gt;Experiment with different rewards, messaging and style using easy-to-use A/B testing platform&lt;/li&gt;&#xD;
42
+ &lt;li&gt;Your customers can also view their shared activities and earned rewards at one central place&lt;/li&gt;&#xD;
43
+ &lt;/ol&gt;&#xD;
44
+ &#xD;
45
+ &lt;h1&gt;&lt;a href="http://www.shopalize.com?utm_source=magento&amp;utm_medium=showcase&amp;utm_campaign=product"&gt;Sign up for Shopalize.com now!&lt;/a&gt;&lt;/h1&gt;</description>
46
+ <notes>Added Category URL in tracking code</notes>
47
+ <authors><author><name>Aditya Kothadiya</name><user>shopalize</user><email>aditya@shopalize.com</email></author></authors>
48
+ <date>2012-10-24</date>
49
+ <time>15:49:54</time>
50
+ <contents><target name="magecommunity"><dir name="Shopalize"><dir name="Productsharing"><dir name="Block"><file name="Button.php" hash="f4245be87144fc3846cc04a1ebac8753"/><dir name="System"><dir name="Config"><dir name="Info"><file name="About.php" hash="85ddeb0452ac49f57c6cba1c5767c6f0"/></dir><file name="Info.php" hash="722ed6078214cb852016f46fe4d0a2d7"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="bcb1c942f01fc227d50bd8a764a69a9a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ccd6eae72f74df2ccfca174e646027b3"/><file name="config.xml" hash="e44ccde85201ddae175315210a997104"/><file name="system.xml" hash="6f1882d5c2ba0284a6ce2dc96bbd475d"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="shopalizeproductsharing.xml" hash="c40655923a1c754b7d491e2cbcd9945c"/></dir><dir name="template"><dir name="shopalizeproductsharing"><file name="basic_integration.phtml" hash="6c38dac0803f2632e9d01b384e6d0b39"/><file name="product_integration.phtml" hash="a33f616402d5765ae9300ee0d0643e60"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopalize_Productsharing.xml" hash="0fe28b06eef40ed847db7d9b41f8c6c2"/></dir></target></contents>
51
  <compatible/>
52
+ <dependencies><required><php><min>5.1.0</min><max>100.0.0</max></php></required></dependencies>
53
  </package>