Shopalizes_Purchase_Sharing_Widget - Version 1.1.0

Version Notes

Added support for configurable products images
Solved a javascript error related to 'description' field

Download this release

Release Info

Developer Magento Core Team
Extension Shopalizes_Purchase_Sharing_Widget
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.4 to 1.1.0

app/code/community/Shopalize/Purchasesharingwidget/Helper/Data.php CHANGED
@@ -1,259 +1,303 @@
1
- <?php
2
- /**
3
- * @website http://www.shopalize.com
4
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
- */
6
- class Shopalize_Purchasesharingwidget_Helper_Data extends Mage_Core_Helper_Abstract
7
- {
8
- public function getConfig($field, $group = 'settings', $default = null){
9
- $value = Mage::getStoreConfig('purchasesharingwidget/'.$group.'/'.$field);
10
- if(!isset($value) or trim($value) == ''){
11
- return $default;
12
- }else{
13
- return $value;
14
- }
15
- }
16
-
17
- public function getWidget($order_id) {
18
-
19
- if($order_id)
20
-
21
- {
22
-
23
- $order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
24
- $_items = $order->getAllVisibleItems();
25
- $_count = count($_items);
26
-
27
- if($_count>0)
28
- {
29
- $orderDate=explode(" ",$order->getCreatedAt());
30
- $orderDate1=explode("-",$orderDate[0]);
31
- $_output='<!-- Shopalize Integration BEGIN -->';
32
- $_output.="\n".'<div id="shopalize-purchase-sharing-wrapper"></div>';
33
- $_output.="\n".'<script type="text/javascript">';
34
- $_output.="\nvar Shopalize = window.Shopalize || {};
35
- (function() {
36
- // Populate Purchase Order details
37
- var order_details = {'is_debug' : false, 'merchant_id': '', 'widget_width': '', 'campaign_id': '', 'customer_email': '', 'order_number': '', 'order_total': '', 'order_currency': '', 'order_date': '', 'items' : []},
38
- num_items = '".$_count."';
39
- for(var cnt = 0; cnt < num_items; cnt++) { order_details.items[cnt] = {'id':'', 'title':'', 'current_price':'', 'list_price':'', 'url':'', 'image_url':''};}
40
-
41
- // Provide Merchant account, Order, and Product Details\n";
42
-
43
- $_output.="\n\torder_details['is_debug'] = true;";
44
- $_output.="\n\torder_details['merchant_id'] = '".$this->getConfig('merchant_id', 'settings')."';";
45
- $_output.="\n\torder_details['widget_width'] = '".$this->getConfig('widget_width', 'settings')."px';";
46
- $_output.="\n\torder_details['customer_email'] = '".$this->escapeHtml($order->getCustomerEmail())."';";
47
- $_output.="\n\torder_details['order_number'] = '".$order_id."';";
48
- $_output.="\n\torder_details['order_total'] = '".$this->escapeHtml($order->getGrandTotal())."';";
49
- $_output.="\n\torder_details['order_currency'] = '".$this->escapeHtml($order->getOrderCurrencyCode())."';";
50
- $_output.="\n\torder_details['order_date'] = '".$orderDate1[1]."-".$orderDate1[2]."-".$orderDate1[0]."';";
51
- $_output.="\n";
52
-
53
- /*get ordered items*/
54
-
55
- $k=0; foreach ($_items as $_item):
56
- $_product = Mage::getModel('catalog/product');
57
- $_product->load($_product->getIdBySku($_item->getSku()));
58
- /*additional changes for configurable products*/
59
- $parent_url='';
60
- $product_url='';
61
- $parentIdArray='';
62
-
63
- $_version_array=Mage::getVersionInfo();
64
- $_version=$_version_array['major'].$_version_array['minor'].$_version_array['revision'];
65
-
66
-
67
- if($_product->getvisibility()=='1')
68
- {
69
- if($_version<='141')
70
- {
71
- list($parentIdArray) = $_product->loadParentProductIds()->getData('parent_product_ids');
72
- if(isset($parentIdArray[0]))
73
- {
74
- $parent = Mage::getModel('catalog/product')->load($parentIdArray[0]);
75
- $parent_url=$parent->getProductUrl();
76
- }
77
- }
78
- else
79
- {
80
-
81
- list($parentIdArray) = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($_product->getIdBySku($_item->getSku()));
82
-
83
- if(isset($parentIdArray))
84
- {
85
- $parent = Mage::getModel('catalog/product')->load($parentIdArray);
86
- $parent_url=$parent->getProductUrl();
87
- }
88
- }
89
- $product_url=$parent_url;
90
- }
91
- else
92
- {
93
- $product_url=$_product->getProductUrl();
94
-
95
- }
96
- /*additional changes for configurable products*/
97
- $_helper = Mage::helper('catalog/output');
98
- if ($_product->getImage() != 'no_selection' && $_product->getImage()):
99
- $_img = Mage::helper('catalog/image')->init($_product, 'image')->resize(90);
100
- else:
101
- $_img = Mage::helper('catalog/image')->init($_product, 'image')->resize(90);
102
- endif;
103
- if($_item->getPrice()==$_product->getPrice()):
104
- $price=$_item->getPrice(); $special_price=$price;
105
- else:
106
- $price=$_product->getPrice(); $special_price=$_item->getPrice();
107
- endif;
108
- $_output.="\n\torder_details['items'][".$k."]['id'] = '".$_item->getSku()."';";
109
- $_output.="\n\torder_details['items'][".$k."]['title'] = '".str_replace("'", "", $_item->getName())."';";
110
- $_output.="\n\torder_details['items'][".$k."]['current_price'] = '".$special_price."';";
111
- $_output.="\n\torder_details['items'][".$k."]['list_price'] = '".$price."';";
112
- $_output.="\n\torder_details['items'][".$k."]['url'] = '".$product_url."';";
113
- $_output.="\n\torder_details['items'][".$k."]['image_url'] = '".$_img."';";
114
- $_output.="\n\torder_details['items'][".$k."]['description'] = '".substr(str_replace("'", "", $this->escapeHtml($_product->getShortDescription())),0,100)."';";
115
-
116
- $k++; endforeach;
117
-
118
- /*get ordered items*/
119
-
120
- $_output.="\n\n// Assign Purchase Order details to Shopalize scope
121
- Shopalize.order_details = order_details;
122
- Shopalize.base_url = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'www.shopalize.com';
123
-
124
- // Load Widget script Asynchronously
125
- var script = document.createElement('script');
126
- script.type = 'text/javascript'; script.async = true;
127
- script.src = Shopalize.base_url + '/js/purchase_sharing.js';
128
- var entry = document.getElementsByTagName('script')[0];
129
- entry.parentNode.insertBefore(script, entry);
130
- }());";
131
-
132
- $_output.="\n</script>\n".'<!-- Shopalize Integration END -->';
133
-
134
- }
135
-
136
- return $_output;
137
- }
138
- else {
139
- return false;
140
- }
141
- }
142
- public function getOrderinfoWidget($order_id) {
143
-
144
- if($order_id)
145
-
146
- {
147
-
148
- $order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
149
- $_items = $order->getAllVisibleItems();
150
- $_count = count($_items);
151
-
152
-
153
- $_output="<h3>Order Details (".$_count." Items)</h3>";
154
- $_output.="<p>Customer Name : ".$this->escapeHtml($order->getCustomerName())."</p>";
155
- $_output.="<p>Customer Email : ".$this->escapeHtml($order->getCustomerEmail())."</p>";
156
- $_output.="<p>Order No : ".$order_id."</p>";
157
- $_output.="<p>Order Total : ".$this->escapeHtml($order->getGrandTotal())."</p>";
158
- $_output.="<p>Order Currency : ".$this->escapeHtml($order->getOrderCurrencyCode())."</p>";
159
- $_output.="<p>Order Date : ".$order->getCreatedAtDate()."</p>";
160
-
161
- if($_count>0)
162
- {
163
- $_output.='<h3>Ordered Items</h3>';
164
- $_output.='<table width="100%" class="data-table">
165
- <tr style="background:#eee;">
166
- <th>Item</th>
167
- <th>Product Name</th>
168
- <th>Product Code</th>
169
- <th>Url</th>
170
- <th>Visibility</th>
171
- <th>Parent Id</th>
172
- <th>Product Id</th>
173
- <th>Price</th>
174
- <th>Special Price</th>
175
- </tr>';
176
-
177
-
178
-
179
- /*get ordered items*/
180
-
181
- $k=0; foreach ($_items as $_item):
182
- $_product = Mage::getModel('catalog/product');
183
- $_product->load($_product->getIdBySku($_item->getSku()));
184
- $parent_url='';
185
- $product_url='';
186
- $parentIdArray='';
187
-
188
- $_version_array=Mage::getVersionInfo();
189
- $_version=$_version_array['major'].$_version_array['minor'].$_version_array['revision'];
190
-
191
-
192
- if($_product->getvisibility()=='1')
193
- {
194
- if($_version<='141')
195
- {
196
- list($parentIdArray) = $_product->loadParentProductIds()->getData('parent_product_ids');
197
- if(isset($parentIdArray[0]))
198
- {
199
- $parent = Mage::getModel('catalog/product')->load($parentIdArray[0]);
200
- $parent_url=$parent->getProductUrl();
201
- }
202
- }
203
- else
204
- {
205
-
206
- list($parentIdArray) = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($_product->getIdBySku($_item->getSku()));
207
-
208
- if(isset($parentIdArray))
209
- {
210
- $parent = Mage::getModel('catalog/product')->load($parentIdArray);
211
- $parent_url=$parent->getProductUrl();
212
- }
213
- }
214
- $product_url=$parent_url;
215
- }
216
- else
217
- {
218
- $product_url=$_product->getProductUrl();
219
-
220
- }
221
- $_helper = Mage::helper('catalog/output');
222
- if ($_product->getImage() != 'no_selection' && $_product->getImage()):
223
- $_img = '<a href="'.$product_url.'" title="'.$_product->getName().'"><img id="image" src="'.Mage::helper('catalog/image')->init($_product, 'image')->resize(50).'" alt="'.$this->htmlEscape($_product->getImageLabel()).'" title="'.$this->htmlEscape($_product->getImageLabel()).'" /></a>';
224
- else:
225
- $_img = '<a href="'.$product_url.'"><img src="'.Mage::helper('catalog/image')->init($_product, 'image')->resize(50).'" alt="'.$this->htmlEscape($_product->getImageLabel()).'" title="'.$this->htmlEscape($_product->getImageLabel()).'" /></a>';
226
- endif;
227
- if($_item->getPrice()==$_product->getPrice()):
228
- $price=$_item->getPrice(); $special_price=$price;
229
- else:
230
- $price=$_product->getPrice(); $special_price=$_item->getPrice();
231
- endif;
232
-
233
- //print items
234
- $_output.='<tr>';
235
- $_output.='<td>'.$_helper->productAttribute($_product, $_img, 'image').'</td>';
236
- $_output.='<td>'.$_item->getName().'</td>';
237
- $_output.='<td>'.$_item->getSku().'</td>';
238
- $_output.='<td>'.$product_url.'</td>';
239
- $_output.='<td>'.$_product->getvisibility().'</td>';
240
- $_output.='<td>'.$parentIdArray.'</td>';
241
- $_output.='<td>'.$_product->getIdBySku($_item->getSku()).'</td>';
242
- $_output.='<td>'.$price.'</td>';
243
- $_output.='<td>'.$special_price.','.$_item->getCost().'</td>';
244
- $_output.='</tr>';
245
-
246
- $k++; endforeach;
247
-
248
- /*get ordered items*/
249
- $_output.='</table>';
250
- }
251
-
252
- return $_output;
253
- }
254
- else {
255
- return false;
256
- }
257
- }
258
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
1
+ <?php
2
+ /**
3
+ * @website http://www.shopalize.com
4
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
+ */
6
+ class Shopalize_Purchasesharingwidget_Helper_Data extends Mage_Core_Helper_Abstract
7
+ {
8
+ public function getConfig($field, $group = 'settings', $default = null){
9
+ $value = Mage::getStoreConfig('purchasesharingwidget/'.$group.'/'.$field);
10
+ if(!isset($value) or trim($value) == ''){
11
+ return $default;
12
+ }else{
13
+ return $value;
14
+ }
15
+ }
16
+
17
+ public function getWidget($order_id) {
18
+
19
+ if($order_id)
20
+
21
+ {
22
+
23
+ $order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
24
+ $_items = $order->getAllVisibleItems();
25
+ $_count = count($_items);
26
+
27
+ if($_count>0)
28
+ {
29
+ $orderDate=explode(" ",$order->getCreatedAt());
30
+ $orderDate1=explode("-",$orderDate[0]);
31
+ $_output='<!-- Shopalize Integration BEGIN -->';
32
+ $_output.="\n".'<div id="shopalize-purchase-sharing-wrapper"></div>';
33
+ $_output.="\n".'<script type="text/javascript">';
34
+ $_output.="\nvar Shopalize = window.Shopalize || {};
35
+ (function() {
36
+ // Populate Purchase Order details
37
+ var order_details = {'is_debug' : false, 'merchant_id': '', 'widget_width': '', 'campaign_id': '', 'customer_email': '', 'order_number': '', 'order_total': '', 'order_currency': '', 'order_date': '', 'items' : []},
38
+ num_items = '".$_count."';
39
+ for(var cnt = 0; cnt < num_items; cnt++) { order_details.items[cnt] = {'id':'', 'title':'', 'current_price':'', 'list_price':'', 'url':'', 'image_url':''};}
40
+
41
+ // Provide Merchant account, Order, and Product Details\n";
42
+
43
+ $_output.="\n\torder_details['is_debug'] = true;";
44
+ $_output.="\n\torder_details['merchant_id'] = '".$this->getConfig('merchant_id', 'settings')."';";
45
+ $_output.="\n\torder_details['widget_width'] = '".$this->getConfig('widget_width', 'settings')."px';";
46
+ $_output.="\n\torder_details['customer_email'] = '".$this->escapeHtml($order->getCustomerEmail())."';";
47
+ $_output.="\n\torder_details['order_number'] = '".$order_id."';";
48
+ $_output.="\n\torder_details['order_total'] = '".$this->escapeHtml($order->getGrandTotal())."';";
49
+ $_output.="\n\torder_details['order_currency'] = '".$this->escapeHtml($order->getOrderCurrencyCode())."';";
50
+ $_output.="\n\torder_details['order_date'] = '".$orderDate1[1]."-".$orderDate1[2]."-".$orderDate1[0]."';";
51
+ $_output.="\n";
52
+
53
+ /*get ordered items*/
54
+
55
+ $k=0; foreach ($_items as $_item):
56
+ $_product = Mage::getModel('catalog/product');
57
+ $_product->load($_product->getIdBySku($_item->getSku()));
58
+ /*additional changes for configurable products*/
59
+ $parent_url='';
60
+ $product_url='';
61
+ $parentIdArray='';
62
+
63
+ $_version_array=Mage::getVersionInfo();
64
+ $_version=$_version_array['major'].$_version_array['minor'].$_version_array['revision'];
65
+
66
+ $l_bHasParent = false;
67
+
68
+ if($_product->getvisibility()=='1')
69
+ {
70
+ if($_version<='141')
71
+ {
72
+ list($parentIdArray) = $_product->loadParentProductIds()->getData('parent_product_ids');
73
+ if(isset($parentIdArray[0]))
74
+ {
75
+ $parent = Mage::getModel('catalog/product')->load($parentIdArray[0]);
76
+ $parent_url=$parent->getProductUrl();
77
+
78
+ // product has parent
79
+ $l_bHasParent = true;
80
+ }
81
+ }
82
+ else
83
+ {
84
+
85
+ list($parentIdArray) = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($_product->getIdBySku($_item->getSku()));
86
+
87
+ if(isset($parentIdArray))
88
+ {
89
+ $parent = Mage::getModel('catalog/product')->load($parentIdArray);
90
+ $parent_url=$parent->getProductUrl();
91
+
92
+ // product has parent
93
+ $l_bHasParent = true;
94
+ }
95
+ }
96
+ $product_url=$parent_url;
97
+ }
98
+ else
99
+ {
100
+ $product_url=$_product->getProductUrl();
101
+
102
+ }
103
+ /*additional changes for configurable products*/
104
+ $_helper = Mage::helper('catalog/output');
105
+
106
+ if ($l_bHasParent && (!$_product->getImage() || 'no_selection' === $_product->getImage())) {
107
+ // product has parent, we use the parent image
108
+ $_img = Mage::helper('catalog/image')->init($parent, 'image', $parent->getImage())->resize(90)->__toString();
109
+ }
110
+ else {
111
+ if ($_product->getImage() != 'no_selection' && $_product->getImage()):
112
+ $_img = Mage::helper('catalog/image')->init($_product, 'image')->resize(90);
113
+ else:
114
+ $_img = Mage::helper('catalog/image')->init($_product, 'image')->resize(90);
115
+ endif;
116
+ }
117
+
118
+ if($_item->getPrice()==$_product->getPrice()):
119
+ $price=$_item->getPrice(); $special_price=$price;
120
+ else:
121
+ $price=$_product->getPrice(); $special_price=$_item->getPrice();
122
+ endif;
123
+
124
+ $_output .= "/*". $_product->getShortDescription(). "*/";
125
+
126
+ $_output.="\n\torder_details['items'][".$k."]['id'] = '".$_item->getSku()."';";
127
+ $_output.="\n\torder_details['items'][".$k."]['title'] = '".str_replace("'", "", $_item->getName())."';";
128
+ $_output.="\n\torder_details['items'][".$k."]['current_price'] = '".$special_price."';";
129
+ $_output.="\n\torder_details['items'][".$k."]['list_price'] = '".$price."';";
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
+
134
+ $k++; endforeach;
135
+
136
+ /*get ordered items*/
137
+
138
+ $_output.="\n\n// Assign Purchase Order details to Shopalize scope
139
+ Shopalize.order_details = order_details;
140
+ Shopalize.base_url = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'www.shopalize.com';
141
+
142
+ // Load Widget script Asynchronously
143
+ var script = document.createElement('script');
144
+ script.type = 'text/javascript'; script.async = true;
145
+ script.src = Shopalize.base_url + '/js/purchase_sharing.js';
146
+ var entry = document.getElementsByTagName('script')[0];
147
+ entry.parentNode.insertBefore(script, entry);
148
+ }());";
149
+
150
+ $_output.="\n</script>\n".'<!-- Shopalize Integration END -->';
151
+
152
+ }
153
+
154
+ return $_output;
155
+ }
156
+ else {
157
+ return false;
158
+ }
159
+ }
160
+ public function getOrderinfoWidget($order_id) {
161
+
162
+ if($order_id)
163
+
164
+ {
165
+
166
+ $order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
167
+ $_items = $order->getAllVisibleItems();
168
+ $_count = count($_items);
169
+
170
+
171
+ $_output="<h3>Order Details (".$_count." Items)</h3>";
172
+ $_output.="<p>Customer Name : ".$this->escapeHtml($order->getCustomerName())."</p>";
173
+ $_output.="<p>Customer Email : ".$this->escapeHtml($order->getCustomerEmail())."</p>";
174
+ $_output.="<p>Order No : ".$order_id."</p>";
175
+ $_output.="<p>Order Total : ".$this->escapeHtml($order->getGrandTotal())."</p>";
176
+ $_output.="<p>Order Currency : ".$this->escapeHtml($order->getOrderCurrencyCode())."</p>";
177
+ $_output.="<p>Order Date : ".$order->getCreatedAtDate()."</p>";
178
+
179
+ if($_count>0)
180
+ {
181
+ $_output.='<h3>Ordered Items</h3>';
182
+ $_output.='<table width="100%" class="data-table">
183
+ <tr style="background:#eee;">
184
+ <th>Item</th>
185
+ <th>Product Name</th>
186
+ <th>Product Code</th>
187
+ <th>Url</th>
188
+ <th>Visibility</th>
189
+ <th>Parent Id</th>
190
+ <th>Product Id</th>
191
+ <th>Price</th>
192
+ <th>Special Price</th>
193
+ </tr>';
194
+
195
+
196
+
197
+ /*get ordered items*/
198
+
199
+ $k=0; foreach ($_items as $_item):
200
+ $_product = Mage::getModel('catalog/product');
201
+ $_product->load($_product->getIdBySku($_item->getSku()));
202
+ $parent_url='';
203
+ $product_url='';
204
+ $parentIdArray='';
205
+
206
+ $_version_array=Mage::getVersionInfo();
207
+ $_version=$_version_array['major'].$_version_array['minor'].$_version_array['revision'];
208
+
209
+ $l_bHasParent = false;
210
+
211
+ if($_product->getvisibility()=='1')
212
+ {
213
+ if($_version<='141')
214
+ {
215
+ list($parentIdArray) = $_product->loadParentProductIds()->getData('parent_product_ids');
216
+ if(isset($parentIdArray[0]))
217
+ {
218
+ $parent = Mage::getModel('catalog/product')->load($parentIdArray[0]);
219
+ $parent_url=$parent->getProductUrl();
220
+ // product has parent
221
+ $l_bHasParent = true;
222
+ }
223
+ }
224
+ else
225
+ {
226
+
227
+ list($parentIdArray) = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($_product->getIdBySku($_item->getSku()));
228
+
229
+ if(isset($parentIdArray))
230
+ {
231
+ $parent = Mage::getModel('catalog/product')->load($parentIdArray);
232
+ $parent_url=$parent->getProductUrl();
233
+ // product has parent
234
+ $l_bHasParent = true;
235
+ }
236
+ }
237
+ $product_url=$parent_url;
238
+ }
239
+ else
240
+ {
241
+ $product_url=$_product->getProductUrl();
242
+
243
+ }
244
+ $_helper = Mage::helper('catalog/output');
245
+
246
+ $l_bUseParentImage = false;
247
+ if ($l_bHasParent && (!$_product->getImage() || 'no_selection' === $_product->getImage())) {
248
+ // product has parent we use the parent's image
249
+ $_img = Mage::helper('catalog/image')->init($parent, 'image', $parent->getImage())->resize(90);
250
+ $l_bUseParentImage = true;
251
+ }
252
+ else {
253
+ if ($_product->getImage() != 'no_selection' && $_product->getImage()):
254
+ $_img = Mage::helper('catalog/image')->init($_product, 'image')->resize(90);
255
+ else:
256
+ $_img = Mage::helper('catalog/image')->init($_product, 'image')->resize(90);
257
+ endif;
258
+ }
259
+
260
+ if($_item->getPrice()==$_product->getPrice()):
261
+ $price=$_item->getPrice(); $special_price=$price;
262
+ else:
263
+ $price=$_product->getPrice(); $special_price=$_item->getPrice();
264
+ endif;
265
+
266
+ //print items
267
+ $_output.='<tr>';
268
+ $_output.='<td>'.$_helper->productAttribute($l_bUseParentImage?$parent:$_product, $_img, 'image').'</td>';
269
+ $_output.='<td>'.$_item->getName().'</td>';
270
+ $_output.='<td>'.$_item->getSku().'</td>';
271
+ $_output.='<td>'.$product_url.'</td>';
272
+ $_output.='<td>'.$_product->getvisibility().'</td>';
273
+ $_output.='<td>'.$parentIdArray.'</td>';
274
+ $_output.='<td>'.$_product->getIdBySku($_item->getSku()).'</td>';
275
+ $_output.='<td>'.$price.'</td>';
276
+ $_output.='<td>'.$special_price.','.$_item->getCost().'</td>';
277
+ $_output.='</tr>';
278
+
279
+ $k++; endforeach;
280
+
281
+ /*get ordered items*/
282
+ $_output.='</table>';
283
+ }
284
+
285
+ return $_output;
286
+ }
287
+ else {
288
+ return false;
289
+ }
290
+ }
291
+
292
+ protected function _sanitizeDescription($p_oProduct) {
293
+
294
+ $_helper = Mage::helper('catalog/output');
295
+
296
+ $l_sDescription = $_helper->productAttribute($p_oProduct, strip_tags(str_replace(array("\r\n", "\r", "\n", "\t"), ' ', $p_oProduct->getShortDescription())), 'short_description');
297
+ $l_sDescription = str_replace('\'', '\\\'', $l_sDescription);
298
+
299
+ return $l_sDescription;
300
+
301
+ }
302
+
303
  }
app/code/community/Shopalize/Purchasesharingwidget/etc/config.xml CHANGED
@@ -1,76 +1,76 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * @website http://www.shopalize.com
5
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
6
- */
7
- -->
8
- <config>
9
- <modules>
10
- <Shopalize_Purchasesharingwidget>
11
- <version>1.1.0</version>
12
- </Shopalize_Purchasesharingwidget>
13
- </modules>
14
- <global>
15
- <helpers>
16
- <purchasesharingwidget>
17
- <class>Shopalize_Purchasesharingwidget_Helper</class>
18
- </purchasesharingwidget>
19
- </helpers>
20
-
21
- <blocks>
22
- <purchasesharingwidget>
23
- <class>Shopalize_Purchasesharingwidget_Block</class>
24
- </purchasesharingwidget>
25
- <checkout>
26
- <rewrite>
27
- <success>Shopalize_Purchasesharingwidget_Block_Success</success>
28
- </rewrite>
29
- </checkout>
30
- </blocks>
31
-
32
-
33
- </global>
34
- <frontend>
35
- <layout>
36
- <updates>
37
- <purchasesharingwidget>
38
- <file>purchasesharingwidget.xml</file>
39
- </purchasesharingwidget>
40
- </updates>
41
- </layout>
42
- </frontend>
43
- <adminhtml>
44
- <acl>
45
- <resources>
46
- <admin>
47
- <children>
48
- <system>
49
- <children>
50
- <config>
51
- <children>
52
- <shopalizeinfo>
53
- <title>Shopalize</title>
54
- </shopalizeinfo>
55
- <purchasesharingwidget>
56
- <title>Post Purchase Sharing Plugin</title>
57
- </purchasesharingwidget>
58
- </children>
59
- </config>
60
- </children>
61
- </system>
62
- </children>
63
- </admin>
64
- </resources>
65
- </acl>
66
- </adminhtml>
67
- <default>
68
- <purchasesharingwidget>
69
- <settings>
70
- <active>0</active>
71
- <widget_width>400</widget_width>
72
-
73
- </settings>
74
- </purchasesharingwidget>
75
- </default>
76
  </config>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @website http://www.shopalize.com
5
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
6
+ */
7
+ -->
8
+ <config>
9
+ <modules>
10
+ <Shopalize_Purchasesharingwidget>
11
+ <version>1.1.0</version>
12
+ </Shopalize_Purchasesharingwidget>
13
+ </modules>
14
+ <global>
15
+ <helpers>
16
+ <purchasesharingwidget>
17
+ <class>Shopalize_Purchasesharingwidget_Helper</class>
18
+ </purchasesharingwidget>
19
+ </helpers>
20
+
21
+ <blocks>
22
+ <purchasesharingwidget>
23
+ <class>Shopalize_Purchasesharingwidget_Block</class>
24
+ </purchasesharingwidget>
25
+ <checkout>
26
+ <rewrite>
27
+ <success>Shopalize_Purchasesharingwidget_Block_Success</success>
28
+ </rewrite>
29
+ </checkout>
30
+ </blocks>
31
+
32
+
33
+ </global>
34
+ <frontend>
35
+ <layout>
36
+ <updates>
37
+ <purchasesharingwidget>
38
+ <file>purchasesharingwidget.xml</file>
39
+ </purchasesharingwidget>
40
+ </updates>
41
+ </layout>
42
+ </frontend>
43
+ <adminhtml>
44
+ <acl>
45
+ <resources>
46
+ <admin>
47
+ <children>
48
+ <system>
49
+ <children>
50
+ <config>
51
+ <children>
52
+ <shopalizeinfo>
53
+ <title>Shopalize</title>
54
+ </shopalizeinfo>
55
+ <purchasesharingwidget>
56
+ <title>Post Purchase Sharing Plugin</title>
57
+ </purchasesharingwidget>
58
+ </children>
59
+ </config>
60
+ </children>
61
+ </system>
62
+ </children>
63
+ </admin>
64
+ </resources>
65
+ </acl>
66
+ </adminhtml>
67
+ <default>
68
+ <purchasesharingwidget>
69
+ <settings>
70
+ <active>0</active>
71
+ <widget_width>400</widget_width>
72
+
73
+ </settings>
74
+ </purchasesharingwidget>
75
+ </default>
76
  </config>
app/design/frontend/default/default/layout/purchasesharingwidget.xml CHANGED
@@ -1,14 +1,15 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <layout version="0.1.0">
3
-
4
-
5
-
6
- <checkout_onepage_success translate="label">
7
-
8
- <reference name="checkout.success">
9
-
10
- <action method="setTemplate" ifconfig="purchasesharingwidget/settings/active"><template>purchasesharingwidget/success.phtml</template></action>
11
-
12
- </reference>
13
- </checkout_onepage_success>
 
14
  </layout>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+
4
+ <checkout_onepage_success translate="label">
5
+
6
+ <reference name="checkout.success">
7
+
8
+ <action method="setTemplate" ifconfig="purchasesharingwidget/settings/active"><template>purchasesharingwidget/success.phtml</template></action>
9
+
10
+ </reference>
11
+ </checkout_onepage_success>
12
+
13
+
14
+
15
  </layout>
package.xml CHANGED
@@ -1,20 +1,21 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shopalizes_Purchase_Sharing_Widget</name>
4
- <version>1.0.4</version>
5
  <stability>stable</stability>
6
- <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>The extension Integrates Shopalize Social Purchase Sharing Widget with magento shop.</summary>
10
- <description>Shopalize's Purchase Sharing Widget appears on the Order Confirmation page i.e. after checkout is complete and enables your customers to share their Purchases or specific Promotional Offers with their friends on existing social media platforms. It provides deep integration with growing social platforms like Facebook and Twitter for maximum reach, more engagement, and seamless experience. You can completely customize the look and feel, messaging of the Widget to match your store's needs.</description>
11
- <notes>Shopalize Purchase Sharing Widget 1.0.4&#xD;
12
  &#xD;
13
- Added support with Firechekout Extension.</notes>
 
 
14
  <authors><author><name>Aditya Kothadiya</name><user>auto-converted</user><email>aditya@shopalize.com</email></author></authors>
15
- <date>2012-04-04</date>
16
- <time>05:58:15</time>
17
- <contents><target name="mageetc"><dir name="modules"><file name="Shopalize_Purchasesharingwidget.xml" hash="374670608fd7b7012a90aeec163220f9"/></dir></target><target name="magecommunity"><dir name="Shopalize"><dir name="Purchasesharingwidget"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Info"><file name="About.php" hash="4cd569d89ef211946be266ba39a9cdd0"/></dir><file name="Info.php" hash="7631831242ab43ae4727bc5fe96a6ddb"/></dir></dir><file name="Purchasesharingwidget.php" hash="345cd1a160a857e4cec48d400bb91c1c"/><file name="Success.php" hash="92428ca11a72510a62952e8515e38d7f"/></dir><dir name="Helper"><file name="Data.php" hash="662b680edf03a47af0ff201ffa47b909"/></dir><dir name="controllers"><file name="IndexController.php" hash="a82c545d242ee4fc9a40de34c103b1db"/></dir><dir name="etc"><file name="adminhtml.xml" hash="86bdb512b92ee4b236d6e611953cad6d"/><file name="config.xml" hash="ef2ff5dcda067d26e067a6212176415f"/><file name="system.xml" hash="5ba12d973ba2e2d366507c675b0d7dc9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="purchasesharingwidget"><file name="success.phtml" hash="45bca1908ae08864823137728df2f35e"/></dir></dir><dir name="layout"><file name="purchasesharingwidget.xml" hash="c9628990b3dbfceeb9bffb33dccf7824"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shopalizes_Purchase_Sharing_Widget</name>
4
+ <version>1.1.0</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.&#xD;
 
11
  &#xD;
12
+ 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>
13
+ <notes>Added support for configurable products images&#xD;
14
+ Solved a javascript error related to 'description' field</notes>
15
  <authors><author><name>Aditya Kothadiya</name><user>auto-converted</user><email>aditya@shopalize.com</email></author></authors>
16
+ <date>2012-04-27</date>
17
+ <time>22:04:53</time>
18
+ <contents><target name="magecommunity"><dir name="Shopalize"><dir name="Purchasesharingwidget"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Info"><file name="About.php" hash="4cd569d89ef211946be266ba39a9cdd0"/></dir><file name="Info.php" hash="7631831242ab43ae4727bc5fe96a6ddb"/></dir></dir><file name="Purchasesharingwidget.php" hash="345cd1a160a857e4cec48d400bb91c1c"/><file name="Success.php" hash="92428ca11a72510a62952e8515e38d7f"/></dir><dir name="Helper"><file name="Data.php" hash="6912cfc5f68084ca697b078f133eaaa0"/></dir><dir name="controllers"><file name="IndexController.php" hash="a82c545d242ee4fc9a40de34c103b1db"/></dir><dir name="etc"><file name="adminhtml.xml" hash="86bdb512b92ee4b236d6e611953cad6d"/><file name="config.xml" hash="b348928f59ecf095a895993d2cbe97d1"/><file name="system.xml" hash="5ba12d973ba2e2d366507c675b0d7dc9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="purchasesharingwidget.xml" hash="9ac6016b90d1f2b54abbd0dd77a7ad14"/></dir><dir name="template"><dir name="purchasesharingwidget"><file name="success.phtml" hash="45bca1908ae08864823137728df2f35e"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopalize_Purchasesharingwidget.xml" hash="374670608fd7b7012a90aeec163220f9"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies/>
21
  </package>