Version Notes
Wishlist Notification
Download this release
Release Info
Developer | Hitesh Agrawal |
Extension | Kvh_Wishlistnotification |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Kvh/Wishlistnotification/Helper/Data.php +51 -0
- app/code/local/Kvh/Wishlistnotification/Model/Observer.php +24 -0
- app/code/local/Kvh/Wishlistnotification/etc/config.xml +66 -0
- app/code/local/Kvh/Wishlistnotification/etc/system.xml +51 -0
- app/design/frontend/default/default/template/wishlistnotification/default.phtml +56 -0
- app/etc/modules/Kvh_Wishlistnotification.xml +35 -0
- app/locale/en_US/template/email/wishlistnotification.html +61 -0
- package.xml +18 -0
app/code/local/Kvh/Wishlistnotification/Helper/Data.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Kvh_Wishlistnotification_Helper_Data extends Mage_Core_Helper_Data
|
3 |
+
{
|
4 |
+
|
5 |
+
public function sendMail($productId)
|
6 |
+
{
|
7 |
+
$email=Mage::getStoreConfig('wishlist/notification/adminemails');
|
8 |
+
$this->sendEmail(array(
|
9 |
+
'email' => $email,
|
10 |
+
'product_id'=>$productId
|
11 |
+
));
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
public function sendEmail($data)
|
18 |
+
{
|
19 |
+
if (is_array($data)) {
|
20 |
+
$data = new Varien_Object($data);
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
25 |
+
|
26 |
+
|
27 |
+
$template = Mage::getStoreConfig('wishlist/notification/email_template');
|
28 |
+
|
29 |
+
$identity = Mage::getStoreConfig('wishlist/email/email_identity');
|
30 |
+
|
31 |
+
|
32 |
+
$product = Mage::getModel('catalog/product')->load($data->getProductId());
|
33 |
+
|
34 |
+
$date=date("M d, Y");
|
35 |
+
|
36 |
+
$wishlistblock = Mage::app()->getLayout()->createBlock('core/template')->setData('product',$product)->setTemplate('wishlistnotification/default.phtml')->toHtml();
|
37 |
+
|
38 |
+
|
39 |
+
Mage::getModel('core/email_template')
|
40 |
+
->addBcc($data->getEmail())
|
41 |
+
->sendTransactional($template, $identity, $data->getEmail(),"", array(
|
42 |
+
'customer' => $customer,
|
43 |
+
'date' =>$date,
|
44 |
+
'items' => $wishlistblock,
|
45 |
+
));
|
46 |
+
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
}
|
app/code/local/Kvh/Wishlistnotification/Model/Observer.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Kvh_Wishlistnotification_Model_Observer
|
3 |
+
{
|
4 |
+
|
5 |
+
public function sendNotification(Varien_Event_Observer $observer)
|
6 |
+
{
|
7 |
+
|
8 |
+
|
9 |
+
$emailEnabled = Mage::getStoreConfig('wishlist/notification/notifyenable');
|
10 |
+
|
11 |
+
if(!$emailEnabled)
|
12 |
+
return;
|
13 |
+
|
14 |
+
$productId = Mage::app()->getRequest()->getParam('product');
|
15 |
+
|
16 |
+
if (!$productId) {
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
Mage::helper('wishlistnotification')->sendMail($productId);
|
21 |
+
|
22 |
+
}
|
23 |
+
}
|
24 |
+
?>
|
app/code/local/Kvh/Wishlistnotification/etc/config.xml
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Kvh_Wishlistnotification>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Kvh_Wishlistnotification>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<Kvh_Wishlistnotification>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Kvh_Wishlistnotification</module>
|
14 |
+
<frontName>Wishlistnotification</frontName>
|
15 |
+
</args>
|
16 |
+
</Kvh_Wishlistnotification>
|
17 |
+
</routers>
|
18 |
+
|
19 |
+
<events>
|
20 |
+
<wishlist_add_product>
|
21 |
+
<observers>
|
22 |
+
<send_notify>
|
23 |
+
<class>Wishlistnotification/observer</class>
|
24 |
+
<method>sendNotification</method>
|
25 |
+
</send_notify>
|
26 |
+
</observers>
|
27 |
+
</wishlist_add_product>
|
28 |
+
|
29 |
+
</events>
|
30 |
+
|
31 |
+
</frontend>
|
32 |
+
<global>
|
33 |
+
<models>
|
34 |
+
<Wishlistnotification>
|
35 |
+
<class>Kvh_Wishlistnotification_Model</class>
|
36 |
+
</Wishlistnotification>
|
37 |
+
</models>
|
38 |
+
|
39 |
+
<helpers>
|
40 |
+
<wishlistnotification><class>Kvh_Wishlistnotification_Helper</class></wishlistnotification>
|
41 |
+
|
42 |
+
</helpers>
|
43 |
+
|
44 |
+
<template>
|
45 |
+
<email>
|
46 |
+
<wishlist_notification_email_template module="Wishlistnotification">
|
47 |
+
<label>Wishlist Notify</label>
|
48 |
+
<file>wishlistnotification.html</file>
|
49 |
+
<type>html</type>
|
50 |
+
</wishlist_notification_email_template>
|
51 |
+
</email>
|
52 |
+
</template>
|
53 |
+
|
54 |
+
</global>
|
55 |
+
|
56 |
+
<default>
|
57 |
+
<wishlist>
|
58 |
+
<notification>
|
59 |
+
<notifyenable>1</notifyenable>
|
60 |
+
<adminemails>kvhsolutions@gmail.com</adminemails>
|
61 |
+
<email_template>wishlist_notification_email_template</email_template>
|
62 |
+
</notification>
|
63 |
+
</wishlist>
|
64 |
+
</default>
|
65 |
+
|
66 |
+
</config>
|
app/code/local/Kvh/Wishlistnotification/etc/system.xml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<sections>
|
3 |
+
<wishlist>
|
4 |
+
<groups>
|
5 |
+
<notification translate="label">
|
6 |
+
<label>Wishlist Notification</label>
|
7 |
+
<frontend_type>text</frontend_type>
|
8 |
+
<sort_order>50</sort_order>
|
9 |
+
<show_in_default>1</show_in_default>
|
10 |
+
<show_in_website>1</show_in_website>
|
11 |
+
<show_in_store>1</show_in_store>
|
12 |
+
<fields>
|
13 |
+
<notifyenable translate="label">
|
14 |
+
<label>Enabled</label>
|
15 |
+
<frontend_type>select</frontend_type>
|
16 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
17 |
+
<sort_order>1</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
</notifyenable>
|
22 |
+
<adminemails translate="label">
|
23 |
+
<label>Email
|
24 |
+
</label>
|
25 |
+
<frontend_type>text</frontend_type>
|
26 |
+
<sort_order>50</sort_order>
|
27 |
+
<show_in_default>1</show_in_default>
|
28 |
+
<show_in_website>1</show_in_website>
|
29 |
+
<show_in_store>1</show_in_store>
|
30 |
+
</adminemails>
|
31 |
+
<email_template translate="label">
|
32 |
+
<label>Email Template</label>
|
33 |
+
<frontend_type>select</frontend_type>
|
34 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
35 |
+
<sort_order>1</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 |
+
</email_template>
|
40 |
+
|
41 |
+
</fields>
|
42 |
+
</notification>
|
43 |
+
</groups>
|
44 |
+
|
45 |
+
</wishlist>
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
</sections>
|
51 |
+
</config>
|
app/design/frontend/default/default/template/wishlistnotification/default.phtml
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
$_item = $this->getProduct();
|
29 |
+
?>
|
30 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
|
31 |
+
<thead>
|
32 |
+
<tr>
|
33 |
+
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"> </th>
|
34 |
+
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Item') ?></th>
|
35 |
+
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
|
36 |
+
<th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Price') ?></th>
|
37 |
+
<th align="right" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Special Price') ?></th>
|
38 |
+
</tr>
|
39 |
+
</thead>
|
40 |
+
<tbody>
|
41 |
+
<tr>
|
42 |
+
<td> <img src="<?php echo (string)Mage::helper('catalog/image')->init($_item, 'image')->resize(75) ?>" width="75" height="75" /> </td>
|
43 |
+
<td>
|
44 |
+
<?php echo $this->htmlEscape($_item->getName()); ?>
|
45 |
+
</td>
|
46 |
+
<td>
|
47 |
+
<?php echo $this->htmlEscape($_item->getSku()); ?>
|
48 |
+
</td>
|
49 |
+
<td>
|
50 |
+
<?php echo $this->htmlEscape($_item->getPrice()); ?>
|
51 |
+
</td>
|
52 |
+
<td>
|
53 |
+
<?php echo $this->htmlEscape($_item->getSpecialPrice()); ?>
|
54 |
+
</td>
|
55 |
+
</tr></tbody>
|
56 |
+
</table>
|
app/etc/modules/Kvh_Wishlistnotification.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category Mage
|
23 |
+
* @package Mage_Weee
|
24 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<config>
|
29 |
+
<modules>
|
30 |
+
<Kvh_Wishlistnotification>
|
31 |
+
<active>true</active>
|
32 |
+
<codePool>local</codePool>
|
33 |
+
</Kvh_Wishlistnotification>
|
34 |
+
</modules>
|
35 |
+
</config>
|
app/locale/en_US/template/email/wishlistnotification.html
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Wishlist Notification of Customer {{var customer.name}} @-->
|
2 |
+
<!--@vars
|
3 |
+
{"store url=\"\"":"Store Url",
|
4 |
+
"var logo_url":"Email Logo Image Url",
|
5 |
+
"var logo_alt":"Email Logo Image Alt",
|
6 |
+
"var store.getFrontendName()":"Store Name"}
|
7 |
+
@-->
|
8 |
+
<!--@styles
|
9 |
+
body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
|
10 |
+
@-->
|
11 |
+
|
12 |
+
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
13 |
+
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
14 |
+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
15 |
+
<tr>
|
16 |
+
<td align="center" valign="top" style="padding:20px 0 20px 0">
|
17 |
+
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
18 |
+
<!-- [ header starts here] -->
|
19 |
+
<tr>
|
20 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
21 |
+
</tr>
|
22 |
+
<!-- [ middle starts here] -->
|
23 |
+
<tr>
|
24 |
+
<td valign="top">
|
25 |
+
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Wishlist Notification <small>(placed on {{var date}})</small></h1>
|
26 |
+
</td>
|
27 |
+
|
28 |
+
</tr>
|
29 |
+
|
30 |
+
<tr>
|
31 |
+
<td>
|
32 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650">
|
33 |
+
<thead>
|
34 |
+
<tr>
|
35 |
+
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Customer Information:</th>
|
36 |
+
|
37 |
+
</tr>
|
38 |
+
</thead>
|
39 |
+
<tbody>
|
40 |
+
<tr>
|
41 |
+
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
|
42 |
+
{{var customer.name}}<br>
|
43 |
+
{{var customer.email}}
|
44 |
+
</td>
|
45 |
+
|
46 |
+
</tr>
|
47 |
+
</tbody>
|
48 |
+
</table>
|
49 |
+
{{var items}}
|
50 |
+
|
51 |
+
</td>
|
52 |
+
</tr>
|
53 |
+
<tr>
|
54 |
+
<td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
|
55 |
+
</tr>
|
56 |
+
</table>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
</table>
|
60 |
+
</div>
|
61 |
+
</body>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Kvh_Wishlistnotification</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Wishlist Notification</summary>
|
10 |
+
<description>Wishlist Notification</description>
|
11 |
+
<notes>Wishlist Notification</notes>
|
12 |
+
<authors><author><name>Hitesh Agrawal</name><user>hiteshmca111</user><email>hiteshagrawal84@gmail.com</email></author></authors>
|
13 |
+
<date>2014-04-16</date>
|
14 |
+
<time>15:14:13</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Kvh"><dir name="Wishlistnotification"><dir name="Helper"><file name="Data.php" hash="63eb02cee7c6d643da3a2a1e6ad4751f"/></dir><dir name="Model"><file name="Observer.php" hash="18aa9b170ac36f326a211f2b55e8a590"/></dir><dir name="etc"><file name="config.xml" hash="e50b46b5fae3cbeb2a84b0381b6b3046"/><file name="system.xml" hash="e5fc142cc87015b5fed8b43ade5bf284"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kvh_Wishlistnotification.xml" hash="5ba5993daefa317ed21847fcbe7fea03"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="wishlistnotification.html" hash="17206cd6093d25fda809110b4493d096"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="wishlistnotification"><file name="default.phtml" hash="762b88af1440bcb013ded173f7784e49"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|