Version Notes
- Can be placed anywhere in the site: left column, right column, cms pages, static blocks etc.
- Can be used in CMS pages / Static Blockas as: {{block type="tellafriend/tellafriend" name="tellafriend-block" template="tellafriend/tellafriend.phtml}}
- Tell a friend email template can be customized easily.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Mp_Tell_A_Friend |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/MagePsycho/Tellafriend/Block/System/Config/Info.php +33 -0
- app/code/local/MagePsycho/Tellafriend/Block/Tellafriend.php +27 -0
- app/code/local/MagePsycho/Tellafriend/Helper/Data.php +26 -0
- app/code/local/MagePsycho/Tellafriend/Model/Session.php +34 -0
- app/code/local/MagePsycho/Tellafriend/Model/Tellafriend.php +12 -0
- app/code/local/MagePsycho/Tellafriend/controllers/IndexController.php +83 -0
- app/code/local/MagePsycho/Tellafriend/etc/config.xml +96 -0
- app/code/local/MagePsycho/Tellafriend/etc/system.xml +97 -0
- app/design/frontend/default/default/layout/tellafriend.xml +11 -0
- app/etc/modules/MagePsycho_Tellafriend.xml +18 -0
- app/locale/en_US/template/email/tellafriend/tellafriend.html +32 -0
- package.xml +20 -0
app/code/local/MagePsycho/Tellafriend/Block/System/Config/Info.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category MagePsycho
|
4 |
+
* @package MagePsycho_Tellafriend
|
5 |
+
* @author magepsycho@gmail.com
|
6 |
+
* @website http://www.magepsycho.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
class MagePsycho_Tellafriend_Block_System_Config_Info
|
10 |
+
extends Mage_Adminhtml_Block_Abstract
|
11 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
12 |
+
{
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Render fieldset html
|
16 |
+
*
|
17 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
21 |
+
{
|
22 |
+
$html = '<div style="background:url(\'http://www.magepsycho.com/_logo.png\') no-repeat scroll 15px center #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 200px;">
|
23 |
+
<h4>About MagePsycho</h4>
|
24 |
+
<p>A Zend Certified Web Developer / Freelancer with specialization in CMS + E-Commerce Solutions.<br />
|
25 |
+
View more extensions @ <a href="http://www.magentocommerce.com/magento-connect/developer/MagePsycho" target="_blank">MagentoConnect</a><br />
|
26 |
+
<a href="http://www.magepsycho.com/contacts" target="_blank">Request a Quote / Contact Us</a><br />
|
27 |
+
Skype me @ magentopycho<br />
|
28 |
+
Visit my website: <a href="http://www.magepsycho.com" target="_blank">www.magespycho.com</a></p>
|
29 |
+
</div>';
|
30 |
+
|
31 |
+
return $html;
|
32 |
+
}
|
33 |
+
}
|
app/code/local/MagePsycho/Tellafriend/Block/Tellafriend.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category MagePsycho
|
4 |
+
* @package MagePsycho_Tellafriend
|
5 |
+
* @author magepsycho@gmail.com
|
6 |
+
* @website http://www.magepsycho.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
class MagePsycho_Tellafriend_Block_Tellafriend extends Mage_Core_Block_Template
|
10 |
+
{
|
11 |
+
public function getSuccessMessage()
|
12 |
+
{
|
13 |
+
$message = Mage::getSingleton('tellafriend/session')->getSuccess();
|
14 |
+
return $message;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function getErrorMessage()
|
18 |
+
{
|
19 |
+
$message = Mage::getSingleton('tellafriend/session')->getError();
|
20 |
+
return $message;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getFormActionUrl()
|
24 |
+
{
|
25 |
+
return $this->getUrl('tellafriend/index/post', array('_secure' => true));
|
26 |
+
}
|
27 |
+
}
|
app/code/local/MagePsycho/Tellafriend/Helper/Data.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category MagePsycho
|
4 |
+
* @package MagePsycho_Tellafriend
|
5 |
+
* @author magepsycho@gmail.com
|
6 |
+
* @website http://www.magepsycho.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
class MagePsycho_Tellafriend_Helper_Data extends Mage_Core_Helper_Abstract
|
10 |
+
{
|
11 |
+
public function getConfig($field, $default = null){
|
12 |
+
$value = Mage::getStoreConfig('tellafriend/option/'.$field);
|
13 |
+
if(!isset($value) or trim($value) == ''){
|
14 |
+
return $default;
|
15 |
+
}else{
|
16 |
+
return $value;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
public function log($data){
|
21 |
+
if(is_array($data) || is_object($data)){
|
22 |
+
$data = print_r($data, true);
|
23 |
+
}
|
24 |
+
Mage::log($data, null, 'tellafriend.log');
|
25 |
+
}
|
26 |
+
}
|
app/code/local/MagePsycho/Tellafriend/Model/Session.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class MagePsycho_Tellafriend_Model_Session extends Mage_Core_Model_Session_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->init('tellafriend');
|
7 |
+
}
|
8 |
+
|
9 |
+
public function addError($message)
|
10 |
+
{
|
11 |
+
$this->setErrorMessage($message);
|
12 |
+
return $this;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function addSuccess($message)
|
16 |
+
{
|
17 |
+
$this->setSuccessMessage($message);
|
18 |
+
return $this;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getError()
|
22 |
+
{
|
23 |
+
$message = $this->getErrorMessage();
|
24 |
+
$this->unsErrorMessage();
|
25 |
+
return $message;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getSuccess()
|
29 |
+
{
|
30 |
+
$message = $this->getSuccessMessage();
|
31 |
+
$this->unsSuccessMessage();
|
32 |
+
return $message;
|
33 |
+
}
|
34 |
+
}
|
app/code/local/MagePsycho/Tellafriend/Model/Tellafriend.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category MagePsycho
|
4 |
+
* @package MagePsycho_Tellafriend
|
5 |
+
* @author magepsycho@gmail.com
|
6 |
+
* @website http://www.magepsycho.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
class MagePsycho_Tellafriend_Model_Tellafriend extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
}
|
app/code/local/MagePsycho/Tellafriend/controllers/IndexController.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category MagePsycho
|
4 |
+
* @package MagePsycho_Tellafriend
|
5 |
+
* @author magepsycho@gmail.com
|
6 |
+
* @website http://www.magepsycho.com
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
class MagePsycho_Tellafriend_IndexController extends Mage_Core_Controller_Front_Action
|
10 |
+
{
|
11 |
+
const XML_PATH_EMAIL_SENDER = 'tellafriend/email/email_sender';
|
12 |
+
const XML_PATH_EMAIL_TEMPLATE = 'tellafriend/email/email_template';
|
13 |
+
|
14 |
+
public function indexAction(){
|
15 |
+
#$this->loadLayout();
|
16 |
+
#$this->_initLayoutMessages('customer/session');
|
17 |
+
#$this->_initLayoutMessages('catalog/session');
|
18 |
+
#$this->renderLayout();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function postAction()
|
22 |
+
{
|
23 |
+
$session = Mage::getSingleton('core/session');
|
24 |
+
$post = $this->getRequest()->getPost();
|
25 |
+
if ( $post ) {
|
26 |
+
$translate = Mage::getSingleton('core/translate');
|
27 |
+
/* @var $translate Mage_Core_Model_Translate */
|
28 |
+
$translate->setTranslateInline(false);
|
29 |
+
try {
|
30 |
+
$postObject = new Varien_Object();
|
31 |
+
$postObject->setData($post);
|
32 |
+
$postObject->setData('url', Mage::getUrl());
|
33 |
+
|
34 |
+
$error = false;
|
35 |
+
|
36 |
+
if (!Zend_Validate::is(trim($post['name']) , 'NotEmpty')) {
|
37 |
+
$error = true;
|
38 |
+
}
|
39 |
+
|
40 |
+
if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
|
41 |
+
$error = true;
|
42 |
+
}
|
43 |
+
|
44 |
+
if ($error) {
|
45 |
+
throw new Exception();
|
46 |
+
}
|
47 |
+
$mailTemplate = Mage::getModel('core/email_template');
|
48 |
+
/* @var $mailTemplate Mage_Core_Model_Email_Template */
|
49 |
+
|
50 |
+
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
|
51 |
+
->setReplyTo($replyTo)
|
52 |
+
->sendTransactional(
|
53 |
+
Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
|
54 |
+
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
|
55 |
+
$post['email'],
|
56 |
+
null,
|
57 |
+
array('data' => $postObject)
|
58 |
+
);
|
59 |
+
|
60 |
+
if (!$mailTemplate->getSentSuccess()) {
|
61 |
+
throw new Exception();
|
62 |
+
}
|
63 |
+
|
64 |
+
$translate->setTranslateInline(true);
|
65 |
+
|
66 |
+
$session->addSuccess(Mage::helper('tellafriend')->__('Thank you for telling your friend about us.'));
|
67 |
+
$this->_redirectReferer();
|
68 |
+
|
69 |
+
return;
|
70 |
+
} catch (Exception $e) {
|
71 |
+
$translate->setTranslateInline(true);
|
72 |
+
|
73 |
+
$session->addError(Mage::helper('tellafriend')->__('There was some error processing your request.'));
|
74 |
+
$this->_redirectReferer();
|
75 |
+
return;
|
76 |
+
}
|
77 |
+
|
78 |
+
} else {
|
79 |
+
$this->_redirectReferer();
|
80 |
+
}
|
81 |
+
|
82 |
+
}
|
83 |
+
}
|
app/code/local/MagePsycho/Tellafriend/etc/config.xml
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category MagePsycho
|
5 |
+
* @package MagePsycho_Tellafriend
|
6 |
+
* @author magepsycho@gmail.com
|
7 |
+
* @website http://www.magepsycho.com
|
8 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<MagePsycho_Tellafriend>
|
14 |
+
<version>0.1.0</version>
|
15 |
+
</MagePsycho_Tellafriend>
|
16 |
+
</modules>
|
17 |
+
<global>
|
18 |
+
<models>
|
19 |
+
<tellafriend>
|
20 |
+
<class>MagePsycho_Tellafriend_Model</class>
|
21 |
+
</tellafriend>
|
22 |
+
</models>
|
23 |
+
<blocks>
|
24 |
+
<tellafriend>
|
25 |
+
<class>MagePsycho_Tellafriend_Block</class>
|
26 |
+
</tellafriend>
|
27 |
+
</blocks>
|
28 |
+
<helpers>
|
29 |
+
<tellafriend>
|
30 |
+
<class>MagePsycho_Tellafriend_Helper</class>
|
31 |
+
</tellafriend>
|
32 |
+
</helpers>
|
33 |
+
<template>
|
34 |
+
<email>
|
35 |
+
<tellafriend_email_email_template translate="label" module="tellafriend">
|
36 |
+
<label>Tell A Friend Template</label>
|
37 |
+
<file>tellafriend/tellafriend.html</file>
|
38 |
+
<type>html</type>
|
39 |
+
</tellafriend_email_email_template>
|
40 |
+
</email>
|
41 |
+
</template>
|
42 |
+
</global>
|
43 |
+
<frontend>
|
44 |
+
<routers>
|
45 |
+
<tellafriend>
|
46 |
+
<use>standard</use>
|
47 |
+
<args>
|
48 |
+
<module>MagePsycho_Tellafriend</module>
|
49 |
+
<frontName>tellafriend</frontName>
|
50 |
+
</args>
|
51 |
+
</tellafriend>
|
52 |
+
</routers>
|
53 |
+
<layout>
|
54 |
+
<updates>
|
55 |
+
<tellafriend>
|
56 |
+
<file>tellafriend.xml</file>
|
57 |
+
</tellafriend>
|
58 |
+
</updates>
|
59 |
+
</layout>
|
60 |
+
</frontend>
|
61 |
+
<adminhtml>
|
62 |
+
<acl>
|
63 |
+
<resources>
|
64 |
+
<admin>
|
65 |
+
<children>
|
66 |
+
<system>
|
67 |
+
<children>
|
68 |
+
<config>
|
69 |
+
<children>
|
70 |
+
<magepychoinfo>
|
71 |
+
<title>MagePsycho - Area</title>
|
72 |
+
</magepychoinfo>
|
73 |
+
<tellafriend>
|
74 |
+
<title>Tell A Friend</title>
|
75 |
+
</tellafriend>
|
76 |
+
</children>
|
77 |
+
</config>
|
78 |
+
</children>
|
79 |
+
</system>
|
80 |
+
</children>
|
81 |
+
</admin>
|
82 |
+
</resources>
|
83 |
+
</acl>
|
84 |
+
</adminhtml>
|
85 |
+
<default>
|
86 |
+
<tellafriend>
|
87 |
+
<option>
|
88 |
+
<active>1</active>
|
89 |
+
</option>
|
90 |
+
<email>
|
91 |
+
<email_sender>general</email_sender>
|
92 |
+
<email_template>tellafriend_email_email_template</email_template>
|
93 |
+
</email>
|
94 |
+
</tellafriend>
|
95 |
+
</default>
|
96 |
+
</config>
|
app/code/local/MagePsycho/Tellafriend/etc/system.xml
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category MagePsycho
|
5 |
+
* @package MagePsycho_Tellafriend
|
6 |
+
* @author magepsycho@gmail.com
|
7 |
+
* @website http://www.magepsycho.com
|
8 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<tabs>
|
13 |
+
<magepychoall translate="label" module="tellafriend">
|
14 |
+
<label>MagePsycho Extensions</label>
|
15 |
+
<sort_order>400</sort_order>
|
16 |
+
</magepychoall>
|
17 |
+
</tabs>
|
18 |
+
<sections>
|
19 |
+
<magepychoinfo translate="label" module="tellafriend">
|
20 |
+
<label>Info</label>
|
21 |
+
<tab>magepychoall</tab>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>99999999999</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
<groups>
|
28 |
+
<info>
|
29 |
+
<frontend_model>tellafriend/system_config_info</frontend_model>
|
30 |
+
<sort_order>10</sort_order>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>1</show_in_store>
|
34 |
+
</info>
|
35 |
+
</groups>
|
36 |
+
</magepychoinfo>
|
37 |
+
|
38 |
+
<tellafriend module="tellafriend">
|
39 |
+
<label>Tell A Friend</label>
|
40 |
+
<tab>magepychoall</tab>
|
41 |
+
<frontend_type>text</frontend_type>
|
42 |
+
<sort_order>1000</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
<groups>
|
47 |
+
<option translate="label">
|
48 |
+
<label>General Settings</label>
|
49 |
+
<frontend_type>text</frontend_type>
|
50 |
+
<sort_order>10</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>1</show_in_website>
|
53 |
+
<show_in_store>1</show_in_store>
|
54 |
+
<fields>
|
55 |
+
<active translate="label">
|
56 |
+
<label>Enabled</label>
|
57 |
+
<frontend_type>select</frontend_type>
|
58 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
59 |
+
<sort_order>10</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
</active>
|
64 |
+
</fields>
|
65 |
+
</option>
|
66 |
+
<email translate="label">
|
67 |
+
<label>Email Settings</label>
|
68 |
+
<frontend_type>text</frontend_type>
|
69 |
+
<sort_order>50</sort_order>
|
70 |
+
<show_in_default>1</show_in_default>
|
71 |
+
<show_in_website>1</show_in_website>
|
72 |
+
<show_in_store>1</show_in_store>
|
73 |
+
<fields>
|
74 |
+
<email_sender translate="label">
|
75 |
+
<label>Email Sender</label>
|
76 |
+
<frontend_type>select</frontend_type>
|
77 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
78 |
+
<sort_order>20</sort_order>
|
79 |
+
<show_in_default>1</show_in_default>
|
80 |
+
<show_in_website>1</show_in_website>
|
81 |
+
<show_in_store>1</show_in_store>
|
82 |
+
</email_sender>
|
83 |
+
<email_template translate="label">
|
84 |
+
<label>Email Template</label>
|
85 |
+
<frontend_type>select</frontend_type>
|
86 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
87 |
+
<sort_order>30</sort_order>
|
88 |
+
<show_in_default>1</show_in_default>
|
89 |
+
<show_in_website>1</show_in_website>
|
90 |
+
<show_in_store>1</show_in_store>
|
91 |
+
</email_template>
|
92 |
+
</fields>
|
93 |
+
</email>
|
94 |
+
</groups>
|
95 |
+
</tellafriend>
|
96 |
+
</sections>
|
97 |
+
</config>
|
app/design/frontend/default/default/layout/tellafriend.xml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="right">
|
5 |
+
<block type="tellafriend/tellafriend" name="tellafriend" template="tellafriend/tellafriend.phtml" before="-" />
|
6 |
+
</reference>
|
7 |
+
<!--<reference name="left">
|
8 |
+
<block type="tellafriend/tellafriend" name="tellafriend" template="tellafriend/tellafriend.phtml" before="-" />
|
9 |
+
</reference>-->
|
10 |
+
</default>
|
11 |
+
</layout>
|
app/etc/modules/MagePsycho_Tellafriend.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category MagePsycho
|
5 |
+
* @package MagePsycho_Tellafriend
|
6 |
+
* @author magepsycho@gmail.com
|
7 |
+
* @website http://www.magepsycho.com
|
8 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<MagePsycho_Tellafriend>
|
14 |
+
<active>true</active>
|
15 |
+
<codePool>local</codePool>
|
16 |
+
</MagePsycho_Tellafriend>
|
17 |
+
</modules>
|
18 |
+
</config>
|
app/locale/en_US/template/email/tellafriend/tellafriend.html
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject {{var store.getFrontendName()}}: New tell a friend request @-->
|
2 |
+
<!--@styles
|
3 |
+
body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
|
4 |
+
@-->
|
5 |
+
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
6 |
+
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
7 |
+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
8 |
+
<tr>
|
9 |
+
<td align="center" valign="top" style="padding:20px 0 20px 0">
|
10 |
+
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
11 |
+
<!-- [ header starts here] -->
|
12 |
+
<tr>
|
13 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/></a></td>
|
14 |
+
</tr>
|
15 |
+
<!-- [ middle starts here] -->
|
16 |
+
<tr>
|
17 |
+
<td valign="top">
|
18 |
+
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello</h1>
|
19 |
+
<p style="font-size:12px; line-height:16px; margin:0;">
|
20 |
+
Your friend {{var data.name}} has sent you the following link to visit:<br />
|
21 |
+
{{var data.url}}
|
22 |
+
</p>
|
23 |
+
</tr>
|
24 |
+
<tr>
|
25 |
+
<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>
|
26 |
+
</tr>
|
27 |
+
</table>
|
28 |
+
</td>
|
29 |
+
</tr>
|
30 |
+
</table>
|
31 |
+
</div>
|
32 |
+
</body>
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mp_Tell_A_Friend</name>
|
4 |
+
<version>0.1.0</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>Tell a friend block module is used to tell a friend about the site/info.</summary>
|
10 |
+
<description>Tell a friend block module is used to tell a friend about the site/info.</description>
|
11 |
+
<notes>- Can be placed anywhere in the site: left column, right column, cms pages, static blocks etc.
|
12 |
+
- Can be used in CMS pages / Static Blockas as: {{block type="tellafriend/tellafriend" name="tellafriend-block" template="tellafriend/tellafriend.phtml}}
|
13 |
+
- Tell a friend email template can be customized easily.</notes>
|
14 |
+
<authors><author><name>MagePsycho</name><user>auto-converted</user><email>rajen_k_bhtt@hotmail.com</email></author></authors>
|
15 |
+
<date>2011-06-30</date>
|
16 |
+
<time>06:41:24</time>
|
17 |
+
<contents><target name="mageetc"><dir name="modules"><file name="MagePsycho_Tellafriend.xml" hash="a0de91a6925d466140bb06a2d00f3f75"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="tellafriend"><file name="tellafriend.html" hash="2042d99734027712c27349c4826000df"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="tellafriend.xml" hash="673a4260b5c289fc5e6076313e53fab7"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="MagePsycho"><dir name="Tellafriend"><dir name="Block"><dir name="System"><dir name="Config"><file name="Info.php" hash="44b685a1e1b4f1ad2797fd5c63dff1ff"/></dir></dir><file name="Tellafriend.php" hash="62ca34c67d745642c0743b559a218389"/></dir><dir name="Helper"><file name="Data.php" hash="71127f38a09f04173df539c5533b7962"/></dir><dir name="Model"><file name="Session.php" hash="495a430e59c5f7a057756c6a344ff6c4"/><file name="Tellafriend.php" hash="f50f073a66f1ec4d4eed1b06011c29a4"/></dir><dir name="controllers"><file name="IndexController.php" hash="18527e015d622b491045c23e465c877d"/></dir><dir name="etc"><file name="config.xml" hash="65ad47c5c73660a3715cea021a0adfc2"/><file name="system.xml" hash="e090f36250cff5787a5bd9cc6c85638b"/></dir></dir></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies/>
|
20 |
+
</package>
|