Version Notes
New Release
Download this release
Release Info
Developer | Biztech |
Extension | orderrequest_module |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Biztech/All/Helper/Data.php +6 -0
- app/code/local/Biztech/All/Model/All.php +10 -0
- app/code/local/Biztech/All/Model/Mysql4/All.php +10 -0
- app/code/local/Biztech/All/Model/Mysql4/All/Collection.php +10 -0
- app/code/local/Biztech/All/Model/Source/Updates/Type.php +50 -0
- app/code/local/Biztech/All/Model/Status.php +15 -0
- app/code/local/Biztech/All/Model/Update.php +86 -0
- app/code/local/Biztech/All/etc/config.xml +147 -0
- app/code/local/Biztech/All/etc/system.xml +46 -0
- app/code/local/Biztech/Orderrequest/Block/Adminhtml/Orderrequest.php +21 -0
- app/code/local/Biztech/Orderrequest/Block/Adminhtml/Orderrequest/Grid.php +118 -0
- app/code/local/Biztech/Orderrequest/Block/Email/Info.php +6 -0
- app/code/local/Biztech/Orderrequest/Block/Order/View.php +113 -0
- app/code/local/Biztech/Orderrequest/Block/Orderrequest.php +17 -0
- app/code/local/Biztech/Orderrequest/Helper/Data.php +13 -0
- app/code/local/Biztech/Orderrequest/Model/Mysql4/Orderrequest.php +10 -0
- app/code/local/Biztech/Orderrequest/Model/Mysql4/Orderrequest/Collection.php +10 -0
- app/code/local/Biztech/Orderrequest/Model/Observer.php +109 -0
- app/code/local/Biztech/Orderrequest/Model/Orderrequest.php +10 -0
- app/code/local/Biztech/Orderrequest/Model/Status.php +15 -0
- app/code/local/Biztech/Orderrequest/controllers/Adminhtml/OrderrequestController.php +21 -0
- app/code/local/Biztech/Orderrequest/controllers/IndexController.php +86 -0
- app/code/local/Biztech/Orderrequest/etc/config.xml +198 -0
- app/code/local/Biztech/Orderrequest/etc/system.xml +42 -0
- app/code/local/Biztech/Orderrequest/sql/orderrequest_setup/mysql4-install-0.1.0.php +22 -0
- app/design/adminhtml/default/default/layout/orderrequest.xml +14 -0
- app/design/adminhtml/default/default/template/orderrequest/orderrequest.phtml +72 -0
- app/design/frontend/default/default/layout/orderrequest.xml +52 -0
- app/design/frontend/default/default/template/orderrequest/checkout/multishipping/overview.phtml +261 -0
- app/design/frontend/default/default/template/orderrequest/checkout/onepage/orderrequest.phtml +11 -0
- app/design/frontend/default/default/template/orderrequest/checkout/onepage/review.phtml +4 -0
- app/design/frontend/default/default/template/orderrequest/email/info.phtml +9 -0
- app/design/frontend/default/default/template/orderrequest/order/view.phtml +111 -0
- app/etc/modules/Biztech_All.xml +52 -0
- app/etc/modules/Biztech_Orderrequest.xml +17 -0
- package.xml +35 -0
- skin/frontend/default/default/orderrequest/css/orderrequest.css +39 -0
- skin/frontend/default/default/orderrequest/js/orderrequest.js +35 -0
app/code/local/Biztech/All/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_All_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/local/Biztech/All/Model/All.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_All_Model_All extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('all/all');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/All/Model/Mysql4/All.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_All_Model_Mysql4_All extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the all_id refers to the key field in your database table.
|
8 |
+
$this->_init('all/all', 'all_id');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/All/Model/Mysql4/All/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_All_Model_Mysql4_All_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('all/all');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/All/Model/Source/Updates/Type.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Biztech_All_Model_Source_Updates_Type extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
|
13 |
+
{
|
14 |
+
const TYPE_UPDATE_RELEASE = 'UPDATE_RELEASE';
|
15 |
+
const TYPE_INSTALLED_UPDATE = 'INSTALLED_UPDATE';
|
16 |
+
public function toOptionArray()
|
17 |
+
{
|
18 |
+
return array(
|
19 |
+
array('value' => self::TYPE_INSTALLED_UPDATE, 'label' => Mage::helper('all')->__('My extensions updates')),
|
20 |
+
array('value' => self::TYPE_UPDATE_RELEASE, 'label' => Mage::helper('all')->__('All extensions updates')),
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getAllOptions()
|
25 |
+
{
|
26 |
+
return $this->toOptionArray();
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
public function getLabel($value)
|
31 |
+
{
|
32 |
+
$options = $this->toOptionArray();
|
33 |
+
foreach ($options as $v) {
|
34 |
+
if ($v['value'] == $value) {
|
35 |
+
return $v['label'];
|
36 |
+
}
|
37 |
+
}
|
38 |
+
return '';
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getGridOptions()
|
42 |
+
{
|
43 |
+
$items = $this->getAllOptions();
|
44 |
+
$out = array();
|
45 |
+
foreach ($items as $item) {
|
46 |
+
$out[$item['value']] = $item['label'];
|
47 |
+
}
|
48 |
+
return $out;
|
49 |
+
}
|
50 |
+
}
|
app/code/local/Biztech/All/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_All_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 2;
|
7 |
+
|
8 |
+
static public function getOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
self::STATUS_ENABLED => Mage::helper('all')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('all')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Biztech/All/Model/Update.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_All_Model_Update extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
const UPDATE_NOTIFICATION_FEED_URL = 'http://store.biztechconsultancy.com/rss/catalog/new/store_id/1/';
|
7 |
+
public function getInterests()
|
8 |
+
{
|
9 |
+
$types = @explode(',', Mage::getStoreConfig('all/all_general/interests'));
|
10 |
+
return $types;
|
11 |
+
}
|
12 |
+
public function isExtensionInstalled($code)
|
13 |
+
{
|
14 |
+
|
15 |
+
$modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
|
16 |
+
foreach ($modules as $moduleName) {
|
17 |
+
if ($moduleName == $code) {
|
18 |
+
return true;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
return false;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function check()
|
25 |
+
{
|
26 |
+
if ((time() - Mage::app()->loadCache('biztech_all_updates_feed_lastcheck')) > Mage::getStoreConfig('all/all_general/check_frequency')) {
|
27 |
+
$this->refresh();
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
public function refresh()
|
32 |
+
{
|
33 |
+
$types = array();
|
34 |
+
$feedData = array();
|
35 |
+
$extensio_module = array();
|
36 |
+
try{
|
37 |
+
$xml = file_get_contents(self::UPDATE_NOTIFICATION_FEED_URL);
|
38 |
+
$xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);//LIBXML_NOCDATA LIBXML_NOWARNING
|
39 |
+
|
40 |
+
$interests = $this->getInterests();
|
41 |
+
if(!empty($interests[0])){
|
42 |
+
$isInterestedInSelfUpgrades = in_array(Biztech_All_Model_Source_Updates_Type::TYPE_INSTALLED_UPDATE, $interests);
|
43 |
+
$isInterestedInAllUpgrades = in_array(Biztech_All_Model_Source_Updates_Type::TYPE_UPDATE_RELEASE, $interests);
|
44 |
+
$modules = Mage::getConfig()->getNode('modules')->children();
|
45 |
+
$modulesArray = (array)$modules;
|
46 |
+
foreach($xml->channel->item as $keys=>$extensions) {
|
47 |
+
$types[] = (string) $extensions->update_notifications->type;
|
48 |
+
$extensions_name = (string)$extensions->update_notifications->extensions;
|
49 |
+
|
50 |
+
if((string)$extensions->update_notifications->date!=""&&(string)$extensions->update_notifications->extension_title!=""&&(string)$extensions->update_notifications->extension_content!=""&&(string)$extensions->update_notifications->product_url!=""){
|
51 |
+
if(!$isInterestedInAllUpgrades){
|
52 |
+
if ($this->isExtensionInstalled($extensions_name)) {
|
53 |
+
$feedData[] = array(
|
54 |
+
'severity' => 4,
|
55 |
+
'date_added' => (string) $extensions->update_notifications->date,
|
56 |
+
'title' => (string)$extensions->update_notifications->extension_title,
|
57 |
+
'description' => (string)$extensions->update_notifications->extension_content,
|
58 |
+
'url' => (string)$extensions->update_notifications->product_url,
|
59 |
+
);
|
60 |
+
}
|
61 |
+
} else{
|
62 |
+
$feedData[] = array(
|
63 |
+
'severity' => 4,
|
64 |
+
'date_added' => (string)$extensions->update_notifications->date,
|
65 |
+
'title' => (string)$extensions->update_notifications->extension_title,
|
66 |
+
'description' => (string)$extensions->update_notifications->extension_content,
|
67 |
+
'url' => (string)$extensions->update_notifications->product_url,
|
68 |
+
);
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
if ($feedData) {
|
73 |
+
foreach($feedData as $data){
|
74 |
+
if ((array_intersect($types,$interests) && $isInterestedInSelfUpgrades)) {
|
75 |
+
Mage::getModel('adminnotification/inbox')->parse(array_reverse(array($data)));
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
Mage::app()->saveCache(time(), 'biztech_all_updates_feed_lastcheck');
|
80 |
+
return true;
|
81 |
+
}
|
82 |
+
}catch (Exception $e) {
|
83 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
app/code/local/Biztech/All/etc/config.xml
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Biztech
|
5 |
+
* @package Biztech_All
|
6 |
+
* @author ModuleCreator
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Biztech_All>
|
13 |
+
<version>0.1.0</version>
|
14 |
+
</Biztech_All>
|
15 |
+
</modules>
|
16 |
+
<frontend>
|
17 |
+
<routers>
|
18 |
+
<all>
|
19 |
+
<use>standard</use>
|
20 |
+
<args>
|
21 |
+
<module>Biztech_All</module>
|
22 |
+
<frontName>all</frontName>
|
23 |
+
</args>
|
24 |
+
</all>
|
25 |
+
</routers>
|
26 |
+
<!--<layout>
|
27 |
+
<updates>
|
28 |
+
<all>
|
29 |
+
<file>all.xml</file>
|
30 |
+
</all>
|
31 |
+
</updates>
|
32 |
+
</layout>-->
|
33 |
+
</frontend>
|
34 |
+
<admin>
|
35 |
+
<routers>
|
36 |
+
<all>
|
37 |
+
<use>admin</use>
|
38 |
+
<args>
|
39 |
+
<module>Biztech_All</module>
|
40 |
+
<frontName>all</frontName>
|
41 |
+
</args>
|
42 |
+
</all>
|
43 |
+
</routers>
|
44 |
+
</admin>
|
45 |
+
<adminhtml>
|
46 |
+
<!--<menu>
|
47 |
+
<all module="all">
|
48 |
+
<title>All</title>
|
49 |
+
<sort_order>71</sort_order>
|
50 |
+
<children>
|
51 |
+
<items module="all">
|
52 |
+
<title>Manage Items</title>
|
53 |
+
<sort_order>0</sort_order>
|
54 |
+
<action>all/adminhtml_all</action>
|
55 |
+
</items>
|
56 |
+
</children>
|
57 |
+
</all>
|
58 |
+
</menu> -->
|
59 |
+
<acl>
|
60 |
+
<resources>
|
61 |
+
<all>
|
62 |
+
<title>Allow Everything</title>
|
63 |
+
</all>
|
64 |
+
<admin>
|
65 |
+
<children>
|
66 |
+
<Biztech_All>
|
67 |
+
<title>All Module</title>
|
68 |
+
<sort_order>10</sort_order>
|
69 |
+
</Biztech_All>
|
70 |
+
</children>
|
71 |
+
</admin>
|
72 |
+
</resources>
|
73 |
+
</acl>
|
74 |
+
<events>
|
75 |
+
<controller_action_predispatch>
|
76 |
+
<observers>
|
77 |
+
|
78 |
+
<bzall_upds>
|
79 |
+
<type>singleton</type>
|
80 |
+
<class>all/update</class>
|
81 |
+
<method>check</method>
|
82 |
+
</bzall_upds>
|
83 |
+
</observers>
|
84 |
+
</controller_action_predispatch>
|
85 |
+
</events>
|
86 |
+
<!--<layout>
|
87 |
+
<updates>
|
88 |
+
<all>
|
89 |
+
<file>all.xml</file>
|
90 |
+
</all>
|
91 |
+
</updates>
|
92 |
+
</layout> -->
|
93 |
+
</adminhtml>
|
94 |
+
<global>
|
95 |
+
<models>
|
96 |
+
<all>
|
97 |
+
<class>Biztech_All_Model</class>
|
98 |
+
<resourceModel>all_mysql4</resourceModel>
|
99 |
+
</all>
|
100 |
+
<all_mysql4>
|
101 |
+
<class>Biztech_All_Model_Mysql4</class>
|
102 |
+
<entities>
|
103 |
+
<all>
|
104 |
+
<table>all</table>
|
105 |
+
</all>
|
106 |
+
</entities>
|
107 |
+
</all_mysql4>
|
108 |
+
</models>
|
109 |
+
<resources>
|
110 |
+
<all_setup>
|
111 |
+
<setup>
|
112 |
+
<module>Biztech_All</module>
|
113 |
+
</setup>
|
114 |
+
<connection>
|
115 |
+
<use>core_setup</use>
|
116 |
+
</connection>
|
117 |
+
</all_setup>
|
118 |
+
<all_write>
|
119 |
+
<connection>
|
120 |
+
<use>core_write</use>
|
121 |
+
</connection>
|
122 |
+
</all_write>
|
123 |
+
<all_read>
|
124 |
+
<connection>
|
125 |
+
<use>core_read</use>
|
126 |
+
</connection>
|
127 |
+
</all_read>
|
128 |
+
</resources>
|
129 |
+
<blocks>
|
130 |
+
<all>
|
131 |
+
<class>Biztech_All_Block</class>
|
132 |
+
</all>
|
133 |
+
</blocks>
|
134 |
+
<helpers>
|
135 |
+
<all>
|
136 |
+
<class>Biztech_All_Helper</class>
|
137 |
+
</all>
|
138 |
+
</helpers>
|
139 |
+
</global>
|
140 |
+
<default>
|
141 |
+
<all>
|
142 |
+
<all_general>
|
143 |
+
<check_frequency>86400</check_frequency>
|
144 |
+
</all_general>
|
145 |
+
</all>
|
146 |
+
</default>
|
147 |
+
</config>
|
app/code/local/Biztech/All/etc/system.xml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<biztech translate="label" module="all">
|
5 |
+
<label>Biztech Extensions</label>
|
6 |
+
<sort_order>400</sort_order>
|
7 |
+
</biztech>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<all translate="label" module="all">
|
11 |
+
<label>Info</label>
|
12 |
+
<tab>biztech</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>10</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 |
+
|
20 |
+
<all_general translate="label">
|
21 |
+
<label>General</label>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>10</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 |
+
<fields>
|
28 |
+
|
29 |
+
<interests translate="label">
|
30 |
+
<label>I'd like to be informed by Biztech about:</label>
|
31 |
+
<comment></comment>
|
32 |
+
<frontend_type>multiselect</frontend_type>
|
33 |
+
<sort_order>100</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
<can_be_empty>1</can_be_empty>
|
38 |
+
<source_model>all/source_updates_type</source_model>
|
39 |
+
</interests>
|
40 |
+
|
41 |
+
</fields>
|
42 |
+
</all_general>
|
43 |
+
</groups>
|
44 |
+
</all>
|
45 |
+
</sections>
|
46 |
+
</config>
|
app/code/local/Biztech/Orderrequest/Block/Adminhtml/Orderrequest.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_Orderrequest_Block_Adminhtml_Orderrequest extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_orderrequest';
|
7 |
+
$this->_blockGroup = 'orderrequest';
|
8 |
+
$this->_headerText = Mage::helper('orderrequest')->__('Customer Order Comments');
|
9 |
+
$this->_addButtonLabel = Mage::helper('orderrequest')->__('Add Item');
|
10 |
+
|
11 |
+
$flag = Mage::helper('orderrequest')->isEnable();
|
12 |
+
if($flag){
|
13 |
+
parent::__construct();
|
14 |
+
}
|
15 |
+
else{
|
16 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('orderrequest')->__('Customer Order Comment Management extension is not enabled. Please enable it from System > Configuration.'));
|
17 |
+
}
|
18 |
+
|
19 |
+
$this->_removeButton('add');
|
20 |
+
}
|
21 |
+
}
|
app/code/local/Biztech/Orderrequest/Block/Adminhtml/Orderrequest/Grid.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_Orderrequest_Block_Adminhtml_Orderrequest_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('orderrequestGrid');
|
9 |
+
$this->setDefaultSort('order_increment_id');
|
10 |
+
$this->setDefaultDir('DESC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection()
|
15 |
+
{
|
16 |
+
$collection = Mage::getModel('orderrequest/orderrequest')->getCollection();
|
17 |
+
//$collection->getSelect()->group('order_increment_id');
|
18 |
+
$this->setCollection($collection);
|
19 |
+
return parent::_prepareCollection();
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _prepareColumns()
|
23 |
+
{
|
24 |
+
/*$this->addColumn('orderrequest_id', array(
|
25 |
+
'header' => Mage::helper('orderrequest')->__('ID'),
|
26 |
+
'align' =>'right',
|
27 |
+
'width' => '50px',
|
28 |
+
'index' => 'orderrequest_id',
|
29 |
+
));*/
|
30 |
+
|
31 |
+
$this->addColumn('order_increment_id', array(
|
32 |
+
'header' => Mage::helper('orderrequest')->__('Order #'),
|
33 |
+
'align' =>'left',
|
34 |
+
'index' => 'order_increment_id',
|
35 |
+
));
|
36 |
+
|
37 |
+
/*
|
38 |
+
$this->addColumn('content', array(
|
39 |
+
'header' => Mage::helper('orderrequest')->__('Item Content'),
|
40 |
+
'width' => '150px',
|
41 |
+
'index' => 'content',
|
42 |
+
));
|
43 |
+
*/
|
44 |
+
|
45 |
+
/*$this->addColumn('status', array(
|
46 |
+
'header' => Mage::helper('orderrequest')->__('Status'),
|
47 |
+
'align' => 'left',
|
48 |
+
'width' => '80px',
|
49 |
+
'index' => 'status',
|
50 |
+
'type' => 'options',
|
51 |
+
'options' => array(
|
52 |
+
1 => 'Enabled',
|
53 |
+
2 => 'Disabled',
|
54 |
+
),
|
55 |
+
));*/
|
56 |
+
|
57 |
+
/*$this->addColumn('action',
|
58 |
+
array(
|
59 |
+
'header' => Mage::helper('orderrequest')->__('Action'),
|
60 |
+
'width' => '100',
|
61 |
+
'type' => 'action',
|
62 |
+
'getter' => 'getId',
|
63 |
+
'actions' => array(
|
64 |
+
array(
|
65 |
+
'caption' => Mage::helper('orderrequest')->__('Edit'),
|
66 |
+
'url' => array('base'=> '* /* /edit'),
|
67 |
+
'field' => 'id'
|
68 |
+
)
|
69 |
+
),
|
70 |
+
'filter' => false,
|
71 |
+
'sortable' => false,
|
72 |
+
'index' => 'stores',
|
73 |
+
'is_system' => true,
|
74 |
+
));*/
|
75 |
+
|
76 |
+
//$this->addExportType('*/*/exportCsv', Mage::helper('orderrequest')->__('CSV'));
|
77 |
+
//$this->addExportType('*/*/exportXml', Mage::helper('orderrequest')->__('XML'));
|
78 |
+
|
79 |
+
return parent::_prepareColumns();
|
80 |
+
}
|
81 |
+
|
82 |
+
/*protected function _prepareMassaction()
|
83 |
+
{
|
84 |
+
$this->setMassactionIdField('orderrequest_id');
|
85 |
+
$this->getMassactionBlock()->setFormFieldName('orderrequest');
|
86 |
+
|
87 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
88 |
+
'label' => Mage::helper('orderrequest')->__('Delete'),
|
89 |
+
'url' => $this->getUrl('* /* /massDelete'),
|
90 |
+
'confirm' => Mage::helper('orderrequest')->__('Are you sure?')
|
91 |
+
));
|
92 |
+
|
93 |
+
$statuses = Mage::getSingleton('orderrequest/status')->getOptionArray();
|
94 |
+
|
95 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
96 |
+
$this->getMassactionBlock()->addItem('status', array(
|
97 |
+
'label'=> Mage::helper('orderrequest')->__('Change status'),
|
98 |
+
'url' => $this->getUrl('* /* /massStatus', array('_current'=>true)),
|
99 |
+
'additional' => array(
|
100 |
+
'visibility' => array(
|
101 |
+
'name' => 'status',
|
102 |
+
'type' => 'select',
|
103 |
+
'class' => 'required-entry',
|
104 |
+
'label' => Mage::helper('orderrequest')->__('Status'),
|
105 |
+
'values' => $statuses
|
106 |
+
)
|
107 |
+
)
|
108 |
+
));
|
109 |
+
return $this;
|
110 |
+
}*/
|
111 |
+
|
112 |
+
public function getRowUrl($row)
|
113 |
+
{
|
114 |
+
//return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
115 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId(),'oid' => $row->getOrderIncrementId()));
|
116 |
+
}
|
117 |
+
|
118 |
+
}
|
app/code/local/Biztech/Orderrequest/Block/Email/Info.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_Orderrequest_Block_Email_Info extends Mage_Sales_Block_Items_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
6 |
+
?>
|
app/code/local/Biztech/Orderrequest/Block/Order/View.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Sales
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Sales order view block
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_Sales
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class Biztech_Orderrequest_Block_Order_View extends Mage_Core_Block_Template
|
35 |
+
{
|
36 |
+
protected function _construct()
|
37 |
+
{
|
38 |
+
parent::_construct();
|
39 |
+
if (Mage::getStoreConfig('orderrequest/orderrequest_general/enabled')){
|
40 |
+
$this->setTemplate('orderrequest/order/view.phtml');
|
41 |
+
}else{
|
42 |
+
$this->setTemplate('sales/order/view.phtml');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
protected function _prepareLayout()
|
47 |
+
{
|
48 |
+
if ($headBlock = $this->getLayout()->getBlock('head')) {
|
49 |
+
$headBlock->setTitle($this->__('Order # %s', $this->getOrder()->getRealOrderId()));
|
50 |
+
}
|
51 |
+
$this->setChild(
|
52 |
+
'payment_info',
|
53 |
+
$this->helper('payment')->getInfoBlock($this->getOrder()->getPayment())
|
54 |
+
);
|
55 |
+
}
|
56 |
+
|
57 |
+
public function getPaymentInfoHtml()
|
58 |
+
{
|
59 |
+
return $this->getChildHtml('payment_info');
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Retrieve current order model instance
|
64 |
+
*
|
65 |
+
* @return Mage_Sales_Model_Order
|
66 |
+
*/
|
67 |
+
public function getOrder()
|
68 |
+
{
|
69 |
+
return Mage::registry('current_order');
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Return back url for logged in and guest users
|
74 |
+
*
|
75 |
+
* @return string
|
76 |
+
*/
|
77 |
+
public function getBackUrl()
|
78 |
+
{
|
79 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
80 |
+
return Mage::getUrl('*/*/history');
|
81 |
+
}
|
82 |
+
return Mage::getUrl('*/*/form');
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Return back title for logged in and guest users
|
87 |
+
*
|
88 |
+
* @return string
|
89 |
+
*/
|
90 |
+
public function getBackTitle()
|
91 |
+
{
|
92 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
93 |
+
return Mage::helper('sales')->__('Back to My Orders');
|
94 |
+
}
|
95 |
+
return Mage::helper('sales')->__('View Another Order');
|
96 |
+
}
|
97 |
+
|
98 |
+
public function getInvoiceUrl($order)
|
99 |
+
{
|
100 |
+
return Mage::getUrl('*/*/invoice', array('order_id' => $order->getId()));
|
101 |
+
}
|
102 |
+
|
103 |
+
public function getShipmentUrl($order)
|
104 |
+
{
|
105 |
+
return Mage::getUrl('*/*/shipment', array('order_id' => $order->getId()));
|
106 |
+
}
|
107 |
+
|
108 |
+
public function getCreditmemoUrl($order)
|
109 |
+
{
|
110 |
+
return Mage::getUrl('*/*/creditmemo', array('order_id' => $order->getId()));
|
111 |
+
}
|
112 |
+
|
113 |
+
}
|
app/code/local/Biztech/Orderrequest/Block/Orderrequest.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_Orderrequest_Block_Orderrequest extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function getOrderrequest()
|
10 |
+
{
|
11 |
+
if (!$this->hasData('orderrequest')) {
|
12 |
+
$this->setData('orderrequest', Mage::registry('orderrequest'));
|
13 |
+
}
|
14 |
+
return $this->getData('orderrequest');
|
15 |
+
|
16 |
+
}
|
17 |
+
}
|
app/code/local/Biztech/Orderrequest/Helper/Data.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_Orderrequest_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
public function isEnable(){
|
5 |
+
$isenabled = Mage::getStoreConfig('orderrequest/orderrequest_general/enabled');
|
6 |
+
if($isenabled){
|
7 |
+
return true;
|
8 |
+
}
|
9 |
+
else{
|
10 |
+
return false;
|
11 |
+
}
|
12 |
+
}
|
13 |
+
}
|
app/code/local/Biztech/Orderrequest/Model/Mysql4/Orderrequest.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_Orderrequest_Model_Mysql4_Orderrequest extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the orderrequest_id refers to the key field in your database table.
|
8 |
+
$this->_init('orderrequest/orderrequest', 'orderrequest_id');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/Orderrequest/Model/Mysql4/Orderrequest/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_Orderrequest_Model_Mysql4_Orderrequest_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('orderrequest/orderrequest');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/Orderrequest/Model/Observer.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_Orderrequest_Model_Observer {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Check if customer request should be added to order.
|
7 |
+
*
|
8 |
+
* @param Varien_Event_Observer $observer
|
9 |
+
* @return $this
|
10 |
+
*/
|
11 |
+
private static $_handleCounter = 0;
|
12 |
+
|
13 |
+
public function addCustomerRequestToOrder(Varien_Event_Observer $observer) {
|
14 |
+
/** @var Mage_Sales_Model_Order $order */
|
15 |
+
$order = $observer->getEvent()->getOrder();
|
16 |
+
/** @var Mage_Core_Controller_Request_Http $request */
|
17 |
+
$request = Mage::app()->getRequest();
|
18 |
+
|
19 |
+
if (!is_object($order) || !$request)
|
20 |
+
return $this;
|
21 |
+
|
22 |
+
$comment = strip_tags($request->getParam('customer_order_request'));
|
23 |
+
|
24 |
+
if (!empty($comment) && trim($comment) != "") {
|
25 |
+
$value = '<strong>' . Mage::helper('orderrequest')->__('Customer Order Comment') . '</strong><br/>' . $comment;
|
26 |
+
|
27 |
+
$order->addStatusHistoryComment($value, $order->getStatus())
|
28 |
+
->setIsVisibleOnFront(true)
|
29 |
+
->setIsCustomerNotified(true);
|
30 |
+
|
31 |
+
$prefix = Mage::getConfig()->getTablePrefix();
|
32 |
+
$sql = "SELECT order_increment_id FROM " . $prefix . "orderrequest WHERE order_increment_id = '" . $order->getIncrementId() . "'";
|
33 |
+
$result = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);
|
34 |
+
|
35 |
+
if (count($result) == 0) {
|
36 |
+
$data['order_increment_id'] = $order->getIncrementId();
|
37 |
+
$data['customer_email'] = $order->getCustomerEmail();
|
38 |
+
$data['type'] = "frontend";
|
39 |
+
$model = Mage::getModel('orderrequest/orderrequest');
|
40 |
+
$model->setData($data);
|
41 |
+
$model->setCreatedTime(now())->setUpdateTime(now());
|
42 |
+
$model->save();
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
return $this;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function saveOrderCommentAdmin(Varien_Event_Observer $observer) {
|
50 |
+
$order = $observer->getEvent()->getOrder();
|
51 |
+
$prefix = Mage::getConfig()->getTablePrefix();
|
52 |
+
$sql = "SELECT order_increment_id FROM " . $prefix . "orderrequest WHERE order_increment_id = '" . $order->getIncrementId() . "'";
|
53 |
+
$result = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);
|
54 |
+
|
55 |
+
if (count($result) == 0) {
|
56 |
+
$data['order_increment_id'] = $order->getIncrementId();
|
57 |
+
$data['customer_email'] = $order->getCustomerEmail();
|
58 |
+
$data['type'] = "admin";
|
59 |
+
$model = Mage::getModel('orderrequest/orderrequest');
|
60 |
+
$model->setData($data);
|
61 |
+
$model->setCreatedTime(now())->setUpdateTime(now());
|
62 |
+
$model->save();
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
public function multishipOrderCustomerRequest(Varien_Event_Observer $observer) {
|
67 |
+
if (Mage::app()->getRequest()->getControllerName() == 'multishipping') {
|
68 |
+
$data = $observer->getData();
|
69 |
+
$order = $observer->getEvent()->getOrder();
|
70 |
+
$request = Mage::app()->getRequest();
|
71 |
+
|
72 |
+
if (!is_object($order) || !$request)
|
73 |
+
return $this;
|
74 |
+
|
75 |
+
$addresses = Mage::getSingleton('checkout/session')->getQuote()->getAllShippingAddresses();
|
76 |
+
foreach ($addresses as $address) {
|
77 |
+
$address_array[] = $address->getId();
|
78 |
+
}
|
79 |
+
|
80 |
+
$comment = $request->getParam('customer_order_request_' . $address_array[self::$_handleCounter]);
|
81 |
+
if ($comment != NULL) {
|
82 |
+
$comment = strip_tags($comment);
|
83 |
+
|
84 |
+
if (!empty($comment) && trim($comment) != "") {
|
85 |
+
$value = '<strong>' . Mage::helper('orderrequest')->__('Customer Order Comment') . '</strong><br/>' . $comment;
|
86 |
+
|
87 |
+
$order->addStatusHistoryComment($value, $order->getStatus())
|
88 |
+
->setIsVisibleOnFront(true)
|
89 |
+
->setIsCustomerNotified(true);
|
90 |
+
|
91 |
+
$prefix = Mage::getConfig()->getTablePrefix();
|
92 |
+
$sql = "SELECT order_increment_id FROM " . $prefix . "orderrequest WHERE order_increment_id = '" . $order->getIncrementId() . "'";
|
93 |
+
$result = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);
|
94 |
+
|
95 |
+
if (count($result) == 0) {
|
96 |
+
$data['order_increment_id'] = $order->getIncrementId();
|
97 |
+
$data['customer_email'] = $order->getCustomerEmail();
|
98 |
+
$data['type'] = "frontend";
|
99 |
+
$model = Mage::getModel('orderrequest/orderrequest');
|
100 |
+
$model->setData($data);
|
101 |
+
$model->setCreatedTime(now())->setUpdateTime(now());
|
102 |
+
$model->save();
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}self::$_handleCounter++;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
}
|
app/code/local/Biztech/Orderrequest/Model/Orderrequest.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_Orderrequest_Model_Orderrequest extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('orderrequest/orderrequest');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/Orderrequest/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_Orderrequest_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 2;
|
7 |
+
|
8 |
+
static public function getOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
self::STATUS_ENABLED => Mage::helper('orderrequest')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('orderrequest')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Biztech/Orderrequest/controllers/Adminhtml/OrderrequestController.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_Orderrequest_Adminhtml_OrderrequestController extends Mage_Adminhtml_Controller_action
|
3 |
+
{
|
4 |
+
protected function _initAction() {
|
5 |
+
$this->loadLayout()
|
6 |
+
->_setActiveMenu('orderrequest/items')
|
7 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Customer Order Comments'), Mage::helper('adminhtml')->__('Customer Order Comments'));
|
8 |
+
|
9 |
+
return $this;
|
10 |
+
}
|
11 |
+
|
12 |
+
public function indexAction() {
|
13 |
+
$this->_initAction()
|
14 |
+
->renderLayout();
|
15 |
+
}
|
16 |
+
|
17 |
+
public function editAction() {
|
18 |
+
$this->_initAction()
|
19 |
+
->renderLayout();
|
20 |
+
}
|
21 |
+
}
|
app/code/local/Biztech/Orderrequest/controllers/IndexController.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_Orderrequest_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
/*public function indexAction()
|
5 |
+
{
|
6 |
+
/*
|
7 |
+
* Load an object by id
|
8 |
+
* Request looking like:
|
9 |
+
* http://site.com/orderrequest?id=15
|
10 |
+
* or
|
11 |
+
* http://site.com/orderrequest/id/15
|
12 |
+
*/
|
13 |
+
/*
|
14 |
+
$orderrequest_id = $this->getRequest()->getParam('id');
|
15 |
+
|
16 |
+
if($orderrequest_id != null && $orderrequest_id != '') {
|
17 |
+
$orderrequest = Mage::getModel('orderrequest/orderrequest')->load($orderrequest_id)->getData();
|
18 |
+
} else {
|
19 |
+
$orderrequest = null;
|
20 |
+
}
|
21 |
+
*/
|
22 |
+
|
23 |
+
/*
|
24 |
+
* If no param we load a the last created item
|
25 |
+
*/
|
26 |
+
/*
|
27 |
+
if($orderrequest == null) {
|
28 |
+
$resource = Mage::getSingleton('core/resource');
|
29 |
+
$read= $resource->getConnection('core_read');
|
30 |
+
$orderrequestTable = $resource->getTableName('orderrequest');
|
31 |
+
|
32 |
+
$select = $read->select()
|
33 |
+
->from($orderrequestTable,array('orderrequest_id','title','content','status'))
|
34 |
+
->where('status',1)
|
35 |
+
->order('created_time DESC') ;
|
36 |
+
|
37 |
+
$orderrequest = $read->fetchRow($select);
|
38 |
+
}
|
39 |
+
Mage::register('orderrequest', $orderrequest);
|
40 |
+
* /
|
41 |
+
|
42 |
+
$this->loadLayout();
|
43 |
+
$this->renderLayout();
|
44 |
+
}*/
|
45 |
+
|
46 |
+
public function saveorderrequestAction()
|
47 |
+
{
|
48 |
+
$order_id = $this->getRequest()->getParam('orderid');
|
49 |
+
$order = Mage::getModel('sales/order')->load($order_id);
|
50 |
+
|
51 |
+
$customer_request = strip_tags($this->getRequest()->getParam('customer_order_request'));
|
52 |
+
|
53 |
+
if (!empty($customer_request)){
|
54 |
+
$value = '<strong>' . Mage::helper('orderrequest')->__('Customer Order Comment') . '</strong><br/>' . $customer_request;
|
55 |
+
|
56 |
+
$order->addStatusHistoryComment($value,$order->getStatus())
|
57 |
+
->setIsVisibleOnFront(true)
|
58 |
+
->setIsCustomerNotified(true);
|
59 |
+
|
60 |
+
$order->save();
|
61 |
+
|
62 |
+
$sql = "SELECT order_increment_id FROM orderrequest WHERE order_increment_id = '".$order->getIncrementId()."'";
|
63 |
+
$result = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);
|
64 |
+
|
65 |
+
if(count($result) == 0){
|
66 |
+
$data['order_increment_id'] = $order->getIncrementId();
|
67 |
+
$data['customer_email'] = $order->getCustomerEmail();
|
68 |
+
$data['type'] = "frontend";
|
69 |
+
$model = Mage::getModel('orderrequest/orderrequest');
|
70 |
+
$model->setData($data);
|
71 |
+
$model->setCreatedTime(now())->setUpdateTime(now());
|
72 |
+
$model->save();
|
73 |
+
}
|
74 |
+
|
75 |
+
$to = Mage::getStoreConfig('trans_email/ident_sales/email');
|
76 |
+
$subject = "Customer Order Comment for Order #".$order->getIncrementId();
|
77 |
+
$message = "<h1 style='font-size:13px; font-weight:normal; line-height:22px; margin:0 0 11px 0;'>Hello,</h1><p>You just recieved below customer comment for order #".$order->getIncrementId()."</p><strong>Customer Order Comment</strong><br/>".nl2br($customer_request);
|
78 |
+
$header = "MIME-Version: 1.0\r\n";
|
79 |
+
$header .= "Content-type: text/html; charset: utf8\r\n";
|
80 |
+
mail($to, $subject, $message, $header);
|
81 |
+
|
82 |
+
$this->_redirect('sales/order/view/order_id/'.$order_id.'/');
|
83 |
+
return;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
app/code/local/Biztech/Orderrequest/etc/config.xml
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Biztech
|
5 |
+
* @package Biztech_Orderrequest
|
6 |
+
* @author ModuleCreator
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Biztech_Orderrequest>
|
13 |
+
<version>0.1.0</version>
|
14 |
+
</Biztech_Orderrequest>
|
15 |
+
</modules>
|
16 |
+
|
17 |
+
<frontend>
|
18 |
+
<routers>
|
19 |
+
<orderrequest>
|
20 |
+
<use>standard</use>
|
21 |
+
<args>
|
22 |
+
<module>Biztech_Orderrequest</module>
|
23 |
+
<frontName>orderrequest</frontName>
|
24 |
+
</args>
|
25 |
+
</orderrequest>
|
26 |
+
</routers>
|
27 |
+
<layout>
|
28 |
+
<updates>
|
29 |
+
<orderrequest>
|
30 |
+
<file>orderrequest.xml</file>
|
31 |
+
</orderrequest>
|
32 |
+
</updates>
|
33 |
+
</layout>
|
34 |
+
<events>
|
35 |
+
<checkout_type_onepage_save_order>
|
36 |
+
<observers>
|
37 |
+
<orderrequest>
|
38 |
+
<type>singleton</type>
|
39 |
+
<class>orderrequest/observer</class>
|
40 |
+
<method>addCustomerRequestToOrder</method>
|
41 |
+
</orderrequest>
|
42 |
+
</observers>
|
43 |
+
</checkout_type_onepage_save_order>
|
44 |
+
|
45 |
+
<sales_order_save_before>
|
46 |
+
<observers>
|
47 |
+
<orderrequest>
|
48 |
+
<type>singleton</type>
|
49 |
+
<class>orderrequest/observer</class>
|
50 |
+
<method>multiShipOrderCustomerRequest</method>
|
51 |
+
</orderrequest>
|
52 |
+
</observers>
|
53 |
+
</sales_order_save_before>
|
54 |
+
</events>
|
55 |
+
</frontend>
|
56 |
+
|
57 |
+
<global>
|
58 |
+
<models>
|
59 |
+
<orderrequest>
|
60 |
+
<class>Biztech_Orderrequest_Model</class>
|
61 |
+
<resourceModel>orderrequest_mysql4</resourceModel>
|
62 |
+
</orderrequest>
|
63 |
+
</models>
|
64 |
+
<blocks>
|
65 |
+
<orderrequest>
|
66 |
+
<class>Biztech_Orderrequest_Block</class>
|
67 |
+
</orderrequest>
|
68 |
+
<sales>
|
69 |
+
<rewrite>
|
70 |
+
<order_view>Biztech_Orderrequest_Block_Order_View</order_view>
|
71 |
+
</rewrite>
|
72 |
+
</sales>
|
73 |
+
</blocks>
|
74 |
+
<helpers>
|
75 |
+
<orderrequest>
|
76 |
+
<class>Biztech_Orderrequest_Helper</class>
|
77 |
+
</orderrequest>
|
78 |
+
</helpers>
|
79 |
+
</global>
|
80 |
+
|
81 |
+
<admin>
|
82 |
+
<routers>
|
83 |
+
<orderrequest>
|
84 |
+
<use>admin</use>
|
85 |
+
<args>
|
86 |
+
<module>Biztech_Orderrequest</module>
|
87 |
+
<frontName>orderrequest</frontName>
|
88 |
+
</args>
|
89 |
+
</orderrequest>
|
90 |
+
</routers>
|
91 |
+
</admin>
|
92 |
+
|
93 |
+
<adminhtml>
|
94 |
+
<menu>
|
95 |
+
<orderrequest module="orderrequest">
|
96 |
+
<title>Customer Order Comment Management</title>
|
97 |
+
<sort_order>71</sort_order>
|
98 |
+
<children>
|
99 |
+
<items module="orderrequest">
|
100 |
+
<title>Customer Order Comments</title>
|
101 |
+
<sort_order>0</sort_order>
|
102 |
+
<action>orderrequest/adminhtml_orderrequest</action>
|
103 |
+
</items>
|
104 |
+
</children>
|
105 |
+
</orderrequest>
|
106 |
+
</menu>
|
107 |
+
<acl>
|
108 |
+
<resources>
|
109 |
+
<all>
|
110 |
+
<title>Allow Everything</title>
|
111 |
+
</all>
|
112 |
+
<admin>
|
113 |
+
<children>
|
114 |
+
<Biztech_Orderrequest>
|
115 |
+
<title>Orderrequest Module</title>
|
116 |
+
<sort_order>10</sort_order>
|
117 |
+
</Biztech_Orderrequest>
|
118 |
+
<system>
|
119 |
+
<children>
|
120 |
+
<config>
|
121 |
+
<children>
|
122 |
+
<orderrequest>
|
123 |
+
<title>Customer Order Comment Management</title>
|
124 |
+
</orderrequest>
|
125 |
+
</children>
|
126 |
+
</config>
|
127 |
+
</children>
|
128 |
+
</system>
|
129 |
+
</children>
|
130 |
+
</admin>
|
131 |
+
</resources>
|
132 |
+
</acl>
|
133 |
+
<layout>
|
134 |
+
<updates>
|
135 |
+
<orderrequest>
|
136 |
+
<file>orderrequest.xml</file>
|
137 |
+
</orderrequest>
|
138 |
+
</updates>
|
139 |
+
</layout>
|
140 |
+
<events>
|
141 |
+
<sales_order_save_after>
|
142 |
+
<observers>
|
143 |
+
<orderrequest_save_ordercomment>
|
144 |
+
<type>model</type>
|
145 |
+
<class>orderrequest/observer</class>
|
146 |
+
<method>saveOrderCommentAdmin</method>
|
147 |
+
</orderrequest_save_ordercomment>
|
148 |
+
</observers>
|
149 |
+
</sales_order_save_after>
|
150 |
+
</events>
|
151 |
+
</adminhtml>
|
152 |
+
<global>
|
153 |
+
<models>
|
154 |
+
<orderrequest>
|
155 |
+
<class>Biztech_Orderrequest_Model</class>
|
156 |
+
<resourceModel>orderrequest_mysql4</resourceModel>
|
157 |
+
</orderrequest>
|
158 |
+
<orderrequest_mysql4>
|
159 |
+
<class>Biztech_Orderrequest_Model_Mysql4</class>
|
160 |
+
<entities>
|
161 |
+
<orderrequest>
|
162 |
+
<table>orderrequest</table>
|
163 |
+
</orderrequest>
|
164 |
+
</entities>
|
165 |
+
</orderrequest_mysql4>
|
166 |
+
</models>
|
167 |
+
<resources>
|
168 |
+
<orderrequest_setup>
|
169 |
+
<setup>
|
170 |
+
<module>Biztech_Orderrequest</module>
|
171 |
+
</setup>
|
172 |
+
<connection>
|
173 |
+
<use>core_setup</use>
|
174 |
+
</connection>
|
175 |
+
</orderrequest_setup>
|
176 |
+
<orderrequest_write>
|
177 |
+
<connection>
|
178 |
+
<use>core_write</use>
|
179 |
+
</connection>
|
180 |
+
</orderrequest_write>
|
181 |
+
<orderrequest_read>
|
182 |
+
<connection>
|
183 |
+
<use>core_read</use>
|
184 |
+
</connection>
|
185 |
+
</orderrequest_read>
|
186 |
+
</resources>
|
187 |
+
<blocks>
|
188 |
+
<orderrequest>
|
189 |
+
<class>Biztech_Orderrequest_Block</class>
|
190 |
+
</orderrequest>
|
191 |
+
</blocks>
|
192 |
+
<helpers>
|
193 |
+
<orderrequest>
|
194 |
+
<class>Biztech_Orderrequest_Helper</class>
|
195 |
+
</orderrequest>
|
196 |
+
</helpers>
|
197 |
+
</global>
|
198 |
+
</config>
|
app/code/local/Biztech/Orderrequest/etc/system.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<biztech translate="label" module="orderrequest">
|
5 |
+
<label>Biztech Extensions</label>
|
6 |
+
<sort_order>250</sort_order>
|
7 |
+
</biztech>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<orderrequest translate="label" module="orderrequest">
|
11 |
+
<label>Customer Order Comment Management</label>
|
12 |
+
<tab>biztech</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 |
+
<orderrequest_general translate="label">
|
20 |
+
<label>Customer Order Comment Management Configuration</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>10</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 |
+
<enabled translate="label">
|
28 |
+
<label>Enabled</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>1</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 |
+
<comment>Select Yes to enable this feature.</comment>
|
36 |
+
</enabled>
|
37 |
+
</fields>
|
38 |
+
</orderrequest_general>
|
39 |
+
</groups>
|
40 |
+
</orderrequest>
|
41 |
+
</sections>
|
42 |
+
</config>
|
app/code/local/Biztech/Orderrequest/sql/orderrequest_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
-- DROP TABLE IF EXISTS {$this->getTable('orderrequest')};
|
10 |
+
CREATE TABLE {$this->getTable('orderrequest')} (
|
11 |
+
`orderrequest_id` int(11) unsigned NOT NULL auto_increment,
|
12 |
+
`order_increment_id` varchar(50) default NULL,
|
13 |
+
`customer_email` varchar(255) default NULL,
|
14 |
+
`type` varchar(10) default NULL,
|
15 |
+
`created_time` datetime default NULL,
|
16 |
+
`update_time` datetime default NULL,
|
17 |
+
PRIMARY KEY (`orderrequest_id`)
|
18 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
19 |
+
|
20 |
+
");
|
21 |
+
|
22 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/orderrequest.xml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<orderrequest_adminhtml_orderrequest_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="orderrequest/adminhtml_orderrequest" name="orderrequest" />
|
6 |
+
</reference>
|
7 |
+
</orderrequest_adminhtml_orderrequest_index>
|
8 |
+
|
9 |
+
<orderrequest_adminhtml_orderrequest_edit>
|
10 |
+
<reference name="content">
|
11 |
+
<block type="orderrequest/adminhtml_orderrequest" name="orderrequest" template="orderrequest/orderrequest.phtml" />
|
12 |
+
</reference>
|
13 |
+
</orderrequest_adminhtml_orderrequest_edit>
|
14 |
+
</layout>
|
app/design/adminhtml/default/default/template/orderrequest/orderrequest.phtml
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future . If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design_default
|
22 |
+
* @package Mage
|
23 |
+
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
$oid = $this->getRequest()->getParam('oid');
|
29 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($oid);
|
30 |
+
$_history = $order->getVisibleStatusHistory();
|
31 |
+
$_history = array_reverse($_history);
|
32 |
+
?>
|
33 |
+
<div class="main-col-inner">
|
34 |
+
<div id="messages"></div>
|
35 |
+
<div class="entry-edit">
|
36 |
+
<div class="content-header">
|
37 |
+
<table cellspacing="0">
|
38 |
+
<tbody>
|
39 |
+
<tr>
|
40 |
+
<td style="width:50%;"><h3 class="icon-head head-sales-order"><?php echo $this->__("Order # ").$this->getRequest()->getParam('oid'); ?></h3></td>
|
41 |
+
<td class="form-buttons">
|
42 |
+
<button style="" class="scalable back" type="button" id="" onclick="setLocation('<?php echo $this->getUrl('*/*/'); ?>')"><span><?php echo $this->__("Back") ?></span></button>
|
43 |
+
<button style="" class="scalable" type="button" id="" onclick="setLocation('<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/sales_order/view",array('order_id'=>$order->getEntityId())); ?>')"><?php echo $this->__("View Order") ?></button>
|
44 |
+
</td>
|
45 |
+
|
46 |
+
</tr>
|
47 |
+
</tbody>
|
48 |
+
</table>
|
49 |
+
</div>
|
50 |
+
<div style="" id="supplier_tabs_form_section_content">
|
51 |
+
<div class="entry-edit">
|
52 |
+
<div class="entry-edit-head">
|
53 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__("Order Comments History"); ?></h4>
|
54 |
+
<div class="form-buttons"></div>
|
55 |
+
</div>
|
56 |
+
|
57 |
+
<div id="supplier_form" class="fieldset ">
|
58 |
+
|
59 |
+
<?php if (count($_history)): ?>
|
60 |
+
<div class="order-additional order-comments">
|
61 |
+
<dl class="order-about">
|
62 |
+
<?php foreach ($_history as $_historyItem): ?>
|
63 |
+
<dt><?php echo $this->formatDate($_historyItem->getCreatedAtStoreDate(), 'medium', true) ?></dt>
|
64 |
+
<dd><?php echo nl2br(html_entity_decode($this->escapeHtml($_historyItem->getComment()))); ?></dd><br>
|
65 |
+
<?php endforeach; ?>
|
66 |
+
</dl>
|
67 |
+
</div>
|
68 |
+
<?php endif; ?>
|
69 |
+
</div>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
</div>
|
app/design/frontend/default/default/layout/orderrequest.xml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<orderrequest_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="orderrequest/orderrequest" name="orderrequest" template="orderrequest/orderrequest.phtml" />
|
8 |
+
</reference>
|
9 |
+
</orderrequest_index_index>
|
10 |
+
</layout>-->
|
11 |
+
|
12 |
+
<layout version="0.1.0">
|
13 |
+
<checkout_onepage_index>
|
14 |
+
<reference name="head">
|
15 |
+
<action method="addItem"><type>skin_css</type><name>orderrequest/css/orderrequest.css</name><params/></action>
|
16 |
+
</reference>
|
17 |
+
|
18 |
+
<reference name="checkout.onepage.review">
|
19 |
+
<action method="setTemplate" ifconfig="orderrequest/orderrequest_general/enabled">
|
20 |
+
<template>orderrequest/checkout/onepage/review.phtml</template>
|
21 |
+
</action>
|
22 |
+
</reference>
|
23 |
+
</checkout_onepage_index>
|
24 |
+
|
25 |
+
<checkout_onepage_review>
|
26 |
+
<reference name="checkout.onepage.review.info.items.after">
|
27 |
+
<block type="orderrequest/orderrequest" name="order.request" as="orderrequest" template="orderrequest/checkout/onepage/orderrequest.phtml"/>
|
28 |
+
</reference>
|
29 |
+
</checkout_onepage_review>
|
30 |
+
|
31 |
+
<checkout_multishipping_overview translate="label">
|
32 |
+
<reference name="head">
|
33 |
+
<action method="addItem"><type>skin_css</type><name>orderrequest/css/orderrequest.css</name><params/></action>
|
34 |
+
</reference>
|
35 |
+
<reference name="checkout_overview">
|
36 |
+
<action method="setTemplate" ifconfig="orderrequest/orderrequest_general/enabled">
|
37 |
+
<template>orderrequest/checkout/multishipping/overview.phtml</template>
|
38 |
+
</action>
|
39 |
+
</reference>
|
40 |
+
</checkout_multishipping_overview>
|
41 |
+
|
42 |
+
<sales_order_view>
|
43 |
+
<reference name="head">
|
44 |
+
<action method="addItem"><type>skin_css</type><name>orderrequest/css/orderrequest.css</name><params/></action>
|
45 |
+
</reference>
|
46 |
+
</sales_order_view>
|
47 |
+
|
48 |
+
<orderrequest_email_information>
|
49 |
+
<block type="orderrequest/email_info" name="orderrequest_email_info" template="orderrequest/email/info.phtml"/>
|
50 |
+
</orderrequest_email_information>
|
51 |
+
|
52 |
+
</layout>
|
app/design/frontend/default/default/template/orderrequest/checkout/multishipping/overview.phtml
ADDED
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php /** @var $this Mage_Checkout_Block_Multishipping_Overview */ ?>
|
28 |
+
<div class="multiple-checkout" id="multiple-checkout">
|
29 |
+
<div class="page-title">
|
30 |
+
<h1><?php echo $this->__('Review Order') ?></h1>
|
31 |
+
</div>
|
32 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
33 |
+
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" onsubmit="return showLoader();">
|
34 |
+
<?php echo $this->getBlockHtml('formkey'); ?>
|
35 |
+
<div class="col2-set">
|
36 |
+
<h2 class="legend"><?php echo $this->__('Billing Information') ?></h2>
|
37 |
+
<div class="col-1">
|
38 |
+
<div class="box">
|
39 |
+
<?php $_address = $this->getBillingAddress() ?>
|
40 |
+
<div class="box-title">
|
41 |
+
<h3><?php echo $this->__('Billing Address') ?> <span class="separator">|</span> <a href="<?php echo $this->getEditBillingAddressUrl($_address) ?>"><?php echo $this->__('Change') ?></a></h3>
|
42 |
+
</div>
|
43 |
+
<div class="box-content">
|
44 |
+
<address>
|
45 |
+
<?php echo $_address->format('html') ?>
|
46 |
+
</address>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
<div class="col-2">
|
51 |
+
<div class="box">
|
52 |
+
<div class="box-title">
|
53 |
+
<h3><?php echo $this->__('Payment Method') ?> <span class="separator">|</span> <a href="<?php echo $this->getEditBillingUrl() ?>"><?php echo $this->__('Change') ?></a></h3>
|
54 |
+
</div>
|
55 |
+
<div class="box-content">
|
56 |
+
<input type="hidden" name="payment[cc_number]" value="<?php echo $this->escapeHtml($this->getPayment()->getCcNumber()) ?>" />
|
57 |
+
<input type="hidden" name="payment[cc_cid]" value="<?php echo $this->escapeHtml($this->getPayment()->getCcCid()) ?>" />
|
58 |
+
<?php echo $this->getPaymentHtml() ?>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
<?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
|
64 |
+
<div class="col2-set">
|
65 |
+
<h2 class="legend"><?php echo $this->__('Shipping Information') ?></h2>
|
66 |
+
<?php foreach ($this->getShippingAddresses() as $_index => $_address): ?>
|
67 |
+
<h3 class="legend"><?php echo $this->__('Address %s of %s', ($_index + 1), $this->getShippingAddressCount()) ?></h3>
|
68 |
+
<div class="col-1 col-narrow">
|
69 |
+
<div class="box">
|
70 |
+
<div class="box-title">
|
71 |
+
<h4><?php echo $this->__('Shipping To') ?> <span class="separator">|</span> <a href="<?php echo $this->getEditShippingAddressUrl($_address) ?>"><?php echo $this->__('Change') ?></a></h4>
|
72 |
+
</div>
|
73 |
+
<div class="box-content">
|
74 |
+
<address>
|
75 |
+
<?php echo $_address->format('html') ?>
|
76 |
+
</address>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
<div class="box">
|
80 |
+
<div class="box-title">
|
81 |
+
<h4><?php echo $this->__('Shipping Method') ?> <span class="separator">|</span> <a href="<?php echo $this->getEditShippingUrl() ?>"><?php echo $this->__('Change') ?></a></h4>
|
82 |
+
</div>
|
83 |
+
<div class="box-content">
|
84 |
+
<?php if ($_rate = $this->getShippingAddressRate($_address)): ?>
|
85 |
+
<p>
|
86 |
+
<?php echo $this->escapeHtml($_rate->getCarrierTitle()) ?> - <?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
|
87 |
+
<?php $_excl = $this->getShippingPriceExclTax($_address); ?>
|
88 |
+
<?php $_incl = $this->getShippingPriceInclTax($_address); ?>
|
89 |
+
<?php echo $_excl; ?>
|
90 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
91 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
92 |
+
<?php endif; ?>
|
93 |
+
</p>
|
94 |
+
<?php endif; ?>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
<div class="col-2 col-wide">
|
99 |
+
<h4><?php echo $this->__('Items') ?> <span class="separator">|</span> <a href="<?php echo $this->getAddressesEditUrl() ?>"><?php echo $this->__('Edit Items') ?></a></h4>
|
100 |
+
<table class="data-table" id="overview-table-<?php echo $_address->getId() ?>">
|
101 |
+
<col />
|
102 |
+
<col width="1" />
|
103 |
+
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
104 |
+
<col width="1" />
|
105 |
+
<?php endif; ?>
|
106 |
+
<col width="1" />
|
107 |
+
<col width="1" />
|
108 |
+
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
109 |
+
<col width="1" />
|
110 |
+
<?php endif; ?>
|
111 |
+
<thead>
|
112 |
+
<tr>
|
113 |
+
<th rowspan="<?php echo $mergedCells; ?>"><?php echo $this->__('Product Name') ?></th>
|
114 |
+
<th colspan="<?php echo $mergedCells; ?>" class="a-center"><?php echo $this->__('Price') ?></th>
|
115 |
+
<th rowspan="<?php echo $mergedCells; ?>"><?php echo $this->__('Qty') ?></th>
|
116 |
+
<th colspan="<?php echo $mergedCells; ?>" class="a-center"><?php echo $this->__('Subtotal') ?></th>
|
117 |
+
</tr>
|
118 |
+
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
119 |
+
<tr>
|
120 |
+
<th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
|
121 |
+
<th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
|
122 |
+
<th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
|
123 |
+
<th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
|
124 |
+
</tr>
|
125 |
+
<?php endif; ?>
|
126 |
+
</thead>
|
127 |
+
<tfoot>
|
128 |
+
<?php echo $this->renderTotals($this->getShippingAddressTotals($_address)); ?>
|
129 |
+
</tfoot>
|
130 |
+
<tbody>
|
131 |
+
<?php foreach ($this->getShippingAddressItems($_address) as $_item): ?>
|
132 |
+
<?php echo $this->getRowItemHtml($_item); ?>
|
133 |
+
<?php endforeach; ?>
|
134 |
+
</tbody>
|
135 |
+
</table>
|
136 |
+
<script type="text/javascript">decorateTable('overview-table-<?php echo $_address->getId() ?>')</script>
|
137 |
+
</div>
|
138 |
+
<?php if (Mage::helper('orderrequest')->isEnable()) { ?>
|
139 |
+
<div class="col-2 col-wide">
|
140 |
+
<?php
|
141 |
+
$flag = Mage::getStoreConfig('orderrequest/orderrequest_general/enabled');
|
142 |
+
if ($flag) {
|
143 |
+
?>
|
144 |
+
|
145 |
+
<div class="customer-order-request">
|
146 |
+
<div class="field customer-order-request">
|
147 |
+
<label for="customer_order_request"><?php echo $this->__("Customer Order Comment"); ?></label>
|
148 |
+
<textarea id="customer_order_request_<?php echo $_address->getId() ?>" name="customer_order_request_<?php echo $_address->getId() ?>"></textarea>
|
149 |
+
</div>
|
150 |
+
</div>
|
151 |
+
|
152 |
+
<?php } ?>
|
153 |
+
</div>
|
154 |
+
<?php } ?>
|
155 |
+
<?php if ($this->getShippingAddressCount() != $_index + 1): ?>
|
156 |
+
<div class="divider"></div>
|
157 |
+
<?php endif; ?>
|
158 |
+
<?php endforeach; ?>
|
159 |
+
</div>
|
160 |
+
<?php if ($this->getQuote()->hasVirtualItems()): ?>
|
161 |
+
<div class="col2-set">
|
162 |
+
<h2 class="legend"><?php echo $this->__('Other Items in Your Order') ?></h2>
|
163 |
+
<div class="col-1 col-narrow"></div>
|
164 |
+
<div class="col-2 col-wide">
|
165 |
+
<h3><?php echo $this->__('Items') ?> <span class="separator">|</span> <a href="<?php echo $this->getVirtualProductEditUrl() ?>"><?php echo $this->__('Edit Items') ?></a></h3>
|
166 |
+
<?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
|
167 |
+
<table class="data-table" id="virtual-overview-table">
|
168 |
+
<col />
|
169 |
+
<col width="1" />
|
170 |
+
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
171 |
+
<col width="1" />
|
172 |
+
<?php endif; ?>
|
173 |
+
<col width="1" />
|
174 |
+
<col width="1" />
|
175 |
+
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
176 |
+
<col width="70" />
|
177 |
+
<?php endif; ?>
|
178 |
+
<thead>
|
179 |
+
<tr>
|
180 |
+
<th rowspan="<?php echo $mergedCells; ?>"><?php echo $this->__('Product Name') ?></th>
|
181 |
+
<th colspan="<?php echo $mergedCells; ?>" class="a-center"><?php echo $this->__('Price') ?></th>
|
182 |
+
<th rowspan="<?php echo $mergedCells; ?>"><?php echo $this->__('Qty') ?></th>
|
183 |
+
<th colspan="<?php echo $mergedCells; ?>" class="a-center"><?php echo $this->__('Subtotal') ?></th>
|
184 |
+
</tr>
|
185 |
+
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
186 |
+
<tr>
|
187 |
+
<th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
|
188 |
+
<th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
|
189 |
+
<th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
|
190 |
+
<th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
|
191 |
+
</tr>
|
192 |
+
<?php endif; ?>
|
193 |
+
</thead>
|
194 |
+
<tfoot>
|
195 |
+
<?php echo $this->renderTotals($this->getBillinAddressTotals()); ?>
|
196 |
+
</tfoot>
|
197 |
+
<tbody>
|
198 |
+
<?php foreach ($this->getVirtualItems() as $_item): ?>
|
199 |
+
<?php echo $this->getRowItemHtml($_item); ?>
|
200 |
+
<?php endforeach; ?>
|
201 |
+
</tbody>
|
202 |
+
</table>
|
203 |
+
<script type="text/javascript">decorateTable('virtual-overview-table')</script>
|
204 |
+
</div>
|
205 |
+
</div>
|
206 |
+
<?php endif; ?>
|
207 |
+
|
208 |
+
<?php echo $this->getChildHtml('items_after'); ?>
|
209 |
+
|
210 |
+
<div id="checkout-review-submit">
|
211 |
+
<?php echo $this->getChildHtml('agreements') ?>
|
212 |
+
<div class="place-order">
|
213 |
+
<div class="grand-total">
|
214 |
+
<div class="inner">
|
215 |
+
<big><?php echo $this->__('Grand Total:') ?> <?php echo $this->helper('checkout')->formatPrice($this->getTotal()) ?></big>
|
216 |
+
<div id="review-buttons-container">
|
217 |
+
<button type="submit" title="<?php echo $this->__('Place Order') ?>" class="button btn-checkout" id="review-button"><span><span><?php echo $this->__('Place Order') ?></span></span></button>
|
218 |
+
</div>
|
219 |
+
</div>
|
220 |
+
</div>
|
221 |
+
<span class="please-wait" id="review-please-wait" style="display:none;">
|
222 |
+
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Submitting order information...') ?>" title="<?php echo $this->__('Submitting order information...') ?>" class="v-middle" /> <?php echo $this->__('Submitting order information...') ?>
|
223 |
+
</span>
|
224 |
+
</div>
|
225 |
+
</div>
|
226 |
+
<div class="buttons-set">
|
227 |
+
<p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>« </small><?php echo $this->__('Back to Billing Information') ?></a></p>
|
228 |
+
</div>
|
229 |
+
</form>
|
230 |
+
<script type="text/javascript">
|
231 |
+
//<![CDATA[
|
232 |
+
var submitted = false;
|
233 |
+
|
234 |
+
function showLoader()
|
235 |
+
{
|
236 |
+
if (submitted) {
|
237 |
+
return false;
|
238 |
+
}
|
239 |
+
if ($('checkout-agreements')) {
|
240 |
+
var checkboxes = $$('#checkout-agreements input');
|
241 |
+
for (var i = 0, l = checkboxes.length; i < l; i++) {
|
242 |
+
if (!checkboxes[i].checked) {
|
243 |
+
alert("<?php echo $this->__('Please agree to all Terms and Conditions before placing the orders.') ?>");
|
244 |
+
return false;
|
245 |
+
}
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
submitted = true;
|
250 |
+
var step = 'review';
|
251 |
+
Element.show(step + '-please-wait');
|
252 |
+
$(step + '-buttons-container').setStyle({opacity: .5});
|
253 |
+
$(step + '-buttons-container').descendants().each(function(s) {
|
254 |
+
s.disabled = true;
|
255 |
+
});
|
256 |
+
return true;
|
257 |
+
}
|
258 |
+
//]]>
|
259 |
+
</script>
|
260 |
+
|
261 |
+
</div>
|
app/design/frontend/default/default/template/orderrequest/checkout/onepage/orderrequest.phtml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $flag = Mage::getStoreConfig('orderrequest/orderrequest_general/enabled');
|
2 |
+
if($flag){ ?>
|
3 |
+
<form id="customer-order-request" action="">
|
4 |
+
<div class="customer-order-request">
|
5 |
+
<div class="field customer-order-request">
|
6 |
+
<label for="customer_order_request"><?php echo $this->__("Customer Order Comment"); ?></label>
|
7 |
+
<textarea id="customer_order_request" name="customer_order_request"></textarea>
|
8 |
+
</div>
|
9 |
+
</div>
|
10 |
+
</form>
|
11 |
+
<?php } ?>
|
app/design/frontend/default/default/template/orderrequest/checkout/onepage/review.phtml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<script type="text/javascript" src="<?php echo $this->getSkinUrl('orderrequest/js/orderrequest.js'); ?>"></script>
|
2 |
+
<div class="order-review" id="checkout-review-load">
|
3 |
+
<!-- Content loaded dynamically -->
|
4 |
+
</div>
|
app/design/frontend/default/default/template/orderrequest/email/info.phtml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$_order = $this->getOrder();
|
3 |
+
$order_comment = $_order->getVisibleStatusHistory();
|
4 |
+
$_history = array_reverse($order_comment);
|
5 |
+
foreach($_history as $orderrequest){
|
6 |
+
echo nl2br(html_entity_decode($this->escapeHtml($orderrequest->getComment())));
|
7 |
+
break;
|
8 |
+
}
|
9 |
+
?>
|
app/design/frontend/default/default/template/orderrequest/order/view.phtml
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<div class="order-items order-details">
|
28 |
+
<?php if ($this->helper('giftmessage/message')->getIsMessagesAvailable('items', $this->getOrder())): ?>
|
29 |
+
<script type="text/javascript">
|
30 |
+
//<![CDATA[
|
31 |
+
function giftMessageToogle(giftMessageIdentifier)
|
32 |
+
{
|
33 |
+
var link = $('order-item-gift-message-link-'+giftMessageIdentifier);
|
34 |
+
var container = $('order-item-gift-message-'+giftMessageIdentifier);
|
35 |
+
var row = $('order-item-row-'+giftMessageIdentifier);
|
36 |
+
if(link.expanded) {
|
37 |
+
link.expanded = false;
|
38 |
+
link.removeClassName('expanded');
|
39 |
+
if(container.hasClassName('last')) {
|
40 |
+
row.addClassName('last');
|
41 |
+
}
|
42 |
+
container.hide();
|
43 |
+
} else {
|
44 |
+
link.expanded = true;
|
45 |
+
link.addClassName('expanded');
|
46 |
+
if(container.hasClassName('last')) {
|
47 |
+
row.removeClassName('last');
|
48 |
+
}
|
49 |
+
container.show();
|
50 |
+
}
|
51 |
+
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
//]]>
|
55 |
+
</script>
|
56 |
+
<?php endif; ?>
|
57 |
+
<?php $_order = $this->getOrder() ?>
|
58 |
+
<h2 class="table-caption"><?php echo $this->__('Items Ordered') ?>
|
59 |
+
<?php if ($_order->getTracksCollection()->count()) : ?>
|
60 |
+
<span class="separator">|</span> <a href="#" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','top=0,left=0,width=800,height=600,resizable=yes,scrollbars=yes'); return false;" title="<?php echo $this->__('Track your order') ?>"><?php echo $this->__('Track your order') ?></a>
|
61 |
+
<?php endif; ?>
|
62 |
+
</h2>
|
63 |
+
|
64 |
+
<?php echo $this->getChildHtml('order_items') ?>
|
65 |
+
|
66 |
+
<?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order', $_order) && $_order->getGiftMessageId()): ?>
|
67 |
+
<div class="order-additional order-gift-message">
|
68 |
+
<h2 class="sub-title"><?php echo $this->__('Gift Message for This Order') ?></h2>
|
69 |
+
<?php $_giftMessage=$this->helper('giftmessage/message')->getGiftMessageForEntity($_order); ?>
|
70 |
+
<dl class="gift-message">
|
71 |
+
<dt><strong><?php echo $this->__('From:') ?></strong> <?php echo $this->htmlEscape($_giftMessage->getSender()) ?></dt>
|
72 |
+
<dt><strong><?php echo $this->__('To:') ?></strong> <?php echo $this->htmlEscape($_giftMessage->getRecipient()) ?></dt>
|
73 |
+
<dd><?php echo $this->helper('giftmessage/message')->getEscapedGiftMessage($_order) ?></dd>
|
74 |
+
</dl>
|
75 |
+
</div>
|
76 |
+
<?php endif; ?>
|
77 |
+
<?php
|
78 |
+
$_history = $this->getOrder()->getVisibleStatusHistory();
|
79 |
+
$_history = array_reverse($_history);
|
80 |
+
?>
|
81 |
+
<?php if (count($_history)): ?>
|
82 |
+
<div class="order-additional order-comments">
|
83 |
+
<h2 class="sub-title"><?php echo $this->__('Order Comments') ?></h2>
|
84 |
+
<dl class="order-about">
|
85 |
+
<?php foreach ($_history as $_historyItem): ?>
|
86 |
+
<dt><?php echo $this->formatDate($_historyItem->getCreatedAtStoreDate(), 'medium', true) ?></dt>
|
87 |
+
<dd>
|
88 |
+
<?php echo nl2br(html_entity_decode($this->escapeHtml($_historyItem->getComment()))); ?>
|
89 |
+
</dd>
|
90 |
+
<?php endforeach; ?>
|
91 |
+
</dl>
|
92 |
+
</div>
|
93 |
+
<?php endif; ?>
|
94 |
+
|
95 |
+
<form enctype="multipart/form-data" method="post" action="<?php echo $this->getUrl('orderrequest/index/saveorderrequest/'); ?>orderid/<?php echo $_order->getEntityId(); ?>/" id="order-view-add-request">
|
96 |
+
<div class="customer-order-request">
|
97 |
+
<div class="field customer-order-view-addrequest">
|
98 |
+
<label for="customer_order_request"><?php echo $this->__("Customer Order Comment"); ?></label>
|
99 |
+
<textarea id="customer_order_request" name="customer_order_request" class="required-entry"></textarea>
|
100 |
+
</div>
|
101 |
+
<button style="" class="scalable save" type="button" id="save-order-request" onclick="orderrequestForm.submit();"><span><?php echo $this->__("Save Order Comment") ?></span></button>
|
102 |
+
</div>
|
103 |
+
</form>
|
104 |
+
|
105 |
+
<div class="buttons-set">
|
106 |
+
<p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>« </small><?php echo $this->getBackTitle() ?></a></p>
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
<script type="text/javascript">
|
110 |
+
var orderrequestForm = new VarienForm('order-view-add-request');
|
111 |
+
</script>
|
app/etc/modules/Biztech_All.xml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Biztech
|
5 |
+
* @package Biztech_All
|
6 |
+
* @author ModuleCreator
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Biztech_All>
|
13 |
+
<active>true</active>
|
14 |
+
<codePool>local</codePool>
|
15 |
+
</Biztech_All>
|
16 |
+
</modules>
|
17 |
+
<adminhtml>
|
18 |
+
<acl>
|
19 |
+
<resources>
|
20 |
+
<all>
|
21 |
+
<title>Allow Everything</title>
|
22 |
+
</all>
|
23 |
+
<admin>
|
24 |
+
<children>
|
25 |
+
<Biztech_All>
|
26 |
+
<title>All</title>
|
27 |
+
<sort_order>10</sort_order>
|
28 |
+
</Biztech_All>
|
29 |
+
<system>
|
30 |
+
<children>
|
31 |
+
<config>
|
32 |
+
<children>
|
33 |
+
<all>
|
34 |
+
<title>All</title>
|
35 |
+
</all>
|
36 |
+
</children>
|
37 |
+
</config>
|
38 |
+
</children>
|
39 |
+
</system>
|
40 |
+
</children>
|
41 |
+
</admin>
|
42 |
+
</resources>
|
43 |
+
</acl>
|
44 |
+
<layout>
|
45 |
+
<updates>
|
46 |
+
<all>
|
47 |
+
<file>all.xml</file>
|
48 |
+
</all>
|
49 |
+
</updates>
|
50 |
+
</layout>
|
51 |
+
</adminhtml>
|
52 |
+
</config>
|
app/etc/modules/Biztech_Orderrequest.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Biztech
|
5 |
+
* @package Biztech_Orderrequest
|
6 |
+
* @author ModuleCreator
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Biztech_Orderrequest>
|
13 |
+
<active>true</active>
|
14 |
+
<codePool>local</codePool>
|
15 |
+
</Biztech_Orderrequest>
|
16 |
+
</modules>
|
17 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>orderrequest_module</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Customer Order Comment Management Extension will help you get your customers’ comments/views before they shop from your store, helping you know your customers closely</summary>
|
10 |
+
<description>Can your customers comment on their orders prior to placing any order? It is important to understand what your customers think about your products or if they wish to comment something to improve their customer experience or for your store! 
|
11 |
+
You can now add this facility in your Magento store by configuring Customer Order Comment Management Extension. It will add a comment box in the checkout page and order page in the customer account for the customer to have a view of the history of comments being posted by him/her for various orders placed.
|
12 |
+
Core Features 
|
13 |
+
➢ Adds Request Box
|
14 |
+
Admin can add order request comment box in the last step of checkout process.
|
15 |
+
➢ Displays Order Comment in Two Places
|
16 |
+
Admin can view order comments in the form of grid listing or in order detail page as customer order request.
|
17 |
+

|
18 |
+
➢ Comment Visible to Customers
|
19 |
+
Customer can view order comment from order details page under ‘my account.’
|
20 |
+

|
21 |
+
➢ Adds New Comment
|
22 |
+
Customers can also add new request/comment from order details page under ‘my account.’
|
23 |
+
Users Gain
|
24 |
+
➢ Happy Customers as they get opportunity to comment
|
25 |
+
➢ Customers feel they are heard and important to business
|
26 |
+
➢ Develops customer retention and loyalty 
|
27 |
+
</description>
|
28 |
+
<notes>New Release</notes>
|
29 |
+
<authors><author><name>Biztech</name><user>biztechcon</user><email>sales@biztechconsultancy.com</email></author></authors>
|
30 |
+
<date>2014-12-26</date>
|
31 |
+
<time>10:02:47</time>
|
32 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Biztech_Orderrequest.xml" hash="48b1e9bbd625368c032363c709ef78c3"/><file name="Biztech_All.xml" hash="f4c3b9c029e56da8f09d7d71336c00f7"/></dir></target><target name="magelocal"><dir name="Biztech"><dir name="Orderrequest"><dir name="Block"><dir name="Adminhtml"><dir name="Orderrequest"><file name="Grid.php" hash="0c4fe9af377aca9635a0763cda82b28a"/></dir><file name="Orderrequest.php" hash="c401f951d409bb1c1baa06bb3b548a6f"/></dir><dir name="Email"><file name="Info.php" hash="5b09822c783eb08f141c44fb4b6e319f"/></dir><dir name="Order"><file name="View.php" hash="717551e6077b59d896285b1acf7e3a39"/></dir><file name="Orderrequest.php" hash="232dd62df54fd9c52fe7e455508ffda0"/></dir><dir name="Helper"><file name="Data.php" hash="31fb96a29df5a3b28538e1daf68c6aff"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Orderrequest"><file name="Collection.php" hash="4d74f5d9563e9bffb3ca9238ed778088"/></dir><file name="Orderrequest.php" hash="8a044dce2885a970adc6981ab1bd0a1a"/></dir><file name="Observer.php" hash="ca6fc470834bbe2ed6259515ee4346fc"/><file name="Orderrequest.php" hash="59e9f773919cdaaf41a139d14e1c4d44"/><file name="Status.php" hash="59269d75640f86f8954a0522f8d9ca23"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="OrderrequestController.php" hash="b15f4d5a4d49af21f794e227f010ffcd"/></dir><file name="IndexController.php" hash="2dd5737ea5721b375a63da9384ace851"/></dir><dir name="etc"><file name="config.xml" hash="cc3f8ab9c82b72aecec38fa19c133102"/><file name="system.xml" hash="6328d96275a2920defdbddca8a5fe39b"/></dir><dir name="sql"><dir name="orderrequest_setup"><file name="mysql4-install-0.1.0.php" hash="e25d6c2b1059b87555959642acfe17ee"/></dir></dir></dir><dir name="All"><dir name="Helper"><file name="Data.php" hash="e856726fd089e7f73ca7de450b696419"/></dir><dir name="Model"><file name="All.php" hash="a9aeeb9c6d7be9cf20414f405efc878d"/><dir name="Mysql4"><dir name="All"><file name="Collection.php" hash="a1909236183d126f38e628b85bb57e81"/></dir><file name="All.php" hash="f02542393eb26eadfb9b92d901d2ac12"/></dir><dir name="Source"><dir name="Updates"><file name="Type.php" hash="fa695bf4764c2d93c7436ed54bde89ba"/></dir></dir><file name="Status.php" hash="30a6f0da7d9d45e1082da532d5f8dabc"/><file name="Update.php" hash="83ceddbab4d621545b9c7c4bccdec7c0"/></dir><dir name="etc"><file name="config.xml" hash="27e403cedb861da03753d28527d9c664"/><file name="system.xml" hash="17262087dc933d934e09ac04cafb4c51"/></dir></dir></dir><dir name="modules"><file name="Biztech_Orderrequest.xml" hash=""/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="orderrequest.xml" hash="9bf9e996a6e2086545df15219bdb9e06"/></dir><dir name="template"><dir name="orderrequest"><file name="orderrequest.phtml" hash="c98e0c0d5052909d2879e191500c30d5"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="orderrequest.xml" hash="38c1a23aafe0ce557849d0de58d5fec8"/></dir><dir name="template"><dir name="orderrequest"><dir name="checkout"><dir name="multishipping"><file name="overview.phtml" hash="bd6cfe4fb9cafac8b34b7eafedf8b7c4"/></dir><dir name="onepage"><file name="orderrequest.phtml" hash="f37eee75e1c7e47239a659fc20ddc075"/><file name="review.phtml" hash="d88ab2da4a144e734e5d2a8ff79d53f9"/></dir></dir><dir name="email"><file name="info.phtml" hash="7ade9e9142b0383cc47ed1f7c710307a"/></dir><dir name="order"><file name="view.phtml" hash="54e142f07702dd90d87d8f8a63b498d7"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="orderrequest"><dir name="css"><file name="orderrequest.css" hash="4a597d7c279315b54c012ce40a24f857"/></dir><dir name="js"><file name="orderrequest.js" hash="3cb8bad416ffc6d93196228b81ae4e6a"/></dir></dir></dir></dir></dir></target></contents>
|
33 |
+
<compatible/>
|
34 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
35 |
+
</package>
|
skin/frontend/default/default/orderrequest/css/orderrequest.css
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.customer-order-request.field {
|
2 |
+
border: 1px solid #d9dde3;
|
3 |
+
border-width: 0 1px 1px;
|
4 |
+
padding: 10px 30px 15px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.customer-order-request.field > label {
|
8 |
+
font-weight: bold;
|
9 |
+
color: #666;
|
10 |
+
display: block;
|
11 |
+
margin-bottom: 6px;
|
12 |
+
}
|
13 |
+
|
14 |
+
.customer-order-request.field > textarea {
|
15 |
+
width: 98%;
|
16 |
+
min-height: 80px;
|
17 |
+
padding: 1%;
|
18 |
+
}
|
19 |
+
|
20 |
+
.customer-order-view-addrequest.field {
|
21 |
+
padding: 10px 30px;
|
22 |
+
}
|
23 |
+
|
24 |
+
.customer-order-view-addrequest.field > label {
|
25 |
+
font-weight: bold;
|
26 |
+
color: #666;
|
27 |
+
display: block;
|
28 |
+
margin-bottom: 6px;
|
29 |
+
}
|
30 |
+
|
31 |
+
.customer-order-view-addrequest.field > textarea {
|
32 |
+
width: 98%;
|
33 |
+
min-height: 80px;
|
34 |
+
}
|
35 |
+
|
36 |
+
#save-order-request{
|
37 |
+
float: right;
|
38 |
+
margin-right: 37px;
|
39 |
+
}
|
skin/frontend/default/default/orderrequest/js/orderrequest.js
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Override default review save method to append customer order request
|
3 |
+
*/
|
4 |
+
Review.addMethods({
|
5 |
+
save: function() {
|
6 |
+
if (checkout.loadWaiting!=false)
|
7 |
+
return;
|
8 |
+
|
9 |
+
var customerRequestForm = $('customer-order-request');
|
10 |
+
var customerRequestParams = Form.serialize(customerRequestForm);
|
11 |
+
|
12 |
+
checkout.setLoadWaiting('review');
|
13 |
+
|
14 |
+
var params = Form.serialize(payment.form);
|
15 |
+
|
16 |
+
if (this.agreementsForm)
|
17 |
+
params += '&'+Form.serialize(this.agreementsForm);
|
18 |
+
|
19 |
+
if (customerRequestParams)
|
20 |
+
params += '&'+customerRequestParams;
|
21 |
+
|
22 |
+
params.save = true;
|
23 |
+
|
24 |
+
var request = new Ajax.Request(
|
25 |
+
this.saveUrl,
|
26 |
+
{
|
27 |
+
method:'post',
|
28 |
+
parameters:params,
|
29 |
+
onComplete: this.onComplete,
|
30 |
+
onSuccess: this.onSave,
|
31 |
+
onFailure: checkout.ajaxFailure.bind(checkout)
|
32 |
+
}
|
33 |
+
);
|
34 |
+
}
|
35 |
+
});
|