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 |
-
|
111 |
-
|
112 |
-
public function
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
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.
|
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><p>Shopalize's Product Sharing
|
11 |

|
12 |
<p>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.</p>
|
13 |

|
14 |
-
<p>Shopalize also
|
15 |

|
16 |
-
<p>
|
17 |

|
18 |
<h1>Installation Steps</h1>
|
19 |

|
20 |
<ol>
|
21 |
-
<li>Register an account with <a href="http://www.shopalize.com">Shopalize.com</a> before you start the installation to get your Account
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 & drives new referrals</summary>
|
10 |
+
<description><p>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.</p>
|
11 |

|
12 |
<p>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.</p>
|
13 |

|
14 |
+
<p>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.</p>
|
15 |

|
16 |
+
<p>To learn more about Shopalize, visit our website: <a href="http://www.shopalize.com/?utm_source=magento&utm_medium=showcase&utm_campaign=product">http://www.shopalize.com</a>.</p>
|
17 |

|
18 |
<h1>Installation Steps</h1>
|
19 |

|
20 |
<ol>
|
21 |
+
<li>Register an account with <a href="http://www.shopalize.com/?utm_source=magento&utm_medium=showcase&utm_campaign=product">Shopalize.com</a> before you start the installation to get your Account & Store ID from Shopalize system.</li>
|
22 |
+
<li>Then <a href="http://www.shopalize.com/help/integration/magento?utm_source=magento&utm_medium=showcase&utm_campaign=product">follow these guidelines to install this extension</a>.</li>
|
23 |
+
</ol>
|
24 |
+

|
25 |
+
<p>That's it! You'll be all set to increase your customer referrals through social recommendations!</p>
|
26 |
+

|
27 |
+
<h1>Feature List</h1>
|
28 |
+

|
29 |
+
<ol>
|
30 |
+
<li>Customers share actual links of Products they like with their friends</li>
|
31 |
+
<li>Customers share products they like on Facebook, Twitter, Pinterest and Email</li>
|
32 |
+
<li>You can reward customers for various actions: Sharing Products, Referring Sales or Referring Traffic.</li>
|
33 |
+
<li>You can reward customers with Coupons or Shopalize Points</li>
|
34 |
+
<li>Coupons can be Percentage based, fixed amount based or Free Shipping based. They can be Unique one-time usage codes or single Common code</li>
|
35 |
+
<li>Shopalize Points can be redeemed as Cash back or donated to charity</li>
|
36 |
+
<li>Widget’s text, color and messaging is completely customizable</li>
|
37 |
+
<li>You get beautiful dashboard of key metrics - Shares, Posts, Clicks, Sales, Revenue, etc.</li>
|
38 |
+
<li>View or download detailed reports of rewards that are distributed to your customers</li>
|
39 |
+
<li>Identify your top influential customers using real-time leaderboard</li>
|
40 |
+
<li>View all sharing activity feed in real-time to see which customers are sharing what products</li>
|
41 |
+
<li>Experiment with different rewards, messaging and style using easy-to-use A/B testing platform</li>
|
42 |
+
<li>Your customers can also view their shared activities and earned rewards at one central place</li>
|
43 |
+
</ol>
|
44 |
+

|
45 |
+
<h1><a href="http://www.shopalize.com?utm_source=magento&utm_medium=showcase&utm_campaign=product">Sign up for Shopalize.com now!</a></h1></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>
|