evobilisexitmsg - Version 1.0.0

Version Notes

The idea of this plugin is to capture customer feedback when they are exiting the checkout process without completing the purchase.

Download this release

Release Info

Developer Mahesh Komarraju
Extension evobilisexitmsg
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (25) hide show
  1. app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage.php +18 -0
  2. app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Edit.php +44 -0
  3. app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Edit/Form.php +17 -0
  4. app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Edit/Tab/Form.php +23 -0
  5. app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Edit/Tabs.php +21 -0
  6. app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Grid.php +58 -0
  7. app/code/local/Evobilis/Exitmessage/Block/Exitmessage.php +11 -0
  8. app/code/local/Evobilis/Exitmessage/Helper/Data.php +5 -0
  9. app/code/local/Evobilis/Exitmessage/Model/Exitmessage.php +12 -0
  10. app/code/local/Evobilis/Exitmessage/Model/Mysql4/Exitmessage.php +8 -0
  11. app/code/local/Evobilis/Exitmessage/Model/Mysql4/Exitmessage/Collection.php +9 -0
  12. app/code/local/Evobilis/Exitmessage/controllers/Adminhtml/ExitmessageController.php +165 -0
  13. app/code/local/Evobilis/Exitmessage/controllers/IndexController.php +39 -0
  14. app/code/local/Evobilis/Exitmessage/etc/adminhtml.xml +23 -0
  15. app/code/local/Evobilis/Exitmessage/etc/config.xml +137 -0
  16. app/code/local/Evobilis/Exitmessage/etc/system.xml +41 -0
  17. app/code/local/Evobilis/Exitmessage/sql/exitmessage_setup/mysql4-install-0.1.0.php +20 -0
  18. app/design/adminhtml/default/default/layout/exitmessage.xml +13 -0
  19. app/design/adminhtml/default/default/template/exitmessage/exitmessagebackend.phtml +1 -0
  20. app/design/frontend/base/default/layout/exitmessage.xml +14 -0
  21. app/design/frontend/base/default/template/exitmessage/exitmessage.phtml +30 -0
  22. app/etc/modules/Evobilis_Exitmessage.xml +9 -0
  23. package.xml +23 -0
  24. skin/frontend/base/default/css/evo-exitmsg.css +19 -0
  25. skin/frontend/base/default/js/evo-exitmsg.js +36 -0
app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Evobilis_Exitmessage_Block_Adminhtml_Exitmessage extends Mage_Adminhtml_Block_Widget_Grid_Container{
5
+
6
+ public function __construct()
7
+ {
8
+
9
+ $this->_controller = "adminhtml_exitmessage";
10
+ $this->_blockGroup = "exitmessage";
11
+ $this->_headerText = Mage::helper("exitmessage")->__("Checkout Exit Feedbacks");
12
+ parent::__construct();
13
+ $this->_removeButton('delete');
14
+ $this->_removeButton('save');
15
+ $this->_removeButton('add');
16
+ }
17
+
18
+ }
app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Edit.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Evobilis_Exitmessage_Block_Adminhtml_Exitmessage_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+
8
+ parent::__construct();
9
+ $this->_objectId = "id";
10
+ $this->_blockGroup = "exitmessage";
11
+ $this->_controller = "adminhtml_exitmessage";
12
+ $this->_updateButton("save", "label", Mage::helper("exitmessage")->__("Save Item"));
13
+ $this->_updateButton("delete", "label", Mage::helper("exitmessage")->__("Delete Item"));
14
+
15
+ $this->_addButton("saveandcontinue", array(
16
+ "label" => Mage::helper("exitmessage")->__("Save And Continue Edit"),
17
+ "onclick" => "saveAndContinueEdit()",
18
+ "class" => "save",
19
+ ), -100);
20
+
21
+
22
+
23
+ $this->_formScripts[] = "
24
+
25
+ function saveAndContinueEdit(){
26
+ editForm.submit($('edit_form').action+'back/edit/');
27
+ }
28
+ ";
29
+ }
30
+
31
+ public function getHeaderText()
32
+ {
33
+ if( Mage::registry("exitmessage_data") && Mage::registry("exitmessage_data")->getId() ){
34
+
35
+ return Mage::helper("exitmessage")->__("Edit Item '%s'", $this->htmlEscape(Mage::registry("exitmessage_data")->getId()));
36
+
37
+ }
38
+ else{
39
+
40
+ return Mage::helper("exitmessage")->__("Add Item");
41
+
42
+ }
43
+ }
44
+ }
app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Evobilis_Exitmessage_Block_Adminhtml_Exitmessage_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ "id" => "edit_form",
8
+ "action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))),
9
+ "method" => "post",
10
+ "enctype" =>"multipart/form-data",
11
+ )
12
+ );
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Edit/Tab/Form.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Evobilis_Exitmessage_Block_Adminhtml_Exitmessage_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset("exitmessage_form", array("legend"=>Mage::helper("exitmessage")->__("Item information")));
10
+
11
+
12
+
13
+ if (Mage::getSingleton("adminhtml/session")->getExitmessageData())
14
+ {
15
+ $form->setValues(Mage::getSingleton("adminhtml/session")->getExitmessageData());
16
+ Mage::getSingleton("adminhtml/session")->setExitmessageData(null);
17
+ }
18
+ elseif(Mage::registry("exitmessage_data")) {
19
+ $form->setValues(Mage::registry("exitmessage_data")->getData());
20
+ }
21
+ return parent::_prepareForm();
22
+ }
23
+ }
app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Edit/Tabs.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Evobilis_Exitmessage_Block_Adminhtml_Exitmessage_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setId("exitmessage_tabs");
8
+ $this->setDestElementId("edit_form");
9
+ $this->setTitle(Mage::helper("exitmessage")->__("Item Information"));
10
+ }
11
+ protected function _beforeToHtml()
12
+ {
13
+ $this->addTab("form_section", array(
14
+ "label" => Mage::helper("exitmessage")->__("Item Information"),
15
+ "title" => Mage::helper("exitmessage")->__("Item Information"),
16
+ "content" => $this->getLayout()->createBlock("exitmessage/adminhtml_exitmessage_edit_tab_form")->toHtml(),
17
+ ));
18
+ return parent::_beforeToHtml();
19
+ }
20
+
21
+ }
app/code/local/Evobilis/Exitmessage/Block/Adminhtml/Exitmessage/Grid.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Evobilis_Exitmessage_Block_Adminhtml_Exitmessage_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId("exitmessageGrid");
10
+ $this->setDefaultSort("id");
11
+ $this->setDefaultDir("ASC");
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel("exitmessage/exitmessage")->getCollection();
18
+ $this->setCollection($collection);
19
+ return parent::_prepareCollection();
20
+ }
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn("id", array(
24
+ "header" => Mage::helper("exitmessage")->__("ID"),
25
+ "width" => "10px",
26
+ "type" => "number",
27
+ "index" => "id",
28
+ ));
29
+
30
+ $this->addColumn("feedback", array(
31
+ "header" => Mage::helper("exitmessage")->__("Feedback"),
32
+ "width" => "650px",
33
+ "index" => "feedback",
34
+ ));
35
+
36
+ $this->addColumn("email", array(
37
+ "header" => Mage::helper("exitmessage")->__("Email Address"),
38
+ "index" => "email",
39
+ ));
40
+
41
+ $this->addColumn("date", array(
42
+ "header" => Mage::helper("exitmessage")->__("Date Submitted"),
43
+ "index" => "date",
44
+ ));
45
+
46
+ $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
47
+ $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel'));
48
+
49
+ return parent::_prepareColumns();
50
+ }
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+ }
app/code/local/Evobilis/Exitmessage/Block/Exitmessage.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Evobilis_Exitmessage_Block_Exitmessage extends Mage_Catalog_Block_Product_Abstract{
5
+
6
+ public function __construct()
7
+ {
8
+
9
+ }
10
+
11
+ }
app/code/local/Evobilis/Exitmessage/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Evobilis_Exitmessage_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/local/Evobilis/Exitmessage/Model/Exitmessage.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Evobilis_Exitmessage_Model_Exitmessage extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+
7
+ $this->_init("exitmessage/exitmessage");
8
+
9
+ }
10
+
11
+ }
12
+
app/code/local/Evobilis/Exitmessage/Model/Mysql4/Exitmessage.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Evobilis_Exitmessage_Model_Mysql4_Exitmessage extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("exitmessage/exitmessage", "id");
7
+ }
8
+ }
app/code/local/Evobilis/Exitmessage/Model/Mysql4/Exitmessage/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Evobilis_Exitmessage_Model_Mysql4_Exitmessage_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("exitmessage/exitmessage");
7
+ }
8
+ }
9
+
app/code/local/Evobilis/Exitmessage/controllers/Adminhtml/ExitmessageController.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Evobilis_Exitmessage_Adminhtml_ExitmessageController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ protected function _initAction()
6
+ {
7
+ $this->loadLayout()->_setActiveMenu("exitmessage/exitmessage")->_addBreadcrumb(Mage::helper("adminhtml")->__("Exitmessage Manager"),Mage::helper("adminhtml")->__("Exitmessage Manager"));
8
+ return $this;
9
+ }
10
+ public function indexAction()
11
+ {
12
+ $this->_title($this->__("Exitmessage"));
13
+ $this->_title($this->__("Manager Exitmessage"));
14
+
15
+ $this->_initAction();
16
+ $this->renderLayout();
17
+ }
18
+ public function editAction()
19
+ {
20
+ $this->_title($this->__("Exitmessage"));
21
+ $this->_title($this->__("Exitmessage"));
22
+ $this->_title($this->__("Edit Item"));
23
+
24
+ $id = $this->getRequest()->getParam("id");
25
+ $model = Mage::getModel("exitmessage/exitmessage")->load($id);
26
+ if ($model->getId()) {
27
+ Mage::register("exitmessage_data", $model);
28
+ $this->loadLayout();
29
+ $this->_setActiveMenu("exitmessage/exitmessage");
30
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Exitmessage Manager"), Mage::helper("adminhtml")->__("Exitmessage Manager"));
31
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Exitmessage Description"), Mage::helper("adminhtml")->__("Exitmessage Description"));
32
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
33
+ $this->_addContent($this->getLayout()->createBlock("exitmessage/adminhtml_exitmessage_edit"))->_addLeft($this->getLayout()->createBlock("exitmessage/adminhtml_exitmessage_edit_tabs"));
34
+ $this->renderLayout();
35
+ }
36
+ else {
37
+ Mage::getSingleton("adminhtml/session")->addError(Mage::helper("exitmessage")->__("Item does not exist."));
38
+ $this->_redirect("*/*/");
39
+ }
40
+ }
41
+
42
+ public function newAction()
43
+ {
44
+
45
+ $this->_title($this->__("Exitmessage"));
46
+ $this->_title($this->__("Exitmessage"));
47
+ $this->_title($this->__("New Item"));
48
+
49
+ $id = $this->getRequest()->getParam("id");
50
+ $model = Mage::getModel("exitmessage/exitmessage")->load($id);
51
+
52
+ $data = Mage::getSingleton("adminhtml/session")->getFormData(true);
53
+ if (!empty($data)) {
54
+ $model->setData($data);
55
+ }
56
+
57
+ Mage::register("exitmessage_data", $model);
58
+
59
+ $this->loadLayout();
60
+ $this->_setActiveMenu("exitmessage/exitmessage");
61
+
62
+ $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
63
+
64
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Exitmessage Manager"), Mage::helper("adminhtml")->__("Exitmessage Manager"));
65
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Exitmessage Description"), Mage::helper("adminhtml")->__("Exitmessage Description"));
66
+
67
+
68
+ $this->_addContent($this->getLayout()->createBlock("exitmessage/adminhtml_exitmessage_edit"))->_addLeft($this->getLayout()->createBlock("exitmessage/adminhtml_exitmessage_edit_tabs"));
69
+
70
+ $this->renderLayout();
71
+
72
+ }
73
+ public function saveAction()
74
+ {
75
+
76
+ $post_data=$this->getRequest()->getPost();
77
+
78
+
79
+ if ($post_data) {
80
+
81
+ try {
82
+
83
+
84
+
85
+ $model = Mage::getModel("exitmessage/exitmessage")
86
+ ->addData($post_data)
87
+ ->setId($this->getRequest()->getParam("id"))
88
+ ->save();
89
+
90
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Exitmessage was successfully saved"));
91
+ Mage::getSingleton("adminhtml/session")->setExitmessageData(false);
92
+
93
+ if ($this->getRequest()->getParam("back")) {
94
+ $this->_redirect("*/*/edit", array("id" => $model->getId()));
95
+ return;
96
+ }
97
+ $this->_redirect("*/*/");
98
+ return;
99
+ }
100
+ catch (Exception $e) {
101
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
102
+ Mage::getSingleton("adminhtml/session")->setExitmessageData($this->getRequest()->getPost());
103
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
104
+ return;
105
+ }
106
+
107
+ }
108
+ $this->_redirect("*/*/");
109
+ }
110
+
111
+
112
+
113
+ public function deleteAction()
114
+ {
115
+ if( $this->getRequest()->getParam("id") > 0 ) {
116
+ try {
117
+ $model = Mage::getModel("exitmessage/exitmessage");
118
+ $model->setId($this->getRequest()->getParam("id"))->delete();
119
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
120
+ $this->_redirect("*/*/");
121
+ }
122
+ catch (Exception $e) {
123
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
124
+ $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
125
+ }
126
+ }
127
+ $this->_redirect("*/*/");
128
+ }
129
+
130
+
131
+ public function massRemoveAction()
132
+ {
133
+ try {
134
+ $ids = $this->getRequest()->getPost('ids', array());
135
+ foreach ($ids as $id) {
136
+ $model = Mage::getModel("exitmessage/exitmessage");
137
+ $model->setId($id)->delete();
138
+ }
139
+ Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
140
+ }
141
+ catch (Exception $e) {
142
+ Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
143
+ }
144
+ $this->_redirect('*/*/');
145
+ }
146
+
147
+ /**
148
+ * Export order grid to CSV format
149
+ */
150
+ public function exportCsvAction()
151
+ {
152
+ $fileName = 'exitmessage.csv';
153
+ $grid = $this->getLayout()->createBlock('exitmessage/adminhtml_exitmessage_grid');
154
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
155
+ }
156
+ /**
157
+ * Export order grid to Excel XML format
158
+ */
159
+ public function exportExcelAction()
160
+ {
161
+ $fileName = 'exitmessage.xml';
162
+ $grid = $this->getLayout()->createBlock('exitmessage/adminhtml_exitmessage_grid');
163
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
164
+ }
165
+ }
app/code/local/Evobilis/Exitmessage/controllers/IndexController.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?
2
+ class Evobilis_Exitmessage_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+
7
+ if($_POST['evobilis_exitmsg_feedback']==NULL){
8
+ $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
9
+ $this->getResponse()->setHeader('Status','404 File not found');
10
+ $pageId = Mage::getStoreConfig('web/default/cms_no_route');
11
+ if (!Mage::helper('cms/page')->renderPage($this, $pageId)) {
12
+ $this->_forward('defaultNoRoute');
13
+ }
14
+ }
15
+ else
16
+ {
17
+ if($_POST['evobilis_exitmsg_feedback_msg']!=NULL)
18
+ {
19
+ $email=Mage::getSingleton('customer/session')->getCustomer()->getEmail();
20
+ if($email==NULL)
21
+ $email=$_POST['email'];
22
+ $sql = Mage::getSingleton('core/resource')->getConnection('core_write');
23
+ $sql->query("insert into evobilis_exitmsg_feedback values('','".$_POST['evobilis_exitmsg_feedback_msg']."','".$email."','".Zend_Date::now()->toString('yyyyMMddHHmmss')."')");
24
+ $msg="Message: ".$_POST['evobilis_exitmsg_feedback_msg'];
25
+ $mail = new Zend_Mail();
26
+ $mail->setBodyHtml($msg);
27
+ $mail->setFrom(Mage::getStoreConfig('trans_email/ident_general/email'),Mage::getStoreConfig('trans_email/ident_general/name'));
28
+ $mail->addTo(Mage::getStoreConfig('trans_email/ident_general/email'));
29
+ $mail->setSubject("New Feedback Submitted");
30
+ $mail->send();
31
+ echo 'done';
32
+ }
33
+ }
34
+
35
+ }
36
+
37
+
38
+ }
39
+ ?>
app/code/local/Evobilis/Exitmessage/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <evobilis_exitmsg_section translate="title" module="modulename">
12
+ <title>Checkout Exit Message Section</title>
13
+ <sort_order>0</sort_order>
14
+ </evobilis_exitmsg_section>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/local/Evobilis/Exitmessage/etc/config.xml ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Evobilis_Exitmessage>
5
+ <version>0.1.0</version>
6
+ </Evobilis_Exitmessage>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <exitmessage>
11
+ <class>Evobilis_Exitmessage_Helper</class>
12
+ </exitmessage>
13
+ </helpers>
14
+ <blocks>
15
+ <exitmessage>
16
+ <class>Evobilis_Exitmessage_Block</class>
17
+ </exitmessage>
18
+ </blocks>
19
+ <models>
20
+ <exitmessage>
21
+ <class>Evobilis_Exitmessage_Model</class>
22
+ <resourceModel>exitmessage_mysql4</resourceModel>
23
+ </exitmessage>
24
+ <exitmessage_mysql4>
25
+ <class>Evobilis_Exitmessage_Model_Mysql4</class>
26
+ <entities>
27
+ <exitmessage>
28
+ <table>evobilis_exitmsg_feedback</table>
29
+ </exitmessage>
30
+ </entities>
31
+ </exitmessage_mysql4>
32
+ </models>
33
+ <resources>
34
+ <exitmessage_setup>
35
+ <setup>
36
+ <module>Evobilis_Exitmessage</module>
37
+ </setup>
38
+ <connection>
39
+ <use>core_setup</use>
40
+ </connection>
41
+ </exitmessage_setup>
42
+ <exitmessage_write>
43
+ <connection>
44
+ <use>core_write</use>
45
+ </connection>
46
+ </exitmessage_write>
47
+ <exitmessage_read>
48
+ <connection>
49
+ <use>core_read</use>
50
+ </connection>
51
+ </exitmessage_read>
52
+ </resources>
53
+ </global>
54
+ <admin>
55
+ <routers>
56
+ <exitmessage>
57
+ <use>admin</use>
58
+ <args>
59
+ <module>Evobilis_Exitmessage</module>
60
+ <frontName>exitmessage</frontName>
61
+ </args>
62
+ </exitmessage>
63
+ </routers>
64
+ </admin>
65
+ <adminhtml>
66
+ <menu>
67
+ <exitmessage module="exitmessage">
68
+ <title>Feedback</title>
69
+ <sort_order>100</sort_order>
70
+ <children>
71
+ <exitmessage module="exitmessage">
72
+ <title>View Feedbacks</title>
73
+ <sort_order>0</sort_order>
74
+ <action>exitmessage/adminhtml_exitmessage</action>
75
+ </exitmessage>
76
+ </children>
77
+ </exitmessage>
78
+ </menu>
79
+ <acl>
80
+ <resources>
81
+ <all>
82
+ <title>Allow Everything</title>
83
+ </all>
84
+ <admin>
85
+ <children>
86
+ <exitmessage translate="title" module="exitmessage">
87
+ <title>Exitmessage</title>
88
+ <sort_order>1000</sort_order>
89
+ <children>
90
+ <exitmessage translate="title">
91
+ <title>Feedback</title>
92
+ <sort_order>0</sort_order>
93
+ </exitmessage>
94
+ </children>
95
+ </exitmessage>
96
+ </children>
97
+ </admin>
98
+ </resources>
99
+ </acl>
100
+ <layout>
101
+ <updates>
102
+ <exitmessage>
103
+ <file>exitmessage.xml</file>
104
+ </exitmessage>
105
+ </updates>
106
+ </layout>
107
+ </adminhtml>
108
+ <frontend>
109
+ <translate>
110
+ <modules>
111
+ <Evobilis_ExitMessage>
112
+ <files>
113
+ <default>Evobilis_ExitMessage.csv</default>
114
+ </files>
115
+ </Evobilis_ExitMessage>
116
+ </modules>
117
+ </translate>
118
+
119
+ <routers>
120
+ <exitmessage>
121
+ <use>standard</use>
122
+ <args>
123
+ <module>Evobilis_ExitMessage</module>
124
+ <frontName>exitmessage</frontName>
125
+ </args>
126
+ </exitmessage>
127
+
128
+ </routers>
129
+ <layout>
130
+ <updates>
131
+ <exitmessage>
132
+ <file>exitmessage.xml</file>
133
+ </exitmessage>
134
+ </updates>
135
+ </layout>
136
+ </frontend>
137
+ </config>
app/code/local/Evobilis/Exitmessage/etc/system.xml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <evobilis translate="label" module="exitmessage">
5
+ <label>Evobilis</label>
6
+ <sort_order>0</sort_order>
7
+ </evobilis>
8
+ </tabs>
9
+ <sections>
10
+ <evobilis_exitmsg_section translate="label" module="exitmessage">
11
+ <label>Checkout Exit Message</label>
12
+ <tab>evobilis</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1000</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <evobilis_exitmsg_group translate="label">
20
+ <label>Checkout Exit Message</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>0</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <evobilis_exitmsg_custommsg translate="label">
28
+ <label>Custom Message</label>
29
+ <frontend_type>textarea</frontend_type>
30
+ <sort_order>0</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
+ <comment>Custom message to be displayed on the checkout exit overlay</comment>
35
+ </evobilis_exitmsg_custommsg>
36
+ </fields>
37
+ </evobilis_exitmsg_group>
38
+ </groups>
39
+ </evobilis_exitmsg_section>
40
+ </sections>
41
+ </config>
app/code/local/Evobilis/Exitmessage/sql/exitmessage_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $sql=<<<SQLTEXT
5
+ CREATE TABLE IF NOT EXISTS `evobilis_exitmsg_feedback` (
6
+ `id` int(11) NOT NULL AUTO_INCREMENT,
7
+ `feedback` text,
8
+ `email` text NOT NULL,
9
+ `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
10
+ PRIMARY KEY (`id`)
11
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
12
+
13
+ SQLTEXT;
14
+
15
+ $installer->run($sql);
16
+ //demo
17
+ //Mage::getModel('core/url_rewrite')->setId(null);
18
+ //demo
19
+ $installer->endSetup();
20
+
app/design/adminhtml/default/default/layout/exitmessage.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <exitmessage_adminhtml_exitmessagebackend_index>
4
+ <reference name="content">
5
+ <block type="exitmessage/adminhtml_exitmessagebackend" name="exitmessagebackend" template="exitmessage/exitmessagebackend.phtml"/>
6
+ </reference>
7
+ </exitmessage_adminhtml_exitmessagebackend_index>
8
+ <exitmessage_adminhtml_exitmessage_index>
9
+ <reference name="content">
10
+ <block type="exitmessage/adminhtml_exitmessage" name="exitmessage" />
11
+ </reference>
12
+ </exitmessage_adminhtml_exitmessage_index>
13
+ </layout>
app/design/adminhtml/default/default/template/exitmessage/exitmessagebackend.phtml ADDED
@@ -0,0 +1 @@
 
1
+ Demo Backend Page Content
app/design/frontend/base/default/layout/exitmessage.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout version="0.1.0">
4
+
5
+
6
+ <checkout_onepage_index translate="label">
7
+ <reference name="head">
8
+ <block type="exitmessage/exitmessage" name="exitmsg" template="exitmessage/exitmessage.phtml"/>
9
+ <action method="addItem"><type>skin_js</type><name>js/evo-exitmsg.js</name><params/></action>
10
+ <action method="addCss"><stylesheet>css/evo-exitmsg.css</stylesheet></action>
11
+ </reference>
12
+ </checkout_onepage_index>
13
+
14
+ </layout>
app/design/frontend/base/default/template/exitmessage/exitmessage.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?
2
+ $request=Mage::app()->getFrontController()->getRequest(); // Fecth the request from the frontend controller.
3
+ $session = Mage::getSingleton('checkout/session'); // Get the cart session singleton.
4
+ $items=$session->getQuote()->getAllItems(); // Get the items of the cart.
5
+ $total_items=count($items); // Count the items of the cart.
6
+
7
+ //Custom Messages
8
+ $evobilis_exitmsg_cart="You have $total_items items in your cart.";
9
+ $evobilis_exitmsg_confirm="Are you sure you want to exit the checkout?";
10
+
11
+ //Display only on checkout page & there exist atleast one item on the cart.
12
+ if($request->getControllerName()=='onepage' && $request->getModuleName()=='checkout' && $total_items>0): ?>
13
+
14
+ <!-- Evobilis Checkout Exit Message Javascript -->
15
+ <script type="text/javascript">
16
+ var evobilis_checkoutexitmsg="<?=$evobilis_exitmsg_cart;?> <?=$evobilis_exitmsg_confirm;?>";
17
+ </script>
18
+
19
+ <!-- Evobilis Checkout Exit Message Overlay -->
20
+ <div class="exit-overlay">
21
+ <div class="exit-overlay-msg">
22
+ <B><?=$evobilis_exitmsg_cart;?><BR />
23
+ <? $msg=Mage::getStoreConfig('evobilis_exitmsg_section/evobilis_exitmsg_group/evobilis_exitmsg_custommsg');
24
+ if($msg!=NULL) echo '<BR>'.$msg.'<BR>'; ?><BR />Optional Feedback<BR /><textarea id="feedback" name="feedback" style="margin: 0px; width: 283px; height: 84px;"></textarea><? $email=Mage::getSingleton('customer/session')->getCustomer()->getEmail(); if($email==NULL) { echo '<BR><BR>Email: <input type="text" name="email" id="email">'; } else { echo '<input type="hidden" name="email" id="email">';}?>
25
+ <BR /><BR /><?=$evobilis_exitmsg_confirm;?></B><BR /><BR />
26
+ <button type="button" title="Continue with checkout" onclick="evoExitFeedback('0')" class="button exit-overlay-close"><span><span>Continue</span></span></button>
27
+ <button type="button" title="Continue with checkout" onclick="evoExitFeedback('1');" class="button"><span><span>Exit Checkout</span></span></button><input type="hidden" id="exit-overlay-refer" />
28
+ </div>
29
+ </div>
30
+ <? endif;?>
app/etc/modules/Evobilis_Exitmessage.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Evobilis_Exitmessage>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Evobilis_Exitmessage>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>evobilisexitmsg</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.evobilis.com">Evobilis</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>The idea of this plugin is to capture customer feedback when they are exiting the checkout process without completing the purchase.</summary>
10
+ <description>The idea of this plugin is to capture customer feedback when they are exiting the checkout process without completing the purchase.&#xD;
11
+ On the Checkout page, it produces a nice overlay when clicked on any link or when the user tries to close the page (other than the checkout process).&#xD;
12
+ The overlay has a simple &amp; optional feedback form &amp; buttons to continue with checkout process or exit the page. &#xD;
13
+ On clicking exit button,it auto-redirects to the link that has been clicked earlier for navigation.&#xD;
14
+ In Addition, when the feedback is submitted, it sends a mail to notify about the feedback to the general email address specified on the store email address under configuration.&#xD;
15
+ It also creates a log of the feedbacks submitted which can be viewed on the 'Feedback' menu,under the Adminpanel.</description>
16
+ <notes>The idea of this plugin is to capture customer feedback when they are exiting the checkout process without completing the purchase.</notes>
17
+ <authors><author><name>Mahesh Komarraju</name><user>Mahesh</user><email>mahesh.komarraju@evobilis.com</email></author></authors>
18
+ <date>2013-03-04</date>
19
+ <time>11:00:55</time>
20
+ <contents><target name="magelocal"><dir name="Evobilis"><dir name="Exitmessage"><dir name="Block"><dir name="Adminhtml"><dir name="Exitmessage"><dir name="Edit"><file name="Form.php" hash="12de6c7f556223152743e355d639bbdc"/><dir name="Tab"><file name="Form.php" hash="36c40d204cfb9ac50a95841f9bde14c0"/></dir><file name="Tabs.php" hash="e1982750b73127501fa9918399cad3ad"/></dir><file name="Edit.php" hash="5de316100c4f3f662d20757bcd5a532e"/><file name="Grid.php" hash="ebcb0345f5c1de50fc274219b90ba516"/></dir><file name="Exitmessage.php" hash="62c57c31cb6d447b33d5763e61be0f65"/></dir><file name="Exitmessage.php" hash="4200d5537e076e07604a29a377115fca"/></dir><dir name="Helper"><file name="Data.php" hash="2ca4e189911868dcaa327849a2bac96e"/></dir><dir name="Model"><file name="Exitmessage.php" hash="9c5bb7ae23a0d705618113795ab7889a"/><dir name="Mysql4"><dir name="Exitmessage"><file name="Collection.php" hash="25b401099b696a8e260a875c6f6d0bf1"/></dir><file name="Exitmessage.php" hash="ccf89edcf50dcc81696d0e298c4e52c5"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ExitmessageController.php" hash="b55152af99a62855156a09c7698d9783"/></dir><file name="IndexController.php" hash="4bf13824b1989d654ba609eacfd5b3d5"/></dir><dir name="etc"><file name="adminhtml.xml" hash="41093671472a5350979b6a34bb2ab172"/><file name="config.xml" hash="009acfe675a958ea1fe9cf28158e4aea"/><file name="system.xml" hash="86be19ddc225fd8bf6fc7fbd7f8290f3"/></dir><dir name="sql"><dir name="exitmessage_setup"><file name="mysql4-install-0.1.0.php" hash="c08f356dcd2bf1782d04e8fcab372226"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Evobilis_Exitmessage.xml" hash="c6d61c44ba03b69cc450b5efd2fda531"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="exitmessage.xml" hash="100dbddad2f4b11fe91c3a50848da39b"/></dir><dir name="template"><dir name="exitmessage"><file name="exitmessage.phtml" hash="fd4ea2e81b6fa46b163a881be91f2ddc"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="exitmessage.xml" hash="4adeb8bad3cfa63953d9016e5482f102"/></dir><dir name="template"><dir name="exitmessage"><file name="exitmessagebackend.phtml" hash="93ad3e798b60ad33539a944088478690"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="evo-exitmsg.css" hash="152215c682c2fdb63e313cfb9841f2c7"/></dir><dir name="js"><file name="evo-exitmsg.js" hash="69138e7ab78a81e700c74728ccf173b7"/></dir></dir></dir></dir></target></contents>
21
+ <compatible/>
22
+ <dependencies><required><php><min>5.0.0</min><max>5.4.6</max></php></required></dependencies>
23
+ </package>
skin/frontend/base/default/css/evo-exitmsg.css ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .exit-overlay
2
+ {
3
+ height:100%;
4
+ width:100%;
5
+ position:fixed;
6
+ left:0;
7
+ top:0;
8
+ z-index:9999 !important;
9
+ background:rgba(0,0,0,0.75);
10
+ display:none;
11
+ }
12
+ .exit-overlay-msg {
13
+ text-align:left;
14
+ margin: auto;
15
+ width: 350px;
16
+ background:rgba(255,255,255,1);top: 150px;
17
+ position: relative;
18
+ padding:20px;
19
+ }
skin/frontend/base/default/js/evo-exitmsg.js ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var $j = jQuery.noConflict();
2
+ $j(document).ready(function() {
3
+ $j("a").click(function(event){
4
+ var href = $j(this).attr('href');
5
+ if(href!='#'){
6
+ $j(".exit-overlay").show();
7
+ $j("#exit-overlay-refer").val(href);
8
+ event.preventDefault();
9
+ event.stopPropagation();
10
+ }
11
+ });
12
+ $j(".exit-overlay-close").click(function(event){
13
+ $j(".exit-overlay").hide();
14
+
15
+ });
16
+ });
17
+ $j(window).bind('beforeunload', function(){
18
+ return evobilis_checkoutexitmsg;
19
+ });
20
+
21
+ function evoExitFeedback(o)
22
+ {
23
+ var $j = jQuery.noConflict();
24
+ src=$j('#exit-overlay-refer').val();
25
+ feedback=$j('#feedback').val();
26
+ email=$j('#email').val();
27
+ if(o=='1')
28
+ $j(".exit-overlay-msg").html('Redirecting...');
29
+ $j.post("../../exitmessage/", { email:email, evobilis_exitmsg_feedback: "true", evobilis_exitmsg_feedback_msg: feedback },function(data) {
30
+ if(o=='1')
31
+ {
32
+ $j(window).unbind('beforeunload');
33
+ window.location=src;
34
+ }
35
+ });
36
+ }