Oscprofessionals_ProductEnquires - Version 1.0.0

Version Notes

There are no uploaded releases

Download this release

Release Info

Developer Satish Mantri
Extension Oscprofessionals_ProductEnquires
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (31) hide show
  1. app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry.php +23 -0
  2. app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Edit.php +70 -0
  3. app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Edit/Form.php +32 -0
  4. app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Edit/Tab/Form.php +84 -0
  5. app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Edit/Tabs.php +32 -0
  6. app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Grid.php +163 -0
  7. app/code/community/Oscprofessionals/ProductEnquiry/Block/Edit.php +24 -0
  8. app/code/community/Oscprofessionals/ProductEnquiry/Block/ProductEnquiry.php +45 -0
  9. app/code/community/Oscprofessionals/ProductEnquiry/Helper/Data.php +70 -0
  10. app/code/community/Oscprofessionals/ProductEnquiry/Model/Productenquiry.php +19 -0
  11. app/code/community/Oscprofessionals/ProductEnquiry/Model/Resource/Productenquiry.php +21 -0
  12. app/code/community/Oscprofessionals/ProductEnquiry/Model/Resource/Productenquiry/Collection.php +19 -0
  13. app/code/community/Oscprofessionals/ProductEnquiry/Model/Status.php +24 -0
  14. app/code/community/Oscprofessionals/ProductEnquiry/controllers/AccountController.php +102 -0
  15. app/code/community/Oscprofessionals/ProductEnquiry/controllers/Adminhtml/ProductenquiryController.php +227 -0
  16. app/code/community/Oscprofessionals/ProductEnquiry/controllers/IndexController.php +127 -0
  17. app/code/community/Oscprofessionals/ProductEnquiry/etc/adminhtml.xml +62 -0
  18. app/code/community/Oscprofessionals/ProductEnquiry/etc/config.xml +120 -0
  19. app/code/community/Oscprofessionals/ProductEnquiry/etc/system.xml +77 -0
  20. app/code/community/Oscprofessionals/ProductEnquiry/sql/productenquiry_setup/install-1.0.0.php +29 -0
  21. app/design/adminhtml/default/default/layout/oscprofessionals/productenquiry.xml +17 -0
  22. app/design/adminhtml/default/default/template/oscprofessionals/productenquiry/form.phtml +66 -0
  23. app/design/frontend/base/default/layout/oscprofessionals/productenquiry.xml +31 -0
  24. app/design/frontend/base/default/template/oscprofessionals/productenquiry/enquirydisplay.phtml +45 -0
  25. app/design/frontend/base/default/template/oscprofessionals/productenquiry/enquirydisplay.phtml_org +41 -0
  26. app/design/frontend/base/default/template/oscprofessionals/productenquiry/modelform.phtml +110 -0
  27. app/design/frontend/base/default/template/oscprofessionals/productenquiry/org_modelform.phtml +64 -0
  28. app/etc/modules/Oscprofessionals_ProductEnquiry.xml +18 -0
  29. app/locale/en_US/template/email/oscprofessionals/productenquiry.html +26 -0
  30. package.xml +24 -0
  31. skin/frontend/base/default/css/oscprofessionals/productenquiry/productenquiry.css +15 -0
app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Block_Adminhtml_Productenquiry extends Mage_Adminhtml_Block_Widget_Grid_Container
10
+ {
11
+ /*
12
+ * Add Default Values to grid
13
+ */
14
+ public function __construct()
15
+ {
16
+ $this->_controller = 'adminhtml_productenquiry';
17
+ $this->_blockGroup = 'oscpproductenquiry';
18
+ $this->_headerText = Mage::helper('oscpproductenquiry')->__('Product Enquiry Information');
19
+ $this->_addButtonLabel = Mage::helper('oscpproductenquiry')->__('Add Product Enquiry');
20
+ parent::__construct();
21
+ }
22
+
23
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Edit.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Block_Adminhtml_productenquiry_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
10
+ {
11
+ /**
12
+ * Add Default Values to form
13
+ */
14
+ public function __construct()
15
+ {
16
+ parent::__construct();
17
+
18
+ $this->_objectId = 'id';
19
+ $this->_blockGroup = 'oscpproductenquiry';
20
+ $this->_controller = 'adminhtml_productenquiry';
21
+
22
+ $this->_updateButton('save', 'label', Mage::helper('oscpproductenquiry')->__('Save Item'));
23
+ $this->_updateButton('delete', 'label', Mage::helper('oscpproductenquiry')->__('Delete Item'));
24
+
25
+ $this->_addButton('saveandcontinue', array(
26
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
27
+ 'onclick' => 'saveAndContinueEdit()',
28
+ 'class' => 'save'
29
+ ), -100);
30
+
31
+ $this->_formScripts[] = "
32
+ function toggleEditor() {
33
+ if (tinyMCE.getInstanceById('productenquiry_content') == null) {
34
+ tinyMCE.execCommand('mceAddControl', false, 'productenquiry_content');
35
+ } else {
36
+ tinyMCE.execCommand('mceRemoveControl', false, 'productenquiry_content');
37
+ }
38
+ }
39
+
40
+ function saveAndContinueEdit(){
41
+ editForm.submit($('edit_form').action+'back/edit/');
42
+ }
43
+ ";
44
+ }
45
+
46
+ /**
47
+ * Get Header text
48
+ *
49
+ * @return string
50
+ */
51
+ public function getHeaderText()
52
+ {
53
+ if (Mage::registry('productenquiry_data') && Mage::registry('productenquiry_data')->getId()) {
54
+ return Mage::helper('oscpproductenquiry')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('productenquiry_data')->getTitle()));
55
+ } else {
56
+ return Mage::helper('oscpproductenquiry')->__('Add Item');
57
+ }
58
+ }
59
+
60
+ public function isAjax()
61
+ {
62
+ return Mage::app()->getRequest()->isXmlHttpRequest() || Mage::app()->getRequest()->getParam('isAjax');
63
+ }
64
+
65
+ public function getJsObjectName()
66
+ {
67
+ return $this->getId() . 'JsObject';
68
+ }
69
+
70
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Edit/Form.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Block_Adminhtml_Productenquiry_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
10
+ {
11
+ /**
12
+ * Setup form fields for inserts/updates
13
+ *
14
+ * return Mage_Adminhtml_Block_Widget_Form
15
+ */
16
+ protected function _prepareForm()
17
+ {
18
+
19
+ $form = new Varien_Data_Form(array(
20
+ 'id' => 'edit_form',
21
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
22
+ 'method' => 'post',
23
+ 'enctype' => 'multipart/form-data'
24
+ )
25
+ );
26
+
27
+ $form->setUseContainer(true);
28
+ $this->setForm($form);
29
+ return parent::_prepareForm();
30
+ }
31
+
32
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Edit/Tab/Form.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Block_Adminhtml_productenquiry_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
10
+ {
11
+ /**
12
+ * Setup form fields for inserts/updates
13
+ *
14
+ * return Mage_Adminhtml_Block_Widget_Form
15
+ */
16
+ protected function _prepareForm()
17
+ {
18
+ $form = new Varien_Data_Form();
19
+ $this->setForm($form);
20
+ $fieldset = $form->addFieldset('productenquiry_form', array(
21
+ 'legend' => Mage::helper('oscpproductenquiry')->__('Product Enquiry Information')
22
+ ));
23
+ $fieldset->addField('product_id', 'text', array(
24
+ 'label' => Mage::helper('oscpproductenquiry')->__('Product ID'),
25
+ 'class' => 'text',
26
+ 'required' => true,
27
+ 'name' => 'product_id'
28
+ ));
29
+ $fieldset->addField('product_name', 'text', array(
30
+ 'label' => Mage::helper('oscpproductenquiry')->__('Product Name'),
31
+ 'class' => 'text',
32
+ 'required' => false,
33
+ 'name' => 'product_name'
34
+ ));
35
+ $fieldset->addField('name', 'text', array(
36
+ 'label' => Mage::helper('oscpproductenquiry')->__('Name'),
37
+ 'class' => 'text',
38
+ 'required' => false,
39
+ 'name' => 'name'
40
+ ));
41
+ $fieldset->addField('email', 'text', array(
42
+ 'label' => Mage::helper('oscpproductenquiry')->__('Email Address'),
43
+ 'class' => 'required-entry',
44
+ 'required' => true,
45
+ 'name' => 'email'
46
+ ));
47
+
48
+ $fieldset->addField('question', 'textarea', array(
49
+ 'label' => Mage::helper('oscpproductenquiry')->__('Question'),
50
+ 'class' => 'text',
51
+ 'required' => false,
52
+ 'name' => 'question'
53
+ ));
54
+
55
+ $fieldset->addField('comment', 'textarea', array(
56
+ 'label' => Mage::helper('oscpproductenquiry')->__('Comment'),
57
+ 'class' => 'text',
58
+ 'required' => false,
59
+ 'name' => 'comment'
60
+ ));
61
+
62
+ $fieldset->addField('is_approved', 'select', array(
63
+ 'label' => Mage::helper('oscpproductenquiry')->__('Is Approved'),
64
+ 'title' => Mage::helper('oscpproductenquiry')->__('Is Approved'),
65
+ 'name' => 'is_approved',
66
+ 'required' => false,
67
+ 'options' => array(
68
+ '0' => Mage::helper('oscpproductenquiry')->__('Pending'),
69
+ '1' => Mage::helper('oscpproductenquiry')->__('Approved'),
70
+ ),
71
+ ));
72
+
73
+
74
+ if (Mage::getSingleton('adminhtml/session')->getEmbriodaryData()) {
75
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getEmbriodaryData());
76
+ Mage::getSingleton('adminhtml/session')->setEmbriodaryData(null);
77
+ } elseif (Mage::registry('productenquiry_data')) {
78
+ $form->setValues(Mage::registry('productenquiry_data')->getData());
79
+ }
80
+
81
+ return parent::_prepareForm();
82
+ }
83
+
84
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Edit/Tabs.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Block_Adminhtml_Productenquiry_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ $this->setId('productenquiry_tabs');
16
+ $this->setDestElementId('edit_form');
17
+ $this->setTitle(Mage::helper('oscpproductenquiry')->__('Product Enquiry Information'));
18
+ }
19
+
20
+ protected function _beforeToHtml()
21
+ {
22
+
23
+ $this->addTab('form_section', array(
24
+ 'label' => Mage::helper('oscpproductenquiry')->__('Product Enquiry '),
25
+ 'title' => Mage::helper('oscpproductenquiry')->__('Product Enquiry Information'),
26
+ 'content' => $this->getLayout()->createBlock('oscpproductenquiry/adminhtml_productenquiry_edit_tab_form')->toHtml(),
27
+ ));
28
+
29
+ return parent::_beforeToHtml();
30
+ }
31
+
32
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Block/Adminhtml/Productenquiry/Grid.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Block_Adminhtml_Productenquiry_Grid extends Mage_Adminhtml_Block_Widget_Grid
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+ $this->setId('productenquiryGrid');
16
+ $this->setDefaultSort('model_id');
17
+ $this->setDefaultDir('DESC');
18
+ $this->setSaveParametersInSession(true);
19
+ }
20
+
21
+ /*
22
+ * Get and set our collection for the grid
23
+ */
24
+ protected function _prepareCollection()
25
+ {
26
+ $collection = Mage::getModel('oscpproductenquiry/productenquiry')->getCollection();
27
+ $this->setCollection($collection);
28
+ return parent::_prepareCollection();
29
+ }
30
+
31
+ /*
32
+ * Add the columns that should appear in the grid
33
+ */
34
+ protected function _prepareColumns()
35
+ {
36
+ $this->addColumn('model_id', array(
37
+ 'header' => Mage::helper('oscpproductenquiry')->__('ID'),
38
+ 'align' => 'right',
39
+ 'width' => '50px',
40
+ 'index' => 'model_id'
41
+ ));
42
+
43
+ $this->addColumn('product_id', array(
44
+ 'header' => Mage::helper('oscpproductenquiry')->__('Product ID'),
45
+ 'align' => 'right',
46
+ 'width' => '50px',
47
+ 'index' => 'product_id'
48
+ ));
49
+
50
+ $this->addColumn('name', array(
51
+ 'header' => Mage::helper('oscpproductenquiry')->__('Name'),
52
+ 'align' => 'right',
53
+ 'width' => '50px',
54
+ 'index' => 'name'
55
+ ));
56
+
57
+ $this->addColumn('email', array(
58
+ 'header' => Mage::helper('oscpproductenquiry')->__('Email Address'),
59
+ 'align' => 'right',
60
+ 'width' => '50px',
61
+ 'index' => 'email'
62
+ ));
63
+
64
+ $this->addColumn('question', array(
65
+ 'header' => Mage::helper('oscpproductenquiry')->__('Question'),
66
+ 'align' => 'right',
67
+ 'width' => '50px',
68
+ 'index' => 'question'
69
+ ));
70
+
71
+ $this->addColumn('comment', array(
72
+ 'header' => Mage::helper('oscpproductenquiry')->__('Comment'),
73
+ 'align' => 'right',
74
+ 'width' => '50px',
75
+ 'index' => 'comment'
76
+ ));
77
+
78
+ $this->addColumn('product_name', array(
79
+ 'header' => Mage::helper('oscpproductenquiry')->__('Product Name'),
80
+ 'align' => 'right',
81
+ 'width' => '50px',
82
+ 'index' => 'product_name'
83
+ ));
84
+
85
+ $this->addColumn('is_approved', array(
86
+ 'header' => Mage::helper('oscpproductenquiry')->__('Is Approved'),
87
+ 'align' => 'right',
88
+ 'width' => '50px',
89
+ 'index' => 'is_approved',
90
+ 'type' => 'options',
91
+ 'options' => array(
92
+ 0 => Mage::helper('oscpproductenquiry')->__('Pending'),
93
+ 1 => Mage::helper('oscpproductenquiry')->__('Approved')
94
+ ),
95
+ ));
96
+
97
+ $this->addColumn('created_at', array(
98
+ 'header' => Mage::helper('oscpproductenquiry')->__('Created At'),
99
+ 'type' => 'datetime',
100
+ 'align' => 'center',
101
+ 'index' => 'created_at',
102
+ ));
103
+
104
+ $this->addColumn('updated_at', array(
105
+ 'header' => Mage::helper('oscpproductenquiry')->__('Updated At'),
106
+ 'type' => 'datetime',
107
+ 'align' => 'center',
108
+ 'index' => 'updated_at',
109
+ ));
110
+
111
+ $this->addColumn('action', array(
112
+ 'header' => Mage::helper('oscpproductenquiry')->__('Action'),
113
+ 'width' => '100px',
114
+ 'type' => 'action',
115
+ 'getter' => 'getId',
116
+ 'actions' => array(array(
117
+ 'caption' => Mage::helper('oscpproductenquiry')->__('Edit'),
118
+ 'url' => array(
119
+ 'base' => '*/*/edit'
120
+ ),
121
+ 'field' => 'id'
122
+ )),
123
+ 'filter' => false,
124
+ 'sortable' => false,
125
+ 'index' => 'productenquiry',
126
+ ));
127
+
128
+ $this->addExportType('*/*/exportCsv', Mage::helper('oscpproductenquiry')->__('CSV'));
129
+ $this->addExportType('*/*/exportXml', Mage::helper('oscpproductenquiry')->__('XML'));
130
+
131
+ return parent::_prepareColumns();
132
+ }
133
+
134
+ /*
135
+ * Creating Mass Action
136
+ */
137
+ protected function _prepareMassaction()
138
+ {
139
+ $this->setMassactionIdField('productenquiry_id');
140
+ $this->getMassactionBlock()->setFormFieldName('productenquiry');
141
+
142
+ $this->getMassactionBlock()->addItem('delete', array(
143
+ 'label' => Mage::helper('oscpproductenquiry')->__('Delete'),
144
+ 'url' => $this->getUrl('*/*/massDelete'),
145
+ 'confirm' => Mage::helper('oscpproductenquiry')->__('Are you sure?')
146
+ ));
147
+
148
+ $statuses = Mage::getSingleton('oscpproductenquiry/status')->getOptionArray();
149
+
150
+ return $this;
151
+ }
152
+
153
+ /*
154
+ * This is where our row data will get link
155
+ */
156
+ public function getRowUrl($row)
157
+ {
158
+ return $this->getUrl('*/*/edit', array(
159
+ 'id' => $row->getId()
160
+ ));
161
+ }
162
+
163
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Block/Edit.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Block_E extends Mage_Core_Block_Template
10
+ {
11
+ public function _prepareLayout()
12
+ {
13
+ return parent::_prepareLayout();
14
+ }
15
+
16
+ public function getEmbriodary()
17
+ {
18
+ if (!$this->hasData('productenquiry')) {
19
+ $this->setData('productenquiry', Mage::registry('productenquiry_data'));
20
+ }
21
+
22
+ return $this->getData('productenquiry');
23
+ }
24
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Block/ProductEnquiry.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Block_ProductEnquiry extends Mage_Core_Block_Template
10
+ {
11
+
12
+ public function __construct()
13
+ {
14
+ parent::__construct();
15
+
16
+ $this->setTemplate('oscprofessionals/productenquiry/modelform.phtml');
17
+ }
18
+
19
+ /**
20
+ * Prepare global layout
21
+ *
22
+ * @return Oscprofessionals_ProductEnquiry_Block_ProductEnquiry
23
+ */
24
+ protected function _prepareLayout()
25
+ {
26
+ // breadcrumbs
27
+ $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
28
+
29
+ $breadcrumbs->addCrumb('home', array('label' => Mage::helper('oscpproductenquiry')->__('Home'), 'title' => Mage::helper('oscpproductenquiry')->__('Home Page'), 'link' => Mage::getBaseUrl()));
30
+ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
31
+
32
+ $id = explode("/", $this->getRequest()->getParam('id'));
33
+ $product = $this->helper('oscpproductenquiry')->getProduct($id[0]);
34
+ $productName = $product->getName();
35
+
36
+ $breadcrumbs->addCrumb('product', array('label' => $productName, 'title' => $productName, 'link' => $product->getProductUrl()));
37
+
38
+ $breadcrumbs->addCrumb('enquiry', array('label' => 'Ask a Question', 'title' => 'Ask a Question'));
39
+
40
+ $this->getLayout()->getBlock('breadcrumbs')->toHtml();
41
+
42
+ return parent::_prepareLayout();
43
+ }
44
+
45
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Helper/Data.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Helper_Data extends Mage_Core_Helper_Abstract
10
+ {
11
+
12
+ /**
13
+ * Declare Constants
14
+ */
15
+ const XML_PATH_ENQUIRY_NUMBER = 'productenquiry/email/enquiry_number';
16
+
17
+ /**
18
+ * Get product id and return product data
19
+ *
20
+ * return Array
21
+ */
22
+ public function getEnquiryDetails($productId)
23
+ {
24
+ $productenquiryData = array();
25
+ $collection = Mage::getModel('oscpproductenquiry/productenquiry')->getCollection()
26
+ ->addFieldToSelect('question')
27
+ ->addFieldToSelect('is_approved')
28
+ ->addFieldToSelect('product_id')
29
+ ->addFieldToSelect('name')
30
+ ->addFieldToSelect('email')
31
+ ->addFieldToSelect('product_name')
32
+ ->addFieldToSelect('comment')
33
+ ->addFieldToSelect('created_at')
34
+ ->addFieldToSelect('updated_at')
35
+ ->addFieldToFilter('is_approved',array('eq' => 1))
36
+ ->addFieldToFilter('product_id',array('eq' => $productId))
37
+ ->setOrder('updated_at', 'DESC');
38
+ $collection->getSelect()->limit(Mage::getStoreConfig(self::XML_PATH_ENQUIRY_NUMBER));
39
+
40
+ return $collection;
41
+ }
42
+
43
+ /**
44
+ * Get product id and return count
45
+ *
46
+ */
47
+ public function getEnquiryCount($productId)
48
+ {
49
+
50
+ $collection = Mage::getModel('oscpproductenquiry/productenquiry')->getCollection()
51
+ ->addFieldToFilter('product_id', array('eq' => $productId))
52
+ ->addFieldToFilter('is_approved', array('eq' => 1));
53
+
54
+ $enquiryCount = $collection->getSize();
55
+ return $enquiryCount;
56
+ }
57
+
58
+ /**
59
+ * Get product id and return product data
60
+ *
61
+ * return Array
62
+ */
63
+ public function getProduct($productId)
64
+ {
65
+ $collection = Mage::getModel('catalog/product')->load($productId);
66
+ return $collection;
67
+ }
68
+
69
+
70
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Model/Productenquiry.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Model_Productenquiry extends Mage_Core_Model_Abstract
10
+ {
11
+ /**
12
+ * Call Parents _init function
13
+ */
14
+ public function _construct()
15
+ {
16
+ parent::_construct();
17
+ $this->_init('oscpproductenquiry/productenquiry');
18
+ }
19
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Model/Resource/Productenquiry.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Model_Resource_Productenquiry extends Mage_Core_Model_Mysql4_Abstract
10
+ {
11
+ /**
12
+ * Passing Product enquiry Object to Abstract class _init function
13
+ */
14
+ public function _construct()
15
+ {
16
+
17
+ $this->_init('oscpproductenquiry/productenquiry', 'model_id');
18
+ }
19
+
20
+
21
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Model/Resource/Productenquiry/Collection.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Model_Resource_Productenquiry_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
10
+ {
11
+ /**
12
+ * Passing Product enquiry Object to Abstract class _init function
13
+ */
14
+ public function _construct()
15
+ {
16
+ parent::_construct();
17
+ $this->_init('oscpproductenquiry/productenquiry');
18
+ }
19
+ }
app/code/community/Oscprofessionals/ProductEnquiry/Model/Status.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Model_Status extends Varien_Object
10
+ {
11
+ /**
12
+ * Declare Constants
13
+ */
14
+ const STATUS_ENABLED = 1;
15
+ const STATUS_DISABLED = 2;
16
+
17
+ static public function getOptionArray()
18
+ {
19
+ return array(
20
+ self::STATUS_ENABLED => Mage::helper('oscpproductenquiry')->__('Enabled'),
21
+ self::STATUS_DISABLED => Mage::helper('oscpproductenquiry')->__('Disabled')
22
+ );
23
+ }
24
+ }
app/code/community/Oscprofessionals/ProductEnquiry/controllers/AccountController.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ require_once 'Mage/Customer/controllers/AccountController.php';
10
+ class Oscprofessionals_ProductEnquiry_AccountController extends Mage_Customer_AccountController
11
+ {
12
+
13
+ /**
14
+ * Retrieve customer session model object
15
+ *
16
+ * @return Mage_Customer_Model_Session
17
+ */
18
+ protected function _getSession()
19
+ {
20
+ return Mage::getSingleton('customer/session');
21
+ }
22
+
23
+
24
+ /**
25
+ * Customer login form page
26
+ */
27
+ public function loginAction()
28
+ {
29
+ // $controllerName = Mage::app()->getFrontController()->getRequest()->getPost('controller_name', '');
30
+
31
+ //print_r(Mage::app()->getRequest()->getControllerName());exit;
32
+
33
+ if(Mage::app()->getRequest()->getParam('type') == 'enquiry'){
34
+ $request["url"] = $this->getRequest()->getServer('HTTP_REFERER');
35
+ Mage::getSingleton('core/session')->setLastRequest($request["url"]);
36
+ }
37
+
38
+ if ($this->_getSession()->isLoggedIn()) {
39
+ $this->_redirect('*/*/');
40
+ return;
41
+ }
42
+ $this->getResponse()->setHeader('Login-Required', 'true');
43
+ $this->loadLayout();
44
+ $this->_initLayoutMessages('customer/session');
45
+ $this->_initLayoutMessages('catalog/session');
46
+ $this->renderLayout();
47
+ }
48
+
49
+
50
+ /**
51
+ * Define target URL and redirect customer after logging in
52
+ */
53
+ protected function _loginPostRedirect()
54
+ {
55
+ $session = $this->_getSession();
56
+
57
+ if (!$session->getBeforeAuthUrl() || $session->getBeforeAuthUrl() == Mage::getBaseUrl()) {
58
+ // Set default URL to redirect customer to
59
+ $session->setBeforeAuthUrl($this->_getHelper('customer')->getAccountUrl());
60
+ // Redirect customer to the last page visited after logging in
61
+ if ($session->isLoggedIn()) {
62
+ if (!Mage::getStoreConfigFlag(
63
+ Mage_Customer_Helper_Data::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD
64
+ )) {
65
+ $referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME);
66
+ if ($referer) {
67
+ // Rebuild referer URL to handle the case when SID was changed
68
+ $referer = $this->_getModel('core/url')
69
+ ->getRebuiltUrl( $this->_getHelper('core')->urlDecode($referer));
70
+ if ($this->_isUrlInternal($referer)) {
71
+ $session->setBeforeAuthUrl($referer);
72
+ }
73
+ }
74
+ } else if ($session->getAfterAuthUrl()) {
75
+ $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
76
+ }
77
+ } else {
78
+ $session->setBeforeAuthUrl( $this->_getHelper('customer')->getLoginUrl());
79
+ }
80
+ } else if ($session->getBeforeAuthUrl() == $this->_getHelper('customer')->getLogoutUrl()) {
81
+ $session->setBeforeAuthUrl( $this->_getHelper('customer')->getDashboardUrl());
82
+ } else {
83
+ if (!$session->getAfterAuthUrl()) {
84
+ $session->setAfterAuthUrl($session->getBeforeAuthUrl());
85
+ }
86
+ if ($session->isLoggedIn()) {
87
+ $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
88
+ }
89
+ }
90
+ $redirectUrl=Mage::getSingleton('core/session')->getLastRequest();
91
+ //print_r($redirectUrl);exit;
92
+ if($redirectUrl){
93
+ $this->_redirectUrl($redirectUrl);
94
+ Mage::getSingleton('core/session')->unsLastRequest();
95
+ }
96
+ else{
97
+ $this->_redirectUrl($session->getBeforeAuthUrl(true));
98
+ }
99
+ }
100
+
101
+
102
+ }
app/code/community/Oscprofessionals/ProductEnquiry/controllers/Adminhtml/ProductenquiryController.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_Adminhtml_ProductenquiryController extends Mage_Adminhtml_Controller_Action
10
+ {
11
+
12
+ /**
13
+ * Initialize action
14
+ *
15
+ * Here, we set the breadcrumbs and the active menu
16
+ *
17
+ * @return Mage_Adminhtml_Controller_Action
18
+ */
19
+ protected function _initAction()
20
+ {
21
+
22
+ $this->loadLayout()
23
+ ->_setActiveMenu('productenquiry/items')
24
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
25
+
26
+ return $this;
27
+ }
28
+
29
+ /**
30
+ * Load the view for storelocator
31
+ */
32
+ public function indexAction()
33
+ {
34
+
35
+ $this->_initAction()
36
+ ->renderLayout();
37
+ }
38
+
39
+ /**
40
+ * Edit product enquiry data into table
41
+ */
42
+ public function editAction()
43
+ {
44
+ $id = $this->getRequest()->getParam('id');
45
+ $model = Mage::getModel('oscpproductenquiry/productenquiry')->load($id);
46
+
47
+
48
+ if ($model->getId() || $id == 0) {
49
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
50
+ if (!empty($data)) {
51
+ $model->setData($data);
52
+ }
53
+ Mage::register('productenquiry_data', $model);
54
+ $this->loadLayout();
55
+ $this->_setActiveMenu('productenquiry/items');
56
+
57
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Product Enquiry Manager'), Mage::helper('adminhtml')->__('Product Enquiry Manager'));
58
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Product Enquiry News'), Mage::helper('adminhtml')->__('Product Enquiry News'));
59
+
60
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
61
+
62
+ $this->_addContent($this->getLayout()->createBlock('oscpproductenquiry/adminhtml_productenquiry_edit'))
63
+ ->_addLeft($this->getLayout()->createBlock('oscpproductenquiry/adminhtml_productenquiry_edit_tabs'));
64
+
65
+ $this->renderLayout();
66
+ } else {
67
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('oscpproductenquiry')->__('Product Enquiry does not exist'));
68
+ $this->_redirect('*/*/');
69
+ }
70
+ }
71
+
72
+ public function newAction()
73
+ {
74
+ $this->_forward('edit');
75
+ }
76
+
77
+ /**
78
+ * Save product enquiry Data into table
79
+ */
80
+ public function saveAction()
81
+ {
82
+ if ($data = $this->getRequest()->getPost()) {
83
+ $id = (int) $this->getRequest()->getParam('id');
84
+ $model = Mage::getModel('oscpproductenquiry/productenquiry');
85
+
86
+ $model->setData($data)->setId($this->getRequest()->getParam('id'));
87
+ try {
88
+
89
+ if (!$model->getId()) {
90
+ $model->setCreatedAt(now());
91
+ $model->setUpdatedAt(now());
92
+ } else {
93
+ $model->setUpdatedAt(now());
94
+ }
95
+
96
+ $model->save();
97
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('oscpproductenquiry')->__('Item was successfully saved'));
98
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
99
+
100
+ if ($this->getRequest()->getParam('back')) {
101
+ $this->_redirect('*/*/edit', array(
102
+ 'id' => $model->getId()
103
+ ));
104
+ return;
105
+ }
106
+ $this->_redirect('*/*/');
107
+ return;
108
+ } catch (Exception $e) {
109
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
110
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
111
+ $this->_redirect('*/*/edit', array(
112
+ 'id' => $this->getRequest()->getParam('id')
113
+ ));
114
+ return;
115
+ }
116
+ }
117
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('oscpproductenquiry')->__('Unable to find item to save'));
118
+ $this->_redirect('*/*/');
119
+ }
120
+
121
+ /**
122
+ * Delete Single row data frome table
123
+ */
124
+ public function deleteAction()
125
+ {
126
+ if ($this->getRequest()->getParam('id') > 0) {
127
+ try {
128
+ $model = Mage::getModel('oscpproductenquiry/productenquiry')->load($this->getRequest()->getParam('id'));
129
+ $model->delete();
130
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
131
+ $this->_redirect('*/*/');
132
+ } catch (Exception $e) {
133
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
134
+ $this->_redirect('*/*/edit', array(
135
+ 'id' => $this->getRequest()->getParam('id')
136
+ ));
137
+ }
138
+ }
139
+ $this->_redirect('*/*/');
140
+ }
141
+
142
+ /**
143
+ * Delete Multiple rows data frome table
144
+ */
145
+ public function massDeleteAction()
146
+ {
147
+ $productenquiryIds = $this->getRequest()->getParam('productenquiry');
148
+ if (!is_array($productenquiryIds)) {
149
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
150
+ } else {
151
+ try {
152
+ foreach ($productenquiryIds as $productenquiryId) {
153
+ $productenquiry = Mage::getModel('oscpproductenquiry/productenquiry')->load($productenquiryId);
154
+ $productenquiry->delete();
155
+ }
156
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Total of %d record(s) were successfully deleted', count($productenquiryIds)));
157
+ } catch (Exception $e) {
158
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
159
+ }
160
+ }
161
+ $this->_redirect('*/*/index');
162
+ }
163
+
164
+
165
+ /**
166
+ * Export grid to CSV format
167
+ */
168
+ public function exportCsvAction()
169
+ {
170
+ $fileName = 'productenquiry.csv';
171
+ $content = $this->getLayout()->createBlock('oscpproductenquiry/adminhtml_productenquiry_grid')
172
+ ->getCsv();
173
+
174
+ $this->_sendUploadResponse($fileName, $content);
175
+ }
176
+
177
+ public function exportXmlAction()
178
+ {
179
+ $fileName = 'productenquiry.xml';
180
+ $content = $this->getLayout()->createBlock('oscpproductenquiry/adminhtml_productenquiry_grid')
181
+ ->getXml();
182
+
183
+ $this->_sendUploadResponse($fileName, $content);
184
+ }
185
+
186
+ protected function _sendUploadResponse($fileName, $content, $contentType = 'application/octet-stream')
187
+ {
188
+ $response = $this->getResponse();
189
+ $response->setHeader('HTTP/1.1 200 OK', '');
190
+ $response->setHeader('Pragma', 'public', true);
191
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
192
+ $response->setHeader('Content-Disposition', 'attachment; filename=' . $fileName);
193
+ $response->setHeader('Last-Modified', date('r'));
194
+ $response->setHeader('Accept-Ranges', 'bytes');
195
+ $response->setHeader('Content-Length', strlen($content));
196
+ $response->setHeader('Content-type', $contentType);
197
+ $response->setBody($content);
198
+ $response->sendResponse();
199
+ die;
200
+ }
201
+
202
+ protected function _initFile($getRootInstead = false)
203
+ {
204
+ $fileId = (int) $this->getRequest()->getParam('id', false);
205
+ $file = Mage::getModel('oscpproductenquiry/productenquiry');
206
+
207
+ if ($fileId) {
208
+ $file->load($fileId);
209
+ }
210
+
211
+
212
+ Mage::register('file', $file);
213
+ Mage::register('current_file', $file);
214
+ return $file;
215
+ }
216
+
217
+ public function gridAction()
218
+ {
219
+ if (!$category = $this->_initFile(true)) {
220
+ return;
221
+ }
222
+ $this->getResponse()->setBody(
223
+ $this->getLayout()->createBlock('oscpproductenquiry/adminhtml_productenquiry_edit_tab_product')->toHtml()
224
+ );
225
+ }
226
+
227
+ }
app/code/community/Oscprofessionals/ProductEnquiry/controllers/IndexController.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ class Oscprofessionals_ProductEnquiry_IndexController extends Mage_Core_Controller_Front_Action
10
+ {
11
+ /**
12
+ * Declare Constants
13
+ */
14
+ const XML_PATH_EMAIL_RECIPIENT = 'productenquiry/email/recipient_email_sendto';
15
+ const XML_PATH_EMAIL_SENDER = 'productenquiry/email/sender_email_identity_sender';
16
+ const XML_PATH_EMAIL_TEMPLATE = 'productenquiry/email/email_template';
17
+
18
+ /**
19
+ * Load the view for ProductEnquiry
20
+ */
21
+ public function indexAction()
22
+ {
23
+
24
+ $this->loadLayout();
25
+ $this->renderLayout();
26
+ }
27
+
28
+ /**
29
+ * Validate posted data
30
+ */
31
+ public function dataValidation()
32
+ {
33
+ $post = $this->getRequest()->getPost();
34
+ try {
35
+ $error = false;
36
+ if (!Zend_Validate::is(trim($post['name']), 'NotEmpty')) {
37
+ $error = true;
38
+ }
39
+ if (!Zend_Validate::is(trim($post['email']), 'NotEmpty')) {
40
+ $error = true;
41
+ }
42
+
43
+ if (!Zend_Validate::is(trim($post['question']), 'NotEmpty')) {
44
+ $error = true;
45
+ }
46
+
47
+ if ($error) {
48
+ throw new Exception();
49
+ }
50
+ return;
51
+ } catch (Exception $e) {
52
+ return;
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Form post action
58
+ */
59
+ public function postAction()
60
+ {
61
+
62
+ $post = $this->getRequest()->getPost();
63
+
64
+ $model = Mage::getModel('oscpproductenquiry/productenquiry');
65
+ $model->setData($post);
66
+ $model->setCreatedAt(now());
67
+ $model->setUpdatedAt(now());
68
+
69
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
70
+ $customerId = Mage::getModel('customer/session')->getCustomer()->getId();
71
+ $model->setCustomerId($customerId);
72
+ }
73
+
74
+ $model->save();
75
+
76
+ $translate = Mage::getSingleton('core/translate');
77
+ $emailTemplateDelivery = Mage::getModel('core/email_template')
78
+ ->loadDefault('productenquiry_pucemail_email_template');
79
+
80
+ try {
81
+ $postObject = new Varien_Object();
82
+ $postObject->setData($post);
83
+
84
+ $error = false;
85
+
86
+ if (!Zend_Validate::is(trim($post['name']), 'NotEmpty')) {
87
+ $error = true;
88
+ }
89
+
90
+ if (!Zend_Validate::is(trim($post['email']), 'NotEmpty')) {
91
+ $error = true;
92
+ }
93
+
94
+ if (!Zend_Validate::is(trim($post['question']), 'NotEmpty')) {
95
+ $error = true;
96
+ }
97
+
98
+ if ($error) {
99
+ throw new Exception();
100
+ }
101
+
102
+
103
+ $mailTemplate = Mage::getModel('core/email_template');
104
+ echo __line__;
105
+
106
+ $mailTemplate->setDesignConfig(array('area' => 'frontend'))
107
+ ->setReplyTo($post['email'])
108
+ ->sendTransactional(
109
+ Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE), Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER), Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT), null, array('data' => $postObject)
110
+ );
111
+
112
+ Mage::getSingleton('core/session')->addSuccess(Mage::helper('oscpproductenquiry')->__('Your question was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
113
+
114
+ $this->_redirectUrl(Mage::getBaseUrl() . "productenquiry/index/index/id/" . $post['product_id']);
115
+
116
+ return;
117
+ } catch (Exception $e) {
118
+ echo $e;
119
+ exit;
120
+ $translate->setTranslateInline(true);
121
+ Mage::getSingleton('core/session')->addError(Mage::helper('oscpproductenquiry')->__('Unable to submit your request. Please, check all required fields'));
122
+ $this->_redirectUrl(Mage::getBaseUrl() . 'productenquiry?id=' . $post['product_id']);
123
+ return;
124
+ }
125
+ }
126
+
127
+ }
app/code/community/Oscprofessionals/ProductEnquiry/etc/adminhtml.xml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ *
5
+ * @category Oscprofessionals
6
+ * @package Oscprofessionals_ProductEnquiry
7
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
8
+ *
9
+ */
10
+ -->
11
+ <config>
12
+ <menu>
13
+ <productenquiry module="oscpproductenquiry">
14
+ <title>Product Enquiry</title>
15
+ <sort_order>71</sort_order>
16
+ <action>productenquiry/adminhtml_productenquiry</action>
17
+ <children>
18
+ <products translate="title" module="oscpproductenquiry">
19
+ <title>Product Enquiry</title>
20
+ <sort_order>1</sort_order>
21
+ <action>productenquiry/adminhtml_productenquiry</action>
22
+ </products>
23
+ <productenquiry_conf translate="title" module="oscpproductenquiry">
24
+ <title>Settings</title>
25
+ <sort_order>2</sort_order>
26
+ <action>adminhtml/system_config/edit/section/productenquiry</action>
27
+ </productenquiry_conf>
28
+ </children>
29
+ </productenquiry>
30
+ </menu>
31
+ <acl>
32
+ <resources>
33
+ <all>
34
+ <title>Allow Everything</title>
35
+ </all>
36
+ <admin>
37
+ <children>
38
+ <productenquiry translate="title" module="oscpproductenquiry">
39
+ <title>Productenquiry</title>
40
+ <children>
41
+ <productenquiry translate="title" module="oscpproductenquiry">
42
+ <title>Productenquiry</title>
43
+ <sort_order>30</sort_order>
44
+ </productenquiry>
45
+ </children>
46
+ </productenquiry>
47
+ <system>
48
+ <children>
49
+ <config>
50
+ <children>
51
+ <productenquiry translate="title" module="oscpproductenquiry">
52
+ <title>Oscprofessionals Product Enquiry</title>
53
+ </productenquiry>
54
+ </children>
55
+ </config>
56
+ </children>
57
+ </system>
58
+ </children>
59
+ </admin>
60
+ </resources>
61
+ </acl>
62
+ </config>
app/code/community/Oscprofessionals/ProductEnquiry/etc/config.xml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ *
5
+ * @category Oscprofessionals
6
+ * @package Oscprofessionals_ProductEnquiry
7
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
8
+ *
9
+ */
10
+ -->
11
+ <config>
12
+ <modules>
13
+ <Oscprofessionals_ProductEnquiry>
14
+ <version>1.0.0</version>
15
+ </Oscprofessionals_ProductEnquiry>
16
+ </modules>
17
+ <frontend>
18
+ <routers>
19
+ <customer>
20
+ <args>
21
+ <modules>
22
+ <Oscprofessionals_ProductEnquiry before="Mage_Customer">Oscprofessionals_ProductEnquiry</Oscprofessionals_ProductEnquiry>
23
+ </modules>
24
+ </args>
25
+ </customer>
26
+ </routers>
27
+ <layout>
28
+ <updates>
29
+ <productenquiry>
30
+ <file>oscprofessionals/productenquiry.xml</file>
31
+ </productenquiry>
32
+ </updates>
33
+ </layout>
34
+ </frontend>
35
+ <admin>
36
+ <routers>
37
+ <productenquiry>
38
+ <use>admin</use>
39
+ <args>
40
+ <module>Oscprofessionals_ProductEnquiry</module>
41
+ <frontName>productenquiry</frontName>
42
+ </args>
43
+ </productenquiry>
44
+ </routers>
45
+ </admin>
46
+ <adminhtml>
47
+ <layout>
48
+ <updates>
49
+ <productenquiry>
50
+ <file>oscprofessionals/productenquiry.xml</file>
51
+ </productenquiry>
52
+ </updates>
53
+ </layout>
54
+ </adminhtml>
55
+ <global>
56
+ <models>
57
+ <oscpproductenquiry>
58
+ <class>Oscprofessionals_ProductEnquiry_Model</class>
59
+ <resourceModel>oscpproductenquiry_resource</resourceModel>
60
+ </oscpproductenquiry>
61
+ <oscpproductenquiry_resource>
62
+ <class>Oscprofessionals_ProductEnquiry_Model_Resource</class>
63
+ <entities>
64
+ <productenquiry>
65
+ <table>product_enquiry</table>
66
+ </productenquiry>
67
+ </entities>
68
+ </oscpproductenquiry_resource>
69
+ </models>
70
+ <resources>
71
+ <productenquiry_setup>
72
+ <setup>
73
+ <module>Oscprofessionals_ProductEnquiry</module>
74
+ </setup>
75
+ <connection>
76
+ <use>core_setup</use>
77
+ </connection>
78
+ </productenquiry_setup>
79
+ <productenquiry_write>
80
+ <connection>
81
+ <use>core_write</use>
82
+ </connection>
83
+ </productenquiry_write>
84
+ <productenquiry_read>
85
+ <connection>
86
+ <use>core_read</use>
87
+ </connection>
88
+ </productenquiry_read>
89
+ </resources>
90
+ <blocks>
91
+ <oscpproductenquiry>
92
+ <class>Oscprofessionals_ProductEnquiry_Block</class>
93
+ </oscpproductenquiry>
94
+ </blocks>
95
+ <helpers>
96
+ <oscpproductenquiry>
97
+ <class>Oscprofessionals_ProductEnquiry_Helper</class>
98
+ </oscpproductenquiry>
99
+ </helpers>
100
+ <template>
101
+ <email>
102
+ <productenquiry_email_email_template translate="label" module="productenquiry">
103
+ <label>Product Enquiry Form</label>
104
+ <file>oscprofessionals/productenquiry.html</file>
105
+ <type>html</type>
106
+ </productenquiry_email_email_template>
107
+ </email>
108
+ </template>
109
+ </global>
110
+ <default>
111
+ <productenquiry>
112
+ <email>
113
+ <recipient_email_sendto><![CDATA[hello@example.com]]></recipient_email_sendto>
114
+ <sender_email_identity_sender>custom2</sender_email_identity_sender>
115
+ <email_template>productenquiry_email_email_template</email_template>
116
+ <enquiry_number>3</enquiry_number>
117
+ </email>
118
+ </productenquiry>
119
+ </default>
120
+ </config>
app/code/community/Oscprofessionals/ProductEnquiry/etc/system.xml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ *
5
+ * @category Oscprofessionals
6
+ * @package Oscprofessionals_ProductEnquiry
7
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
8
+ *
9
+ */
10
+ -->
11
+ <config>
12
+ <tabs>
13
+ <oscprofessionals translate="label" module="oscpproductenquiry">
14
+ <label>Oscprofessionals</label>
15
+ <sort_order>1000</sort_order>
16
+ </oscprofessionals>
17
+ </tabs>
18
+ <sections>
19
+ <productenquiry translate="label" module="oscpproductenquiry">
20
+ <label>Product Enquiry</label>
21
+ <tab>oscprofessionals</tab>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>100</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
+ <email translate="label">
29
+ <label>Email Options</label>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>50</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <fields>
36
+ <recipient_email_sendto translate="label">
37
+ <label>Send Emails To</label>
38
+ <frontend_type>text</frontend_type>
39
+ <validate>validate-email</validate>
40
+ <sort_order>10</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </recipient_email_sendto>
45
+ <sender_email_identity_sender translate="label">
46
+ <label>Email Sender</label>
47
+ <frontend_type>select</frontend_type>
48
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
49
+ <sort_order>20</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </sender_email_identity_sender>
54
+ <email_template_catalogue translate="label">
55
+ <label>Email Template</label>
56
+ <frontend_type>select</frontend_type>
57
+ <source_model>adminhtml/system_config_source_email_template</source_model>
58
+ <sort_order>30</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </email_template_catalogue>
63
+ <enquiry_number translate="label">
64
+ <label>Number of enquiry which you want to display on product page</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>40</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>1</show_in_store>
70
+ <comment>Enter number. </comment>
71
+ </enquiry_number>
72
+ </fields>
73
+ </email>
74
+ </groups>
75
+ </productenquiry>
76
+ </sections>
77
+ </config>
app/code/community/Oscprofessionals/ProductEnquiry/sql/productenquiry_setup/install-1.0.0.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ $installer = $this;
10
+ /* @var $installer Mage_Core_Model_Resource_Setup */
11
+
12
+ $installer->startSetup();
13
+ $installer->run("
14
+ DROP TABLE IF EXISTS `{$installer->getTable('product_enquiry')}`;
15
+ CREATE TABLE `{$installer->getTable('product_enquiry')}` (
16
+ `model_id` int(11) unsigned NOT NULL auto_increment COMMENT 'Model ID',
17
+ `product_id` int(11) default NULL,
18
+ `name` varchar(50) default NULL,
19
+ `customer_id` int(11) default NULL,
20
+ `email` varchar(150) default NULL COMMENT 'Email Address',
21
+ `question` text default NULL,
22
+ `comment` text default NULL,
23
+ `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
24
+ `updated_at` datetime NOT NULL default '0000-00-00 00:00:00',
25
+ `is_approved` int(11) default 0,
26
+ `product_name` varchar(255) default NULL,
27
+ PRIMARY KEY (`model_id`)
28
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;");
29
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/oscprofessionals/productenquiry.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ *
5
+ * @category Oscprofessionals
6
+ * @package Oscprofessionals_ProductEnquiry
7
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
8
+ *
9
+ */
10
+ -->
11
+ <layout version="0.1.0">
12
+ <productenquiry_adminhtml_productenquiry_index>
13
+ <reference name="content">
14
+ <block type="oscpproductenquiry/adminhtml_productenquiry" name="productenquiry" />
15
+ </reference>
16
+ </productenquiry_adminhtml_productenquiry_index>
17
+ </layout>
app/design/adminhtml/default/default/template/oscprofessionals/productenquiry/form.phtml ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $block = $this->getLayout()->getBlock('category.product.grid');
3
+ $_gridJsObject='fileuploader_fileuploader_productsJsObject';//$this->getJsObjectName();
4
+ ?>
5
+
6
+
7
+ <script type="text/javascript">
8
+ //<![CDATA[
9
+ var fileProducts = $H(<?php echo $this->getProductsJson() ?>);
10
+ $('in_file_products').value = fileProducts.toQueryString();
11
+
12
+ function registerCategoryProduct(grid, element, checked){
13
+ if(checked){
14
+ if(element.positionElement){
15
+ element.positionElement.disabled = false;
16
+ }
17
+ fileProducts.set(element.value, 0);
18
+ }
19
+ else{
20
+ if(element.positionElement){
21
+ element.positionElement.disabled = true;
22
+ }
23
+ fileProducts.unset(element.value);
24
+ }
25
+ $('in_file_products').value = fileProducts.toQueryString();
26
+ grid.reloadParams = {'selected_products[]':fileProducts.keys()};
27
+ }
28
+ function categoryProductRowClick(grid, event){
29
+ var trElement = Event.findElement(event, 'tr');
30
+ var isInput = Event.element(event).tagName == 'INPUT';
31
+ if(trElement){
32
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
33
+ if(checkbox[0]){
34
+ fileuploader_product_id = checkbox[0].value;
35
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
36
+ <?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);
37
+ }
38
+ }
39
+ }
40
+ function positionChange(event){
41
+ var element = Event.element(event);
42
+ if(element && element.checkboxElement && element.checkboxElement.checked){
43
+ fileProducts.set(element.checkboxElement.value, element.value);
44
+ $('in_file_products').value = fileProducts.toQueryString();
45
+ }
46
+ }
47
+
48
+ var tabIndex = 1000;
49
+ function categoryProductRowInit(grid, row){
50
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
51
+ var position = $(row).getElementsByClassName('input-text')[0];
52
+ if(checkbox && position){
53
+ checkbox.positionElement = position;
54
+ position.checkboxElement = checkbox;
55
+ position.disabled = !checkbox.checked;
56
+ position.tabIndex = tabIndex++;
57
+ Event.observe(position,'keyup',positionChange);
58
+ }
59
+ }
60
+ <?php echo $_gridJsObject ?>.rowClickCallback = categoryProductRowClick;
61
+ <?php echo $_gridJsObject ?>.initRowCallback = categoryProductRowInit;
62
+ <?php echo $_gridJsObject ?>.checkboxCheckCallback = registerCategoryProduct;
63
+ <?php echo $_gridJsObject ?>.rows.each(function(row){categoryProductRowInit( <?php echo $_gridJsObject ?>, row)});
64
+ //]]>
65
+ </script>
66
+ <h1><?php ?></h1>
app/design/frontend/base/default/layout/oscprofessionals/productenquiry.xml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ *
5
+ * @category Oscprofessionals
6
+ * @package Oscprofessionals_ProductEnquiry
7
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
8
+ *
9
+ */
10
+ -->
11
+ <layout version="0.1.0">
12
+ <productenquiry_index_index>
13
+ <reference name="root">
14
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
15
+ </reference>
16
+ <reference name="head">
17
+ <action method="setTitle" translate="title" module="oscpproductenquiry"><title>Product Enquiry</title></action>
18
+ </reference>
19
+ <reference name="content">
20
+ <block type="oscpproductenquiry/productEnquiry" name="productenquiry" />
21
+ </reference>
22
+ </productenquiry_index_index>
23
+ <catalog_product_view>
24
+ <reference name="content">
25
+ <block type="core/template" name="enquiry_display" as= "enquiry_display" template="oscprofessionals/productenquiry/enquirydisplay.phtml" />
26
+ </reference>
27
+ <reference name="head">
28
+ <action method="addCss"><stylesheet>css/oscprofessionals/productenquiry/productenquiry.css</stylesheet></action>
29
+ </reference>
30
+ </catalog_product_view>
31
+ </layout>
app/design/frontend/base/default/template/oscprofessionals/productenquiry/enquirydisplay.phtml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ ?>
10
+ <?php $_customer = Mage::getSingleton('customer/session')->isLoggedIn();?>
11
+ <?php $_customerId = Mage::helper('customer')->getCustomer()->getId();?>
12
+ <?php $_customerName = Mage::helper('customer')->getCustomerName();?>
13
+ <?php $_currentProduct = Mage::registry('current_product'); ?>
14
+ <?php $_productId = $_currentProduct->getId(); ?>
15
+ <div class="collapsible mobile-collapsible">
16
+ <h1 class="block-title heading"><?php echo $this->__('Questions About :'); ?>
17
+ <?php echo $_productName = $_currentProduct->getName(); ?>
18
+ <span><?php $_enquiryCount = Mage::helper('oscpproductenquiry')->getEnquiryCount($_productId); ?>
19
+ <?php echo '(' . $_enquiryCount . ')'; ?></span>
20
+ </h1>
21
+ <div class="block-content">
22
+ <p><?php echo $this->__('We\'re here to help: to ask a question click'); ?>&nbsp;<a href="<?php if ($_customer): ?><?php echo $this->getUrl("productenquiry/index/index/", array('id' => $_productId)) ?><?php else: ?><?php echo $this->getUrl("customer/account/login/type/enquiry"); ?><?php endif; ?>"><?php echo $this->__('here'); ?></a><?php echo $this->__('. We\'ll post it on this page once our review team gives it the go-ahead.'); ?></p>
23
+ <input type="hidden" value="<?php $_currentProduct->getId(); ?>"/>
24
+ <?php $_productEnquiry = Mage::helper('oscpproductenquiry')->getEnquiryDetails($_productId);?>
25
+
26
+ <?php foreach ($_productEnquiry as $_collectionItem):?>
27
+ <div class="ask-question-post">
28
+ <div class="create-post">
29
+ <?php
30
+ $_createdDate = explode(" ", $_collectionItem->getUpdatedAt());
31
+ @list($_year, $_date, $_month) = explode('-', $_createdDate[0]);
32
+ $_today = date("d M Y", mktime(0, 0, 0, $_date, $_month, $_year));
33
+ ?>
34
+ <div class="cust-name"><?php echo $_collectionItem->getName(); ?><span class="date"><?php echo $this->__('Date: '); ?><?php echo $_today; ?></span></div>
35
+ <!-- <div class="date"><?php echo $_today; ?></div> -->
36
+ <div class="comment"><?php echo $this->__('Q: '); ?><?php echo $_collectionItem->getQuestion(); ?></div>
37
+ <?php if ($_collectionItem->getComment() != ''): ?>
38
+ <div class="cust-name"><?php echo $this->__('Store Owner '); ?></div>
39
+ <div class="comment"><?php echo $this->__('Answer: '); ?><?php echo $_collectionItem->getComment(); ?></div>
40
+ <?php endif ?>
41
+ </div>
42
+ </div>
43
+ <?php endforeach; ?>
44
+ </div>
45
+ </div>
app/design/frontend/base/default/template/oscprofessionals/productenquiry/enquirydisplay.phtml_org ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ ?>
10
+ <?php $_customer = Mage::getSingleton('customer/session')->isLoggedIn();?>
11
+ <?php $_customerId = Mage::helper('customer')->getCustomer()->getId();?>
12
+ <?php $_customerName = Mage::helper('customer')->getCustomerName();?>
13
+ <?php $_currentProduct = Mage::registry('current_product'); ?>
14
+ <?php $_productId = $_currentProduct->getId(); ?>
15
+ <div class="collapsible mobile-collapsible">
16
+ <h1 class="block-title heading"><?php echo $this->__('Questions About :'); ?>
17
+ <?php echo $_productName = $_currentProduct->getName(); ?>
18
+ <span><?php $_enquiryCount = Mage::helper('oscpproductenquiry')->getEnquiryCount($_productId); ?>
19
+ <?php echo '(' . $_enquiryCount . ')'; ?></span>
20
+ </h1>
21
+ <div class="block-content">
22
+ <p><?php echo $this->__('We\'re here to help: to ask a question click'); ?>&nbsp;<a href="<?php if ($_customer): ?><?php echo $this->getUrl("productenquiry/index/index/", array('id' => $_productId)) ?><?php else: ?><?php echo $this->getUrl("customer/account/login/"); ?><?php endif; ?>"><?php echo $this->__('here'); ?></a><?php echo $this->__('. We\'ll post it on this page once our review team gives it the go-ahead.'); ?></p>
23
+ <input type="hidden" value="<?php $_currentProduct->getId(); ?>"/>
24
+ <?php $_productEnquiry = Mage::helper('oscpproductenquiry')->getEnquiryDetails($_productId);?>
25
+
26
+ <?php foreach ($_productEnquiry as $_collectionItem):?>
27
+ <div class="ask-question-post">
28
+ <div class="create-post">
29
+ <?php
30
+ $_createdDate = explode(" ", $_collectionItem->getUpdatedAt());
31
+ @list($_year, $_date, $_month) = explode('-', $_createdDate[0]);
32
+ $_today = date("d M Y", mktime(0, 0, 0, $_date, $_month, $_year));
33
+ ?>
34
+ <div class="cust-name"><?php echo $_collectionItem->getName(); ?></div>
35
+ <div class="date"><?php echo $_today; ?></div>
36
+ <div class="comment"><?php echo $_collectionItem->getQuestion(); ?></div>
37
+ </div>
38
+ </div>
39
+ <?php endforeach; ?>
40
+ </div>
41
+ </div>
app/design/frontend/base/default/template/oscprofessionals/productenquiry/modelform.phtml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ ?>
10
+ <?php $_loginStatus = Mage::getSingleton('customer/session')->isLoggedIn(); ?>
11
+ <?php if ($_loginStatus) : ?>
12
+ <?php /* Get the customer data */ ?>
13
+ <?php $_customer = Mage::getSingleton('customer/session')->getCustomer(); ?>
14
+ <?php endif; ?>
15
+ <?php
16
+ $_id = explode("/", $this->getRequest()->getParam('id'));
17
+ $_product = $this->helper('oscpproductenquiry')->getProduct($_id[0]);
18
+ $_productName=$_product->getName();?>
19
+ <?php
20
+ $_breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
21
+ $_breadcrumbs->addCrumb('home', array('label'=>Mage::helper('cms')->__('Home'), 'title'=>Mage::helper('cms')->__('Home Page'), 'link'=>Mage::getBaseUrl()));
22
+ $_breadcrumbs->addCrumb('product', array('label'=>$_productName, 'title'=>$_productName, 'link'=>$_product->getProductUrl()));
23
+ $_breadcrumbs->addCrumb('enquiry', array('label'=>'Ask a Question', 'title'=>'Ask a Question'));
24
+ echo $this->getLayout()->getBlock('breadcrumbs')->toHtml();
25
+ ?>
26
+ <?php $_productEnquiry= Mage::helper('oscpproductenquiry')->getEnquiryDetails($_id[0]);?>
27
+ <div class="product-enq-block">
28
+ <form action="<?php echo $this->getUrl('productenquiry/index/post/');?>" id="modelForm" name="modelForm" method="post" enctype="multipart/form-data">
29
+ <div class="product-enq-title">
30
+ <h1><?php echo $this->__('You are asking a Question About :');?>
31
+ <?php echo $_product->getName();?>
32
+ </h1>
33
+ <p><?php echo $this->__('We&apos;re here to help. We&apos;ll post it on this product page once our review team gives it the go-ahead.');?>
34
+ </p>
35
+ <input type="hidden" name="product_id" value="<?php echo $_id[0];?>"/>
36
+ <input type="hidden" name="product_name" value="<?php echo $_productName;?>"/>
37
+ </div>
38
+ <div class="other-content ">
39
+ <div class="contact-details">
40
+ <div class="field">
41
+ <label for="name" class="text required"><?php echo Mage::helper('oscpproductenquiry')->__('Name') ?><em>*</em></label>
42
+ <div class="input-box">
43
+ <input name="name" id="name" value="<?php if ($_loginStatus): ?><?php echo $this->htmlEscape($_customer->getFirstname()); ?><?php else: ?><?php echo $this->htmlEscape(''); ?><?php endif ?>" title="<?php echo Mage::helper('oscpproductenquiry')->__('Name') ?>" class="input-text required-entry" type="text" />
44
+ </div>
45
+ </div>
46
+ <div class="field">
47
+ <label for="email" class="required"><?php echo Mage::helper('oscpproductenquiry')->__('Email Address') ?><em>*</em></label>
48
+ <div class="input-box">
49
+ <input name="email" id="email" value="<?php if ($_loginStatus): ?><?php echo $this->htmlEscape($_customer->getEmail()); ?><?php else: ?><?php echo $this->htmlEscape(''); ?><?php endif ?>" title="<?php echo Mage::helper('oscpproductenquiry')->__('Email Address ') ?>" class="input-text required-entry validate-email" type="text" />
50
+ </div>
51
+ </div>
52
+ <div class="field">
53
+ <label for="question" class="text required"><?php echo Mage::helper('oscpproductenquiry')->__('Question') ?><em>*</em></label>
54
+ <div class="input-box">
55
+ <textarea name="question" id="question" title="<?php echo Mage::helper('oscpproductenquiry')->__('Question') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ <div class="button-set">
60
+ <button type="submit" title="<?php echo Mage::helper('oscpproductenquiry')->__('Send Question') ?>" class="button"><span><span><?php echo Mage::helper('oscpproductenquiry')->__('Send Question') ?></span></span></button>
61
+ </div>
62
+ <p class="required"><span>*</span><?php echo Mage::helper('oscpproductenquiry')->__('Required fields') ?></p>
63
+ <div style="clear:both; height:0;"></div>
64
+ </div>
65
+ </form>
66
+ </div>
67
+ <div class="upsell-block">
68
+ <?php $upsell_product = $_product->getUpSellProductCollection()->addStoreFilter();
69
+ $count = count($upsell_product);?>
70
+ <div class="box-collateral box-up-sell">
71
+ <div class="box-title">
72
+ <?php if($count): ?>
73
+ <h2><?php echo $this->__('Customers Also Bought') ?></h2>
74
+ <?php endif; ?>
75
+ </div>
76
+ <ul class="products-grid">
77
+ <?php $i=0;
78
+ $_counter=0;
79
+ foreach ($upsell_product as $_upsell): ?>
80
+ <?php
81
+ if($_counter>2):
82
+ break;?>
83
+ <?php endif; ?>
84
+ <li class="item<?php if (($i - 1) % $this->getColumnCount() == 0):?> first<?php elseif ($i % $this->getColumnCount() == 0):?> last<?php endif;?>">
85
+ <?php
86
+ $upsp = $this->helper('oscpproductenquiry')->getProduct($_upsell->getId());?>
87
+ <a href="<?php echo $upsp->getProductUrl() ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($upsp, 'small_image')->resize(148) ?>" alt="<?php echo $this->escapeHtml($upsp->getName()) ?>" title="<?php echo $this->escapeHtml($upsp->getName()) ?>" /></a>
88
+ </li>
89
+ <?php $_counter++; ?>
90
+ <?php endforeach; ?>
91
+ </ul>
92
+ </div>
93
+ </div>
94
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
95
+ <script type="text/javascript">
96
+ //<![CDATA[
97
+ var modelForm = new VarienForm('modelForm', true);
98
+ //]]>
99
+ </script>
100
+ <script type="text/javascript">
101
+ jQuery(document).ready(function(){
102
+ productbreadcrumb();
103
+ });
104
+ function productbreadcrumb() {
105
+ var bread = jQuery('.breadcrumbs').html();
106
+ jQuery('.breadcrumbs').remove();
107
+ jQuery('.delivery-icons').before('<div class="breadcrumbs">'+bread+'</div>');
108
+ }
109
+ //]]>
110
+ </script>
app/design/frontend/base/default/template/oscprofessionals/productenquiry/org_modelform.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Oscprofessionals
5
+ * @package Oscprofessionals_ProductEnquiry
6
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
7
+ *
8
+ */
9
+ ?>
10
+ <?php $_loginStatus = Mage::getSingleton('customer/session')->isLoggedIn(); ?>
11
+ <?php if ($_loginStatus) : ?>
12
+ <?php /* Get the customer data */ ?>
13
+ <?php $_customer = Mage::getSingleton('customer/session')->getCustomer(); ?>
14
+ <?php endif; ?>
15
+ <?php $_id = explode("/", $this->getRequest()->getParam('id'));?>
16
+ <?php $_product = $this->helper('oscpproductenquiry')->getProduct($_id[0]);?>
17
+ <?php $_productName = $_product->getName();?>
18
+ <?php $_productEnquiry = Mage::helper('oscpproductenquiry')->getEnquiryDetails($_product->getId()); ?>
19
+ <div class="product-enq-block">
20
+ <form action="<?php echo $this->getUrl('productenquiry/index/post/'); ?>" id="modelForm" name="modelForm" method="post" enctype="multipart/form-data">
21
+ <div class="product-enq-title">
22
+ <h1><?php echo $this->__('You are asking a Question About :'); ?>
23
+ <?php echo $_product->getName(); ?>
24
+ </h1>
25
+ <p><?php echo $this->__('We&apos;re here to help. We&apos;ll post it on this product page once our review team gives it the go-ahead.'); ?>
26
+ </p>
27
+ <input type="hidden" name="product_id" value="<?php echo $_id[0]; ?>"/>
28
+ <input type="hidden" name="product_name" value="<?php echo $_productName; ?>"/>
29
+ </div>
30
+ <div class="other-content ">
31
+ <div class="contact-details">
32
+ <div class="field">
33
+ <label for="name" class="text required"><?php echo Mage::helper('oscpproductenquiry')->__('Name') ?><em>*</em></label>
34
+ <div class="input-box">
35
+ <input name="name" id="name" value="<?php if ($_loginStatus): ?><?php echo $this->htmlEscape($_customer->getFirstname()); ?><?php else: ?><?php echo $this->htmlEscape(''); ?><?php endif ?>" title="<?php echo Mage::helper('oscpproductenquiry')->__('Name') ?>" class="input-text required-entry" type="text" />
36
+ </div>
37
+ </div>
38
+ <div class="field">
39
+ <label for="email" class="required"><?php echo Mage::helper('oscpproductenquiry')->__('Email Address') ?><em>*</em></label>
40
+ <div class="input-box">
41
+ <input name="email" id="email" value="<?php if ($_loginStatus): ?><?php echo $this->htmlEscape($_customer->getEmail()); ?><?php else: ?><?php echo $this->htmlEscape(''); ?><?php endif ?>" title="<?php echo Mage::helper('oscpproductenquiry')->__('Email Address ') ?>" class="input-text required-entry validate-email" type="text" />
42
+ </div>
43
+ </div>
44
+ <div class="field">
45
+ <label for="question" class="text required"><?php echo Mage::helper('oscpproductenquiry')->__('Question') ?><em>*</em></label>
46
+ <div class="input-box">
47
+ <textarea name="question" id="question" title="<?php echo Mage::helper('oscpproductenquiry')->__('Question') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <div class="button-set">
52
+ <button type="submit" title="<?php echo Mage::helper('oscpproductenquiry')->__('Send Question') ?>" class="button"><span><span><?php echo Mage::helper('oscpproductenquiry')->__('Send Question') ?></span></span></button>
53
+ </div>
54
+ <p class="required"><span>*</span><?php echo Mage::helper('oscpproductenquiry')->__('Required fields') ?></p>
55
+ <div style="clear:both; height:0;"></div>
56
+ </div>
57
+ </form>
58
+ </div>
59
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd', 'even', 'first', 'last'])</script>
60
+ <script type="text/javascript">
61
+ //<![CDATA[
62
+ var modelForm = new VarienForm('modelForm', true);
63
+ //]]>
64
+ </script>
app/etc/modules/Oscprofessionals_ProductEnquiry.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ *
5
+ * @category Oscprofessionals
6
+ * @package Oscprofessionals_ProductEnquiry
7
+ * @author Oscprofessionals Team<oscpteam@oscprofessionals.com>
8
+ *
9
+ */
10
+ -->
11
+ <config>
12
+ <modules>
13
+ <Oscprofessionals_ProductEnquiry>
14
+ <active>true</active>
15
+ <codePool>community</codePool>
16
+ </Oscprofessionals_ProductEnquiry>
17
+ </modules>
18
+ </config>
app/locale/en_US/template/email/oscprofessionals/productenquiry.html ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Product Enquiry Form @-->
2
+
3
+
4
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
5
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
6
+ <table>
7
+ <tr>
8
+ <td>
9
+ First Name: {{var data.name}}
10
+ </td>
11
+ </tr>
12
+ <tr>
13
+ <td>
14
+ Email Address :{{var data.email}}
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <td>
19
+ Question: {{var data.question}}
20
+ </td>
21
+ </tr>
22
+ </div>
23
+
24
+ </table>
25
+ </div>
26
+ </body>
package.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Oscprofessionals_ProductEnquires</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>While buying product online, mostly customers have many doubt and questions and no one is present there physically to answer their questions, many customer do not prefer to purchase the product if they have any doubt regarding the product. Thus to resolve this problem, product Enquiry extension is used.</summary>
10
+ <description>With this product Enquiry Magento Extension, customer can submit Enquiry and ask question about any product. &#xD;
11
+ &#xD;
12
+ While buying product online, mostly customers have many doubt and questions and no one is present there physically to answer their questions, many customer do not prefer to purchase the product if they have any doubt regarding the product.&#xD;
13
+ &#xD;
14
+ Thus to resolve this problem, product Enquiry extension is used. Its act same like your customer care center for your online shopping. If the customer satisfies by getting their question&#x2019;s answered, customer won&#x2019;t hesitate to buy the product. &#xD;
15
+ &#xD;
16
+ This feature is added to delight the customer by adding the additional advantage by solving the queries and questions of customers. It simplifies the decision making of the customer about the product.</description>
17
+ <notes>There are no uploaded releases</notes>
18
+ <authors><author><name>Satish Mantri</name><user>satish</user><email>satish@oscprofessionals.com</email></author></authors>
19
+ <date>2015-04-01</date>
20
+ <time>15:09:32</time>
21
+ <contents><target name="magecommunity"><dir name="Oscprofessionals"><dir name="ProductEnquiry"><dir name="Block"><dir name="Adminhtml"><dir name="Productenquiry"><dir name="Edit"><file name="Form.php" hash="70768798a3db6e9cb3edd4377881fa92"/><dir name="Tab"><file name="Form.php" hash="723e37cc0fa286601de06b8ae7b9551c"/></dir><file name="Tabs.php" hash="d6e6c2b95d060e0a0a0a8be8dd1125f5"/></dir><file name="Edit.php" hash="23c67db7f45d9d9956630626327128a9"/><file name="Grid.php" hash="463d3c3f95251a5e6444a13d2a321a73"/></dir><file name="Productenquiry.php" hash="fdf956dba08ee02b01915895973e93fb"/></dir><file name="Edit.php" hash="f9397d803d5bb83b36b0b7ceb778fe8b"/><file name="ProductEnquiry.php" hash="9c63a502eefa900ce571cf1e77cf1cfb"/></dir><dir name="Helper"><file name="Data.php" hash="8ab80570c33a90b8a545c863e809c5a0"/></dir><dir name="Model"><file name="Productenquiry.php" hash="f6fd15fbf336ac37fe5bc81a8e853889"/><dir name="Resource"><dir name="Productenquiry"><file name="Collection.php" hash="019681b27898cf314b2751c078773b1a"/></dir><file name="Productenquiry.php" hash="3152358b1c892d7b92a5e2f4b4a75acc"/></dir><file name="Status.php" hash="c42d1ef7fb9fc041c9b2946c0c54b2f6"/></dir><dir name="controllers"><file name="AccountController.php" hash="5de18bc851c5ff640517d73798ed5106"/><dir name="Adminhtml"><file name="ProductenquiryController.php" hash="3744dd7ff3bcb791416d0d67b941888a"/></dir><file name="IndexController.php" hash="9572324f64bd635898542f11e8274d5a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5bca418cc8f6229b0c2f0d8cac6e93fa"/><file name="config.xml" hash="9dad82b1e8617ca4266baeaac0a2a5c9"/><file name="system.xml" hash="64c22bf0c2efa83af3449b6f8d8349c1"/></dir><dir name="sql"><dir name="productenquiry_setup"><file name="install-1.0.0.php" hash="f029faacf2775a789648966cef4ad20f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="oscprofessionals"><file name="productenquiry.xml" hash="bc4e19457ed963673d667e2b353073cf"/></dir></dir><dir name="template"><dir name="oscprofessionals"><dir name="productenquiry"><file name="enquirydisplay.phtml" hash="98235c6b76674b6c9babcbbec79cc8e0"/><file name="enquirydisplay.phtml_org" hash="75d3f27d63cc2a725ec7e3ef96835c74"/><file name="modelform.phtml" hash="a0b6710b95606cb9eef060a54c4f223f"/><file name="org_modelform.phtml" hash="6753f5c81c91b258214c9bc276d88bbb"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="oscprofessionals"><file name="productenquiry.xml" hash="53c925595ebc0b3792d79794db840e1b"/></dir></dir><dir name="template"><dir name="oscprofessionals"><dir name="productenquiry"><file name="form.phtml" hash="2ee32a0ca7b9595ef303469f2d579e5b"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Oscprofessionals_ProductEnquiry.xml" hash="815293361a43c88eea862a786736ae06"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="oscprofessionals"><file name="productenquiry.html" hash="1ed255d80be3ce7cc6a175b52b5e5c3b"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="oscprofessionals"><dir name="productenquiry"><file name="productenquiry.css" hash="694a1b72e696dd2f629d971c71f6d4ff"/></dir></dir></dir></dir></dir></dir></target></contents>
22
+ <compatible/>
23
+ <dependencies><required><php><min>5.2.0</min><max>5.5.0</max></php></required></dependencies>
24
+ </package>
skin/frontend/base/default/css/oscprofessionals/productenquiry/productenquiry.css ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ask-question-post .cust-name {
2
+ color: #3085c7;
3
+ font-weight: bold;
4
+ margin: 10px 0;
5
+ }
6
+ .cust-name .date {
7
+ color: #a2a2a2;
8
+ font-size: 12px;
9
+ font-weight: normal;
10
+ margin: 0 0 0 20px;
11
+ }
12
+ .ask-question-post .comment {
13
+ color: #a2a2a2;
14
+ font-weight: bold;
15
+ }