Netgo_Favouritelist - Version 1.0.0

Version Notes

First Preview Release

Download this release

Release Info

Developer NetGo
Extension Netgo_Favouritelist
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

User_Manual.pdf ADDED
Binary file
app/code/community/Netgo/Favouritelist/Block/Index.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+
14
+ class Netgo_Favouritelist_Block_Index extends Mage_Core_Block_Template{
15
+
16
+
17
+
18
+ public function __construct(){
19
+ parent::__construct();
20
+
21
+ $helper = Mage::helper('favouritelist');
22
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
23
+ $customerId=$customerData->getId();
24
+ $favouriteList = Mage::getModel('favouritelist/favouritelist')->getCollection()->addFieldToFilter('customerid',$customerId)->setOrder('favouritelist_id', 'DESC');;
25
+
26
+ $this->setFavouritelist($favouriteList);
27
+
28
+
29
+ }
30
+
31
+
32
+
33
+ }
app/code/community/Netgo/Favouritelist/Block/Links.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+ class Netgo_Favouritelist_Block_Links extends Mage_Core_Block_Template
14
+ {
15
+
16
+ public function addFavtLink()
17
+ {
18
+ $parentBlock = $this->getParentBlock();
19
+
20
+ $helper = Mage::helper('favouritelist');
21
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
22
+ $customerId=$customerData->getId();
23
+ $favouriteList = Mage::getModel('favouritelist/favouritelist')->getCollection()->addFieldToFilter('customerid',$customerId);
24
+ $count=$favouriteList->getSize();
25
+
26
+ if ($count == 1) {
27
+ $text = $this->__('My Favourite List (%s item)', $count);
28
+ } elseif ($count > 0) {
29
+ $text = $this->__('My Favourite List (%s items)', $count);
30
+ } else {
31
+ $text = $this->__('My Favourite List');
32
+ }
33
+
34
+
35
+ $parentBlock->addLink($text, 'favouritelist/index', $text, true, array(), 50, null, 'class="top-link-fav"');
36
+
37
+ return $this;
38
+ }
39
+
40
+
41
+ }
app/code/community/Netgo/Favouritelist/Helper/Data.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+
14
+ class Netgo_Favouritelist_Helper_Data extends Mage_Core_Helper_Abstract
15
+ {
16
+
17
+
18
+ public function __construct(){
19
+
20
+ if(Mage::getStoreConfig('favouritelist/favouritelistsetting/enable')==0 and (!Mage::app()->getStore()->isAdmin()))
21
+ {
22
+
23
+ Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl());
24
+
25
+ }
26
+
27
+ }
28
+
29
+ public function getUrl($product)
30
+ {
31
+
32
+ $fid = (int) Mage::app()->getRequest()->getParam('flid');
33
+
34
+ if($fid > 0){
35
+
36
+ $fvurl=Mage::getBaseUrl().'favouritelist/index/updatefavouritelist/item/'.$fid;
37
+
38
+ }else
39
+ {
40
+ $fvurl=Mage::getBaseUrl().'favouritelist/index/addfavouritelist/product/'.$product->getId();
41
+ }
42
+ return $fvurl;
43
+ }
44
+
45
+ public function isAllow()
46
+ {
47
+
48
+ return Mage::getStoreConfig('favouritelist/favouritelistsetting/enable');
49
+ }
50
+
51
+
52
+ }
53
+
app/code/community/Netgo/Favouritelist/Model/Favouritelist.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+ class Netgo_Favouritelist_Model_Favouritelist extends Mage_Core_Model_Abstract
14
+ {
15
+ protected function _construct(){
16
+
17
+ $this->_init("favouritelist/favouritelist");
18
+
19
+ }
20
+
21
+
22
+
23
+ }
24
+
app/code/community/Netgo/Favouritelist/Model/Mysql4/Favouritelist.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+
14
+ class Netgo_Favouritelist_Model_Mysql4_Favouritelist extends Mage_Core_Model_Mysql4_Abstract
15
+ {
16
+ protected function _construct()
17
+ {
18
+ $this->_init("favouritelist/favouritelist", "favouritelist_id");
19
+ }
20
+ }
app/code/community/Netgo/Favouritelist/Model/Mysql4/Favouritelist/Collection.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+
14
+ class Netgo_Favouritelist_Model_Mysql4_Favouritelist_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
15
+ {
16
+
17
+ public function _construct(){
18
+ $this->_init("favouritelist/favouritelist");
19
+ }
20
+
21
+
22
+
23
+ }
24
+
app/code/community/Netgo/Favouritelist/controllers/IndexController.php ADDED
@@ -0,0 +1,536 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+ class Netgo_Favouritelist_IndexController extends Mage_Core_Controller_Front_Action{
14
+ public function IndexAction() {
15
+
16
+
17
+ if(!Mage::getSingleton('customer/session')->isLoggedIn()) {
18
+ Mage::getSingleton('customer/session')->setAfterAuthUrl(Mage::helper('core/url')->getCurrentUrl());
19
+ $this->_redirectUrl(Mage::getUrl('customer/account/login/'));
20
+ }
21
+ $this->loadLayout();
22
+ $this->getLayout()->getBlock("head")->setTitle($this->__("My Favouritelist"));
23
+ $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
24
+ $breadcrumbs->addCrumb("home", array(
25
+ "label" => $this->__("Home Page"),
26
+ "title" => $this->__("Home Page"),
27
+ "link" => Mage::getBaseUrl()
28
+ ));
29
+
30
+ $breadcrumbs->addCrumb("favouritelist", array(
31
+ "label" => $this->__("My Favouritelist"),
32
+ "title" => $this->__("My Favouritelist")
33
+ ));
34
+
35
+ $this->renderLayout();
36
+
37
+ }
38
+
39
+ public function addfavouritelistAction() {
40
+
41
+
42
+
43
+ $post_data=$this->getRequest()->getPost();
44
+ $prid= (int)$this->getRequest()->getParam('product');
45
+
46
+
47
+ if(empty($post_data) and $prid >0)
48
+ {
49
+ $post_data['product']=$prid;
50
+ $post_data['qty']=1;
51
+
52
+ }
53
+
54
+ //print_r($post_data);
55
+ // die;
56
+ if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
57
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
58
+ $customerID=$customerData->getId();
59
+
60
+ $productqty=$post_data['qty'];
61
+ $productId=$post_data['product'];
62
+
63
+ $product=Mage::getModel('catalog/product')->load($productId);
64
+ $productType=$product->getTypeID();
65
+
66
+ $super_attribute=$post_data['super_attribute'];
67
+
68
+ $options=$post_data['options'];
69
+ $links=$post_data['links'];
70
+ $bundle_option=$post_data['bundle_option'];
71
+ $super_group=$post_data['super_group'];
72
+ $postdata['customerid']=$customerID;
73
+ $postdata['productid']=$productId;
74
+ $postdata['producttype']=$productType;
75
+ $postdata['productoption']=serialize($options);
76
+
77
+ $postdata['productlink']=serialize($links);
78
+ $postdata['bundle_option']=serialize($bundle_option);
79
+
80
+ $postdata['product_super_attribute']=serialize($super_attribute);
81
+
82
+ $postdata['super_group']=serialize($super_group);
83
+
84
+ $postdata['productqty']=$productqty;
85
+
86
+
87
+ if ($postdata['productid']) {
88
+
89
+ try {
90
+
91
+
92
+
93
+ $checkfv= $this->checkfavouritelist($customerID,$productId,$postdata);
94
+ if(!empty($checkfv))
95
+ {
96
+ $fvid=$checkfv['id'];
97
+ $postdata['productqty']=$checkfv['qty'];
98
+
99
+
100
+ }
101
+ $model = Mage::getModel("favouritelist/favouritelist")
102
+ ->addData($postdata)
103
+ ->setId($fvid)
104
+ ->save();
105
+
106
+ Mage::getSingleton('core/session')->addSuccess($product->getName()." has been added in favourite list");
107
+
108
+ $this->_redirectUrl("favouritelist/index/");
109
+
110
+ $url=Mage::getBaseUrl().'favouritelist/index/';
111
+
112
+ }
113
+ catch (Exception $e) {
114
+ $url=Mage::getBaseUrl();
115
+ return;
116
+ }
117
+
118
+ }
119
+
120
+
121
+
122
+ }else
123
+ {
124
+ $url=Mage::getBaseUrl().'customer/account/login/';
125
+ Mage::getSingleton('customer/session')->setAfterAuthUrl(Mage::helper('core/url')->getCurrentUrl());
126
+ //die;
127
+ }
128
+
129
+
130
+
131
+ $this->_redirectUrl($url);
132
+
133
+
134
+ }
135
+
136
+ public function checkfavouritelist($customerID,$productId,$postdata)
137
+ {
138
+ $favouriteList = Mage::getModel('favouritelist/favouritelist')->getCollection()
139
+ ->addFieldToFilter('customerid',$customerID)
140
+ ->addFieldToFilter('productid',$productId)
141
+ ->addFieldToFilter('producttype',$postdata['producttype'])
142
+ ->addFieldToFilter('productoption',$postdata['productoption'])
143
+ ->addFieldToFilter('productlink',$postdata['productlink'])
144
+ ->addFieldToFilter('bundle_option',$postdata['bundle_option'])
145
+ ->addFieldToFilter('product_super_attribute',$postdata['product_super_attribute'])
146
+ ->addFieldToFilter('super_group',$postdata['super_group'])->getData();
147
+ $data=array();
148
+ if(count($favouriteList)>0)
149
+ {
150
+
151
+ $data['id']=$favouriteList[0]['favouritelist_id'];
152
+ $data['qty']=$favouriteList[0]['productqty']+$postdata['productqty'];
153
+ }
154
+ return $data;
155
+ }
156
+
157
+ public function updatefavouritelistAction() {
158
+
159
+
160
+
161
+ $post_data=$this->getRequest()->getPost();
162
+
163
+ // print_r($post_data);
164
+ // die;
165
+ if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
166
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
167
+ $customerID=$customerData->getId();
168
+
169
+ $productqty=$post_data['qty'];
170
+ $productId=$post_data['product'];
171
+
172
+ $product=Mage::getModel('catalog/product')->load($productId);
173
+ $productType=$product->getTypeID();
174
+
175
+ $super_attribute=$post_data['super_attribute'];
176
+
177
+ $options=$post_data['options'];
178
+ $links=$post_data['links'];
179
+ $bundle_option=$post_data['bundle_option'];
180
+ $super_group=$post_data['super_group'];
181
+ $postdata['customerid']=$customerID;
182
+ $postdata['productid']=$productId;
183
+ $postdata['producttype']=$productType;
184
+ $postdata['productoption']=serialize($options);
185
+
186
+ $postdata['productlink']=serialize($links);
187
+ $postdata['bundle_option']=serialize($bundle_option);
188
+
189
+ $postdata['product_super_attribute']=serialize($super_attribute);
190
+
191
+ $postdata['super_group']=serialize($super_group);
192
+
193
+ $postdata['productqty']=$productqty;
194
+
195
+
196
+ if ($postdata) {
197
+
198
+ try {
199
+
200
+ $model = Mage::getModel("favouritelist/favouritelist")
201
+ ->addData($postdata)
202
+ ->setId($this->getRequest()->getParam("item"))
203
+ ->save();
204
+
205
+ Mage::getSingleton('core/session')->addSuccess($product->getName()." has been updated in favourite list");
206
+
207
+ $this->_redirectUrl("favouritelist/index/");
208
+
209
+ $url=Mage::getBaseUrl().'favouritelist/index/';
210
+
211
+ }
212
+ catch (Exception $e) {
213
+ $url=Mage::getBaseUrl();
214
+ return;
215
+ }
216
+
217
+ }
218
+
219
+
220
+
221
+ }else
222
+ {
223
+ $url=Mage::getBaseUrl().'customer/account/login/';
224
+ Mage::getSingleton('customer/session')->setAfterAuthUrl(Mage::helper('core/url')->getCurrentUrl());
225
+ //die;
226
+ }
227
+
228
+
229
+
230
+ $this->_redirectUrl($url);
231
+
232
+
233
+ }
234
+
235
+
236
+ public function additemAction(){
237
+
238
+ $productData=$this->getRequest()->getParams();
239
+ $itemId=$productData['item'];
240
+ $favouriteData = Mage::getModel('favouritelist/favouritelist')->load($itemId);
241
+
242
+ $options =unserialize($favouriteData->getProductoption());
243
+ $product_super_attribute=unserialize($favouriteData->getProductSuperAttribute());
244
+ $links=unserialize($favouriteData->getProductlink());
245
+
246
+ $bundle_option=unserialize($favouriteData->getBundleOption());
247
+
248
+ $super_group=unserialize($favouriteData->getSuperGroup());
249
+
250
+ $_product = Mage::getModel('catalog/product')->load($favouriteData->getProductid());
251
+ $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($_product->getId());
252
+ $pid = $favouriteData->getProductid();
253
+ $cart = Mage::getSingleton('checkout/cart');
254
+ $cart->init();
255
+
256
+
257
+ $productType=$_product->getTypeID();
258
+ try {
259
+ if($productType=='simple' or $productType=='configurable')
260
+ {
261
+
262
+ $cart->addProduct($_product ,
263
+ array( 'product_id' => $favouriteData->getProductid(),
264
+ 'qty' => $favouriteData->getProductqty(),
265
+ 'super_attribute' => $product_super_attribute,
266
+ 'options' => $options));
267
+
268
+ }elseif($productType=='downloadable')
269
+ {
270
+ $cart->addProduct($_product ,
271
+ array( 'product_id' => $favouriteData->getProductid(),
272
+ 'qty' => $favouriteData->getProductqty(),
273
+ 'links' => $links,
274
+ 'options' => $options));
275
+ }
276
+ elseif($productType=='bundle')
277
+ {
278
+ $cart->addProduct($_product ,
279
+ array( 'product_id' => $favouriteData->getProductid(),
280
+ 'qty' => $favouriteData->getProductqty(),
281
+ 'bundle_option' => $bundle_option,
282
+ 'options' => $options));
283
+ }
284
+ elseif($productType=='virtual')
285
+ {
286
+ $cart->addProduct($_product ,
287
+ array( 'product_id' => $favouriteData->getProductid(),
288
+ 'qty' => $favouriteData->getProductqty(),
289
+ 'options' => $options));
290
+ }elseif($productType=='grouped')
291
+ {
292
+ $cart->addProduct($_product ,
293
+ array( 'product_id' => $favouriteData->getProductid(),
294
+ 'qty' => $favouriteData->getProductqty(),
295
+ 'super_group' => $super_group));
296
+ }
297
+
298
+ $cart->save();
299
+ $url=Mage::getBaseUrl().'checkout/cart/';
300
+ }catch (Exception $e) {
301
+
302
+ Mage::getSingleton('core/session')->addError($e->getMessage());
303
+
304
+ $url=$_product->getUrl();
305
+
306
+
307
+
308
+ }
309
+
310
+
311
+
312
+ $this->_redirectUrl($url);
313
+
314
+
315
+
316
+
317
+
318
+ }
319
+
320
+ public function removeitemAction(){
321
+
322
+ $productData=$this->getRequest()->getParams();
323
+ $itemId=$productData['item'];
324
+
325
+
326
+
327
+ if($itemId > 0 ) {
328
+ try {
329
+ $model = Mage::getModel("favouritelist/favouritelist");
330
+ $model->setId($itemId)->delete();
331
+ Mage::getSingleton('core/session')->addSuccess("Item was successfully deleted");
332
+ $url=Mage::getBaseUrl().'favouritelist/index/';
333
+ }
334
+ catch (Exception $e) {
335
+
336
+ Mage::getSingleton('core/session')->addError($e->getMessage());
337
+ $url=Mage::getBaseUrl().'favouritelist/index/';
338
+
339
+ }
340
+ }else
341
+ {
342
+ Mage::getSingleton('core/session')->addError('Item not found');
343
+ $url=Mage::getBaseUrl().'favouritelist/index/';
344
+ }
345
+
346
+
347
+
348
+ $this->_redirectUrl($url);
349
+
350
+
351
+
352
+ }
353
+
354
+ public function updateAction(){
355
+
356
+ $post_data=$this->getRequest()->getPost();
357
+
358
+ $qty=$post_data['qty'];
359
+
360
+ try {
361
+
362
+ foreach($qty as $fvid=>$prqty)
363
+ {
364
+ $post_data['productqty']=$prqty;
365
+ $model = Mage::getModel("favouritelist/favouritelist")
366
+ ->addData($post_data)
367
+ ->setId($fvid)
368
+ ->save();
369
+ }
370
+ Mage::getSingleton('core/session')->addSuccess('Item was updated');
371
+ }
372
+ catch (Exception $e) {
373
+
374
+ Mage::getSingleton('core/session')->addError($e->getMessage());
375
+
376
+
377
+ }
378
+
379
+
380
+ $url=Mage::getBaseUrl().'favouritelist/index/';
381
+ $this->_redirectUrl($url);
382
+
383
+ }
384
+ public function addallitemAction(){
385
+
386
+ $post_data=$this->getRequest()->getPost();
387
+
388
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
389
+ $customerId=$customerData->getId();
390
+ $favouriteList = Mage::getModel('favouritelist/favouritelist')->getCollection()->addFieldToFilter('customerid',$customerId);
391
+
392
+ foreach($favouriteList as $fvdata)
393
+ {
394
+
395
+
396
+ $itemId=$fvdata->getId();
397
+ $favouriteData = Mage::getModel('favouritelist/favouritelist')->load($itemId);
398
+
399
+ $options =unserialize($favouriteData->getProductoption());
400
+ $product_super_attribute=unserialize($favouriteData->getProductSuperAttribute());
401
+
402
+ $links=unserialize($favouriteData->getProductlink());
403
+
404
+ $bundle_option=unserialize($favouriteData->getBundleOption());
405
+
406
+ $super_group=unserialize($favouriteData->getSuperGroup());
407
+ $_product = Mage::getModel('catalog/product')->load($favouriteData->getProductid());
408
+
409
+ $pid = $favouriteData->getProductid();
410
+ $cart = Mage::getSingleton('checkout/cart');
411
+ $cart->init();
412
+
413
+
414
+ $productType=$_product->getTypeID();
415
+ try {
416
+ if($productType=='simple' or $productType=='configurable')
417
+ {
418
+
419
+ $cart->addProduct($_product ,
420
+ array( 'product_id' => $favouriteData->getProductid(),
421
+ 'qty' => $favouriteData->getProductqty(),
422
+ 'super_attribute' => $product_super_attribute,
423
+ 'options' => $options));
424
+
425
+ }elseif($productType=='downloadable')
426
+ {
427
+ $cart->addProduct($_product ,
428
+ array( 'product_id' => $favouriteData->getProductid(),
429
+ 'qty' => $favouriteData->getProductqty(),
430
+ 'links' => $links,
431
+ 'options' => $options));
432
+ }
433
+ elseif($productType=='bundle')
434
+ {
435
+ $cart->addProduct($_product ,
436
+ array( 'product_id' => $favouriteData->getProductid(),
437
+ 'qty' => $favouriteData->getProductqty(),
438
+ 'bundle_option' => $bundle_option,
439
+ 'options' => $options));
440
+ }
441
+ elseif($productType=='virtual')
442
+ {
443
+ $cart->addProduct($_product ,
444
+ array( 'product_id' => $favouriteData->getProductid(),
445
+ 'qty' => $favouriteData->getProductqty(),
446
+ 'options' => $options));
447
+ }elseif($productType=='grouped')
448
+ {
449
+ $cart->addProduct($_product ,
450
+ array( 'product_id' => $favouriteData->getProductid(),
451
+ 'qty' => $favouriteData->getProductqty(),
452
+ 'super_group' => $super_group));
453
+ }
454
+
455
+ $cart->save();
456
+
457
+ }catch (Exception $e) {
458
+
459
+ Mage::getSingleton('core/session')->addError($e->getMessage());
460
+
461
+ $url=$_product->getUrl();
462
+
463
+
464
+
465
+ }
466
+
467
+
468
+
469
+ }
470
+
471
+ $url=Mage::getBaseUrl().'checkout/cart/';
472
+ $this->_redirectUrl($url);
473
+ }
474
+
475
+ public function configureAction()
476
+ {
477
+
478
+ $id = (int) $this->getRequest()->getParam('flid');
479
+ try {
480
+ /* @var $item Mage_Wishlist_Model_Item */
481
+
482
+
483
+ $favouriteData = Mage::getModel('favouritelist/favouritelist')->load($id);
484
+
485
+ $_product = Mage::getModel('catalog/product')->load($favouriteData->getProductid());
486
+
487
+
488
+ $params = new Varien_Object();
489
+ $params->setCategoryId(false);
490
+ $params->setConfigureMode(true);
491
+
492
+
493
+
494
+ if($favouriteData->getProducttype()=='configurable')
495
+ {
496
+ $bRequest['super_attribute']=unserialize($favouriteData->getProductSuperAttribute());
497
+ }
498
+ if($favouriteData->getProducttype()=='grouped')
499
+ {
500
+ $bRequest['super_group']=unserialize($favouriteData->getSuperGroup());
501
+ }
502
+ if($favouriteData->getProducttype()=='downloadable')
503
+ {
504
+ $bRequest['links']=unserialize($favouriteData->getProductlink());
505
+ }
506
+
507
+ if($favouriteData->getProducttype()=='bundle')
508
+ {
509
+ $bRequest['bundle_option']=unserialize($favouriteData->getBundleOption());
510
+ }
511
+
512
+
513
+
514
+ $bRequest['options']=unserialize($favouriteData->getProductoption());
515
+ $bRequest['qty']=$favouriteData->getProductqty();
516
+ $buyRequest = new Varien_Object($bRequest);
517
+
518
+ $params->setBuyRequest($buyRequest);
519
+
520
+
521
+ Mage::helper('catalog/product_view')->prepareAndRender($_product->getId(), $this, $params);
522
+ } catch (Mage_Core_Exception $e) {
523
+ Mage::getSingleton('core/session')->addError($e->getMessage());
524
+
525
+ } catch (Exception $e) {
526
+ Mage::getSingleton('core/session')->addError($this->__('Cannot configure product'));
527
+ Mage::logException($e);
528
+ $this->_redirect('*');
529
+ return;
530
+ }
531
+ //$this->loadLayout();
532
+
533
+ //$this->renderLayout();
534
+ }
535
+
536
+ }
app/code/community/Netgo/Favouritelist/etc/adminhtml.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** My Favourite List ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Favouritelist
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <acl>
17
+ <resources>
18
+ <admin>
19
+ <children>
20
+ <system>
21
+ <children>
22
+ <config>
23
+ <children>
24
+ <favouritelist translate="title" module="favouritelist">
25
+ <title>Favourite List Section</title>
26
+ <sort_order>0</sort_order>
27
+ </favouritelist>
28
+ </children>
29
+ </config>
30
+ </children>
31
+ </system>
32
+ </children>
33
+ </admin>
34
+ </resources>
35
+ </acl>
36
+ </config>
app/code/community/Netgo/Favouritelist/etc/config.xml ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** My Favourite List ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Favouritelist
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <modules>
17
+ <Netgo_Favouritelist>
18
+ <version>0.1.0</version>
19
+ </Netgo_Favouritelist>
20
+ </modules>
21
+ <frontend>
22
+ <routers>
23
+ <favouritelist>
24
+ <use>standard</use>
25
+ <args>
26
+ <module>Netgo_Favouritelist</module>
27
+ <frontName>favouritelist</frontName>
28
+ </args>
29
+ </favouritelist>
30
+ </routers>
31
+ <layout>
32
+ <updates>
33
+ <favouritelist>
34
+ <file>favouritelist.xml</file>
35
+ </favouritelist>
36
+ </updates>
37
+ </layout>
38
+ </frontend>
39
+ <global>
40
+ <helpers>
41
+ <favouritelist>
42
+ <class>Netgo_Favouritelist_Helper</class>
43
+ </favouritelist>
44
+ </helpers>
45
+ <blocks>
46
+ <favouritelist>
47
+ <class>Netgo_Favouritelist_Block</class>
48
+ </favouritelist>
49
+ </blocks>
50
+ <models>
51
+ <favouritelist>
52
+ <class>Netgo_Favouritelist_Model</class>
53
+ <resourceModel>favouritelist_mysql4</resourceModel>
54
+ </favouritelist>
55
+ <favouritelist_mysql4>
56
+ <class>Netgo_Favouritelist_Model_Mysql4</class>
57
+ <entities>
58
+ <favouritelist>
59
+ <table>favouritelist</table>
60
+ </favouritelist>
61
+ </entities>
62
+ </favouritelist_mysql4>
63
+ </models>
64
+ <resources>
65
+ <favouritelist_setup>
66
+ <setup>
67
+ <module>Netgo_Favouritelist</module>
68
+ </setup>
69
+ <connection>
70
+ <use>core_setup</use>
71
+ </connection>
72
+ </favouritelist_setup>
73
+ <favouritelist_write>
74
+ <connection>
75
+ <use>core_write</use>
76
+ </connection>
77
+ </favouritelist_write>
78
+ <favouritelist_read>
79
+ <connection>
80
+ <use>core_read</use>
81
+ </connection>
82
+ </favouritelist_read>
83
+ </resources>
84
+ </global>
85
+ <admin>
86
+ <routers>
87
+ <favouritelist>
88
+ <use>admin</use>
89
+ <args>
90
+ <module>Netgo_Favouritelist</module>
91
+ <frontName>admin_favouritelist</frontName>
92
+ </args>
93
+ </favouritelist>
94
+ </routers>
95
+ </admin>
96
+ <adminhtml>
97
+ <!--<menu>
98
+ <favouritelist module="favouritelist">
99
+ <title>Favouritelist</title>
100
+ <sort_order>100</sort_order>
101
+ <children>
102
+ <favouritelist module="favouritelist">
103
+ <title>Manage Favouritelist</title>
104
+ <sort_order>0</sort_order>
105
+ <action>admin_favouritelist/adminhtml_favouritelist</action>
106
+ </favouritelist>
107
+ </children>
108
+ </favouritelist>
109
+ </menu>-->
110
+ <acl>
111
+ <resources>
112
+ <all>
113
+ <title>Allow Everything</title>
114
+ </all>
115
+ <admin>
116
+ <children>
117
+ <favouritelist translate="title" module="favouritelist">
118
+ <title>Favouritelist</title>
119
+ <sort_order>1000</sort_order>
120
+ <children>
121
+ <favouritelist translate="title">
122
+ <title>Manage Favouritelist</title>
123
+ <sort_order>0</sort_order>
124
+ </favouritelist>
125
+ </children>
126
+ </favouritelist>
127
+ </children>
128
+ </admin>
129
+ </resources>
130
+ </acl>
131
+ <layout>
132
+ <updates>
133
+ <favouritelist>
134
+ <file>favouritelist.xml</file>
135
+ </favouritelist>
136
+ </updates>
137
+ </layout>
138
+ </adminhtml>
139
+ </config>
app/code/community/Netgo/Favouritelist/etc/system.xml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** My Favourite List ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Favouritelist
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <tabs>
17
+ <netgofavouritelist translate="label" module="favouritelist">
18
+ <label>Netgo Favourite List</label>
19
+ <sort_order>0</sort_order>
20
+ </netgofavouritelist>
21
+ </tabs>
22
+ <sections>
23
+ <favouritelist translate="label" module="favouritelist">
24
+ <label>Favourite List </label>
25
+ <tab>netgofavouritelist</tab>
26
+ <frontend_type>text</frontend_type>
27
+ <sort_order>0</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ <groups>
32
+ <favouritelistsetting translate="label">
33
+ <label>Settings Favourite List</label>
34
+ <frontend_type>text</frontend_type>
35
+ <sort_order>0</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <fields>
40
+ <enable translate="label">
41
+ <label>Enable</label>
42
+ <frontend_type>select</frontend_type>
43
+ <source_model>adminhtml/system_config_source_yesno</source_model>
44
+ <sort_order>0</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ </enable>
49
+ </fields>
50
+ </favouritelistsetting>
51
+ </groups>
52
+ </favouritelist>
53
+ </sections>
54
+ </config>
app/code/community/Netgo/Favouritelist/sql/favouritelist_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+
14
+ $installer = $this;
15
+ $installer->startSetup();
16
+ $sql=<<<SQLTEXT
17
+ create table favouritelist(favouritelist_id int not null auto_increment, customerid int, productid int, producttype varchar(100), productoption text,productlink varchar(500), bundle_option varchar(500), product_super_attribute varchar(500), super_group varchar(500), productqty int, primary key(favouritelist_id));
18
+
19
+ SQLTEXT;
20
+
21
+ $installer->run($sql);
22
+ //demo
23
+ //Mage::getModel('core/url_rewrite')->setId(null);
24
+ //demo
25
+ $installer->endSetup();
26
+
app/design/frontend/base/default/layout/favouritelist.xml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** My Favourite List ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Favouritelist
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <layout version="0.1.0">
16
+ <default>
17
+ <reference name="head" >
18
+ <action method="addCss" ifconfig="favouritelist/favouritelistsetting/enable">
19
+ <stylesheet>favouritelist/favouritelist.css</stylesheet>
20
+ </action>
21
+
22
+ </reference>
23
+ <reference name="top.links">
24
+ <block type="favouritelist/links" name="favouritelist_link" >
25
+ <action method="addFavtLink" ifconfig="favouritelist/favouritelistsetting/enable"></action>
26
+ </block>
27
+
28
+ </reference>
29
+ </default>
30
+ <favouritelist_index_index>
31
+ <update handle="customer_account" />
32
+ <reference name="content">
33
+ <block type="favouritelist/index" name="favouritelist_index" template="favouritelist/index.phtml"/>
34
+ </reference>
35
+ </favouritelist_index_index>
36
+ <customer_account>
37
+ <reference name="customer_account_navigation">
38
+ <action method="addLink" translate="label" module="favouritelist" ifconfig="favouritelist/favouritelistsetting/enable"><name>favouritelist</name><path>favouritelist/</path><label>My Favourite List</label></action>
39
+ </reference>
40
+ </customer_account>
41
+
42
+ <catalog_product_view>
43
+ <reference name="product.info.addto">
44
+ <action method="setTemplate" ifconfig="favouritelist/favouritelistsetting/enable">
45
+ <template>favouritelist/addto.phtml</template>
46
+ </action>
47
+ </reference>
48
+ </catalog_product_view>
49
+ <favouritelist_index_configure translate="label">
50
+ <label>Configure favouritelist Item</label>
51
+ <update handle="catalog_product_view" />
52
+ <reference name="product.info.options.wrapper.bottom">
53
+ <action method="unsetChild"><name>product.info.addto</name></action>
54
+ <action method="append"><block>product.info.addto</block></action>
55
+ </reference>
56
+
57
+ </favouritelist_index_configure>
58
+
59
+ </layout>
60
+
app/design/frontend/base/default/template/favouritelist/addto.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+ ?>
14
+
15
+ <?php $_product = $this->getProduct(); ?>
16
+ <?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>
17
+
18
+ <ul class="add-to-links">
19
+
20
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
21
+ <li><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
22
+ <?php endif; ?>
23
+ <?php
24
+ $_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
25
+ ?>
26
+ <?php if($_compareUrl) : ?>
27
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
28
+ <?php endif; ?>
29
+
30
+ <?php
31
+
32
+ $favouriteUrl = Mage::helper('favouritelist')->getUrl($_product);
33
+ $fid = (int) $this->getRequest()->getParam('flid');
34
+ ?>
35
+
36
+ <li>
37
+ <span class="separator">|</span>
38
+ <?php
39
+ if($fid > 0){
40
+
41
+ ?>
42
+ <a href="<?php echo $favouriteUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-favourite"><?php echo $this->__('Update Favourite List') ?></a>
43
+ <?php
44
+ }else
45
+ {
46
+ ?>
47
+ <a href="<?php echo $favouriteUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-favourite"><?php echo $this->__('Favourite List') ?></a>
48
+ <?php
49
+ }
50
+ ?>
51
+
52
+ </li>
53
+
54
+ </ul>
app/design/frontend/base/default/template/favouritelist/index.phtml ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** My Favourite List ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_Favouritelist
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+
14
+ $favouritelist = $this->getFavouritelist();
15
+
16
+ ?>
17
+
18
+ <div class="my-account">
19
+ <div class="my-favouritelist">
20
+ <div class="page-title title-buttons">
21
+ <h1>My Favouritelist</h1>
22
+ </div>
23
+ <?php
24
+
25
+ if($favouritelist->getSize())
26
+ {
27
+ ?>
28
+ <form method="post" action="<?php echo Mage::getBaseUrl(); ?>favouritelist/index/update" id="favouritelist-view-form">
29
+ <div class="fieldset">
30
+ <table id="favouritelist-table" class="clean-table linearize-table">
31
+ <thead>
32
+ <tr class="first last">
33
+ <th class="customer-favouritelist-item-image"></th>
34
+ <th class="customer-favouritelist-item-info"></th>
35
+ <th class="customer-favouritelist-item-quantity">Qty</th>
36
+ <th class="customer-favouritelist-item-price">Price</th>
37
+ <th class="customer-favouritelist-item-cart"></th>
38
+ <th class="customer-favouritelist-item-remove"></th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+
43
+ <?php
44
+
45
+ foreach($favouritelist as $fdata)
46
+ {
47
+
48
+
49
+
50
+ $_product = Mage::getModel('catalog/product')->load($fdata->getProductid());
51
+
52
+
53
+ ?>
54
+ <tr id="item_<?php echo $fdata->getId(); ?>" class="first odd">
55
+ <td class="favouritelist-cell0 customer-favouritelist-item-image">
56
+ <a title="Simple Product01" href="<?php echo $_product->getProductUrl(); ?>" class="product-image">
57
+
58
+ <img width="113" height="113" alt="Simple Product01" src="<?php echo Mage::helper('catalog/image')->init($_product , 'thumbnail');?>">
59
+ </a>
60
+ </td>
61
+ <td class="favouritelist-cell1 customer-favouritelist-item-info">
62
+ <h3 class="product-name">
63
+ <a title="Simple Product01" href="<?php echo $_product->getProductUrl();?>">
64
+ <?php echo $_product->getName();?></a>
65
+
66
+ </h3>
67
+
68
+ <div class="favouritelist-sku">
69
+ <span><?php echo $_product->getSku();?></span>
70
+ </div>
71
+
72
+
73
+ </td>
74
+
75
+ <td data-rwd-label="Qty" class="favouritelist-cell2 customer-favouritelist-item-quantity">
76
+ <div class="cart-cell">
77
+ <div class="add-to-cart-alt">
78
+ <?php if($fdata->getProducttype()!='grouped'){ ?>
79
+ <input type="text" value="<?php echo $fdata->getProductqty() ?>" name="qty[<?php echo $fdata->getId(); ?>]" class="input-text qty validate-not-negative-number" pattern="\d*">
80
+ <?php
81
+ }
82
+ ?>
83
+ </div>
84
+ </div>
85
+ </td>
86
+ <td data-rwd-label="Price" class="favouritelist-cell3 customer-favouritelist-item-price">
87
+ <div class="cart-cell">
88
+ <div class="price-box">
89
+ <span id="product-price-1" class="regular-price">
90
+ <span class="price">
91
+ <?php
92
+
93
+ if($fdata->getProducttype()=='grouped'){
94
+ $grpprice=0;
95
+ $super_group=unserialize($fdata->getSuperGroup());
96
+
97
+ foreach($super_group as $pid=>$pqty)
98
+ {
99
+
100
+
101
+ if($pqty>0)
102
+ {
103
+ $prduct = Mage::getModel('catalog/product')->load($pid);
104
+
105
+ $grpprice=$grpprice+($prduct->getPrice()*$pqty);
106
+ }
107
+
108
+ }
109
+ echo Mage::helper('core')->currency($grpprice, true, false);
110
+ }else
111
+ {
112
+ echo Mage::helper('core')->currency($_product->getPrice(), true, false);
113
+ }
114
+ ?>
115
+
116
+ </span>
117
+ </span>
118
+
119
+ </div>
120
+
121
+ </div>
122
+ </td>
123
+ <td class="favouritelist-cell4 customer-favouritelist-item-cart">
124
+ <div class="cart-cell">
125
+ <button class="button btn-cart" onclick="setLocation('<?php echo Mage::getBaseUrl(); ?>favouritelist/index/additem/item/<?php echo $fdata->getId();?>');" title="Add to Cart" type="button">
126
+ <span><span>Add to Cart</span></span>
127
+ </button>
128
+ </div>
129
+ <p>
130
+ <a href="<?php echo Mage::getBaseUrl() ?>favouritelist/index/configure/flid/<?php echo $fdata->getId();?>/" class="link-edit button button-secondary">Edit</a>
131
+ </p>
132
+
133
+
134
+ </td>
135
+ <td class="favouritelist-cell5 customer-favouritelist-item-remove last">
136
+ <a class="btn-remove btn-remove2" title="Remove Item" onclick="return confirmRemoveFavouritelist();" href="<?php echo Mage::getBaseUrl(); ?>favouritelist/index/removeitem/item/<?php echo $fdata->getId();?>">Remove item</a>
137
+ </td>
138
+ </tr>
139
+ <?php
140
+
141
+
142
+ }
143
+
144
+ ?>
145
+ </tbody>
146
+ </table>
147
+ <script type="text/javascript">decorateTable('favouritelist-table')</script>
148
+ <div class="buttons-set buttons-set2">
149
+
150
+ <button class="button btn-add" onclick="setLocation('<?php echo Mage::getBaseUrl(); ?>favouritelist/index/addallitem'); return false;" title="Add All to Cart" type="button"><span><span>Add All to Cart</span></span></button>
151
+
152
+ <button class="button btn-update button-secondary" title="Update favouritelist" name="do" type="submit"><span><span>Update Favouritelist</span></span></button>
153
+ </div>
154
+ </div>
155
+ </form>
156
+
157
+ <?php
158
+
159
+ }else
160
+ {
161
+ ?>
162
+ <div class="fieldset">
163
+ <p class="favouritelist-empty">You have no items in your favouritelist.</p>
164
+
165
+ </div>
166
+ <?php
167
+ }
168
+ ?>
169
+ </div>
170
+
171
+
172
+ </div>
173
+ <script>
174
+
175
+ function confirmRemoveFavouritelist() {
176
+ return confirm('Are you sure you want to remove this product from your favouritelist?');
177
+ }
178
+
179
+ </script>
app/etc/modules/Netgo_Favouritelist.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** My Favourite List ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_Favouritelist
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <modules>
17
+ <Netgo_Favouritelist>
18
+ <active>true</active>
19
+ <codePool>community</codePool>
20
+ <version>1.0.0</version>
21
+ </Netgo_Favouritelist>
22
+ </modules>
23
+ </config>
package.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Netgo_Favouritelist</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension helps customers to add the favourite product in their account dashboard.</summary>
10
+ <description>This extension is developed with the purpose of adding any product to the account of favorites. Any type of product can be added to favorites. For adding any product, you just need to go to any product and click on ADD TO FAVORITES which will add the product to FAVORITE LIST. You can checkout that product. Even if you will checkout the product, then also favorite list account will have that product and you can always buy your favorite products.&#xD;
11
+ &#xD;
12
+ Features:&#xD;
13
+ a. Add products to FAVORITES&#xD;
14
+ b. FAVORITE LIST is always maintained even ADD TO CART is done.&#xD;
15
+ c. Easy to track your favorite products&#xD;
16
+ d. Maintains record of all favorite products. &#xD;
17
+ e. Manageable for all types of products in Magento.</description>
18
+ <notes>First Preview Release</notes>
19
+ <authors><author><name>NetGo</name><user>NetGo</user><email>netattingomails@gmail.com</email></author></authors>
20
+ <date>2015-08-18</date>
21
+ <time>10:42:32</time>
22
+ <contents><target name="magecommunity"><dir name="Netgo"><dir name="Favouritelist"><dir name="Block"><file name="Index.php" hash="7635ee93805906e12c736c56b765cd97"/><file name="Links.php" hash="abe88b15b6cde8df37292a0841460588"/></dir><dir name="Helper"><file name="Data.php" hash="33d0f05538c5fc835784b82de49c1c59"/></dir><dir name="Model"><file name="Favouritelist.php" hash="c5956af05f11506f575f0c41cb480d95"/><dir name="Mysql4"><dir name="Favouritelist"><file name="Collection.php" hash="ebc091ae5a3aa2f73ef0ea386ca7df3b"/></dir><file name="Favouritelist.php" hash="a20748942ec8473ace73283fabc1c71c"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="326b6165fe14d5b7e825285b294cb1ae"/></dir><dir name="etc"><file name="adminhtml.xml" hash="629ff5074262ff9a1bb3472281aaebfa"/><file name="config.xml" hash="e660d5114c485d94febf42055c628afe"/><file name="system.xml" hash="19e2dfd2f79320f5dc70cbc8197e9528"/></dir><dir name="sql"><dir name="favouritelist_setup"><file name="mysql4-install-0.1.0.php" hash="d44f480bb1bbf35e7d887138edaf318d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="favouritelist.xml" hash="631f06841bcb3e60ceb13498fb34a3fd"/></dir><dir name="template"><dir name="favouritelist"><file name="addto.phtml" hash="d83d0b92ed438f215e25467c52f4fdaf"/><file name="index.phtml" hash="b325e16cbb92767708d7f52cceda558d"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="."><file name="User_Manual.pdf" hash="89b2127a24d5a663157dd13a52b56f1a"/><file name="readme.txt" hash="404543a25e296a10c04438b49b943d51"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="favouritelist"><file name="favouritelist.css" hash="ebf268189c74b2dfb9b5c8c134d222cb"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Netgo_Favouritelist.xml" hash="4f6b27876a9d5cdef69da939811c1f63"/></dir></target></contents>
23
+ <compatible/>
24
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
25
+ </package>
readme.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************************
2
+ Note: Use this code in list.phtml. If you want to show favourite list link on the list page.
3
+ /******************************************************************************************
4
+
5
+ <?php if (Mage::helper('favouritelist')->isAllow()) : ?>
6
+
7
+ <a title="<?php echo $this->__('Add to FavouriteList') ?>" href="<?php echo Mage::helper('favouritelist')->getUrl($_product) ?>" class="link-favourite">
8
+ <?php echo $this->__('Add to Favourite List') ?>
9
+ </a>
10
+
11
+ <?php endif; ?>
skin/frontend/base/default/favouritelist/favouritelist.css ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .customer-account #favouritelist-view-form table {
2
+ width: 100%;
3
+ }
4
+ .customer-account #favouritelist-view-form table .customer-favouritelist-item-info {
5
+ padding:0 20px;
6
+ vertical-align: top;
7
+ }
8
+
9
+ .customer-account td.customer-favouritelist-item-image {
10
+ width: 113px;
11
+ }
12
+ .customer-favouritelist-item-cart .link-edit.button.button-secondary {
13
+ margin-top: 10px;
14
+ width: 54%;
15
+ }