Solwin_Trackorder - Version 1.0.0

Version Notes

Simple ajax order tracking informaion. No need to load whole page. You can change order status labels also from admin side.

Download this release

Release Info

Developer Sanjay Dabhoya
Extension Solwin_Trackorder
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (23) hide show
  1. app/code/community/Solwin/Trackorder/Block/Trackorder.php +75 -0
  2. app/code/community/Solwin/Trackorder/Block/Trackwidget.php +9 -0
  3. app/code/community/Solwin/Trackorder/Block/View.php +9 -0
  4. app/code/community/Solwin/Trackorder/Helper/Data.php +9 -0
  5. app/code/community/Solwin/Trackorder/Model/Observer.php +106 -0
  6. app/code/community/Solwin/Trackorder/Model/System/Config/Frontend/Widgetsettings.php +15 -0
  7. app/code/community/Solwin/Trackorder/controllers/IndexController.php +100 -0
  8. app/code/community/Solwin/Trackorder/etc/config.xml +161 -0
  9. app/code/community/Solwin/Trackorder/etc/system.xml +142 -0
  10. app/code/community/Solwin/Trackorder/etc/widget.xml +7 -0
  11. app/code/community/Solwin/Trackorder/sql/trackorder_setup/mysql4-install-1.0.0.php +39 -0
  12. app/design/frontend/default/default/layout/trackorder.xml +131 -0
  13. app/design/frontend/default/default/template/trackorder/info.phtml +62 -0
  14. app/design/frontend/default/default/template/trackorder/order/items.phtml +67 -0
  15. app/design/frontend/default/default/template/trackorder/shipment/items.phtml +44 -0
  16. app/design/frontend/default/default/template/trackorder/trackdetail.phtml +457 -0
  17. app/design/frontend/default/default/template/trackorder/trackorder.phtml +82 -0
  18. app/design/frontend/default/default/template/trackorder/trackorderlink.phtml +15 -0
  19. app/design/frontend/default/default/template/trackorder/trackwidget.phtml +15 -0
  20. app/design/frontend/default/default/template/trackorder/view.phtml +60 -0
  21. app/etc/modules/Solwin_Trackorder.xml +12 -0
  22. package.xml +22 -0
  23. skin/frontend/default/default/trackorder/css/trackorder.css +170 -0
app/code/community/Solwin/Trackorder/Block/Trackorder.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Solwin_Trackorder_Block_Trackorder extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getTrackorder()
10
+ {
11
+ if (!$this->hasData('trackorder')) {
12
+ $this->setData('trackorder', Mage::registry('current_order'));
13
+ }
14
+ return $this->getData('trackorder');
15
+
16
+ }
17
+ public function getTrackInfo($order)
18
+ {
19
+ $shipTrack = array();
20
+ if ($order) {
21
+ $shipments = $order->getShipmentsCollection();
22
+ foreach ($shipments as $shipment){
23
+ $increment_id = $shipment->getIncrementId();
24
+ $tracks = $shipment->getTracksCollection();
25
+
26
+ $trackingInfos=array();
27
+ foreach ($tracks as $track){
28
+ $trackingInfos[] = $track->getNumberDetail();
29
+ }
30
+ $shipTrack[$increment_id] = $trackingInfos;
31
+ }
32
+ }
33
+ return $shipTrack;
34
+ }
35
+ public function formatDeliveryDateTime($date, $time)
36
+ {
37
+ return $this->formatDeliveryDate($date) . ' ' . $this->formatDeliveryTime($time);
38
+ }
39
+
40
+ /**
41
+ * Format given date in current locale without changing timezone
42
+ *
43
+ * @param string $date
44
+ * @return string
45
+ */
46
+ public function formatDeliveryDate($date)
47
+ {
48
+ /* @var $locale Mage_Core_Model_Locale */
49
+ $locale = Mage::app()->getLocale();
50
+ $format = $locale->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
51
+ return $locale->date(strtotime($date), Zend_Date::TIMESTAMP, null, false)
52
+ ->toString($format);
53
+ }
54
+
55
+ /**
56
+ * Format given time [+ date] in current locale without changing timezone
57
+ *
58
+ * @param string $time
59
+ * @param string $date
60
+ * @return string
61
+ */
62
+ public function formatDeliveryTime($time, $date = null)
63
+ {
64
+ if (!empty($date)) {
65
+ $time = $date . ' ' . $time;
66
+ }
67
+
68
+ /* @var $locale Mage_Core_Model_Locale */
69
+ $locale = Mage::app()->getLocale();
70
+
71
+ $format = $locale->getTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
72
+ return $locale->date(strtotime($time), Zend_Date::TIMESTAMP, null, false)
73
+ ->toString($format);
74
+ }
75
+ }
app/code/community/Solwin/Trackorder/Block/Trackwidget.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Solwin_Trackorder_Block_Trackwidget extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface {
4
+
5
+ public function _prepareLayout()
6
+ {
7
+ return parent::_prepareLayout();
8
+ }
9
+ }
app/code/community/Solwin/Trackorder/Block/View.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Solwin_Trackorder_Block_View extends Mage_Core_Block_Template {
4
+
5
+ public function _prepareLayout() {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ }
app/code/community/Solwin/Trackorder/Helper/Data.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Solwin_Trackorder_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function getTrackorderUrl()
6
+ {
7
+ return $this->_getUrl('trackorder/index');
8
+ }
9
+ }
app/code/community/Solwin/Trackorder/Model/Observer.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Solwin_Trackorder_Model_Observer {
4
+
5
+ private static $_handleTrackLinkCounter = 1;
6
+
7
+ public function checkstatus(Varien_Event_Observer $observer) {
8
+ $params = Mage::app()->getRequest()->getParam('groups');
9
+ $configValue = $params['trackorder_general']['fields']['enabled']['value'];
10
+ if ($configValue == 0) {
11
+ $trackOrderConfig = new Mage_Core_Model_Config();
12
+ $trackOrderConfig->saveConfig('trackorder/trackorder_general/toplinks', "0");
13
+ $trackOrderConfig->saveConfig('trackorder/trackorder_general/topmenu', "0");
14
+ }
15
+
16
+ $showWidget = $params['trackorder_general']['fields']['show_widget']['value'];
17
+
18
+
19
+ if(version_compare(Mage::getVersion(), '1.5.1.0', '>')) {
20
+ $widgetInstance = Mage::getModel('widget/widget_instance')->getCollection()->addFieldToFilter('instance_type' , 'trackorder/trackwidget')->getData();
21
+ }
22
+ else
23
+ {
24
+ $widgetInstance = Mage::getModel('widget/widget_instance')->getCollection()->addFieldToFilter('type' , 'trackorder/trackwidget')->getData();
25
+ }
26
+
27
+
28
+ $widgetInstanceID = $widgetInstance[0]['instance_id'];
29
+ $widgetParameters = array(
30
+ 'param1' => 'This is some value from the widget form',
31
+ 'template' => 'trackorder/trackwidget.phtml'
32
+ );
33
+
34
+ $instance = Mage::getModel('widget/widget_instance')->load($widgetInstanceID);
35
+ $instance->setData(array(
36
+ 'instance_id' => $widgetInstanceID,
37
+ 'type' => 'trackorder/trackwidget',
38
+ 'package_theme' => 'default/default',
39
+ 'title' => 'Track Widget',
40
+ 'store_ids' => '0', // or comma separated list of ids
41
+ 'sort_order' => '0',
42
+ 'widget_parameters' => serialize($widgetParameters),
43
+ 'page_groups' => array(array(
44
+ 'page_group' => 'all_pages',
45
+ 'all_pages' => array(
46
+ 'page_id' => null,
47
+ 'group' => 'all_pages',
48
+ 'layout_handle' => 'default',
49
+ 'block' => $showWidget,
50
+ 'for' => 'all',
51
+ 'template' => $widgetParameters['template'],
52
+ )
53
+ ))
54
+ ))->save();
55
+
56
+ }
57
+
58
+ public function addlinkAdmin(Varien_Event_Observer $observer) {
59
+
60
+ if (Mage::app()->getRequest()->getControllerName() == 'sales_order_create' || Mage::app()->getRequest()->getControllerName() == 'sales_order_edit') {
61
+ if (self::$_handleTrackLinkCounter > 1) {
62
+ return $this;
63
+ }
64
+
65
+ $order = $observer->getEvent()->getOrder();
66
+ self::$_handleTrackLinkCounter++;
67
+ if ($order->getTrackLink() == NULL) {
68
+ $trackLink = substr(md5(microtime()), rand(0, 26), 6);
69
+
70
+ $order->setTrackLink($trackLink);
71
+ }
72
+ }
73
+ }
74
+
75
+ public function addlinkFront(Varien_Event_Observer $observer) {
76
+
77
+ if (Mage::app()->getRequest()->getControllerName() == 'onepage') {
78
+ if (self::$_handleTrackLinkCounter > 1) {
79
+ return $this;
80
+ }
81
+
82
+ $order = $observer->getEvent()->getOrder();
83
+ self::$_handleTrackLinkCounter++;
84
+ if ($order->getTrackLink() == NULL) {
85
+ $trackLink = substr(md5(microtime()), rand(0, 26), 6);
86
+ $order->setTrackLink($trackLink);
87
+ }
88
+ }
89
+ }
90
+
91
+
92
+ public function addmultishipLink(Varien_Event_Observer $observer) {
93
+
94
+ if (Mage::app()->getRequest()->getControllerName() == 'multishipping') {
95
+ $order = $observer->getEvent()->getOrder();
96
+
97
+ if ($order->getTrackLink() == NULL) {
98
+ $trackLink = substr(md5(microtime()), rand(0, 26), 6);
99
+ $order->setTrackLink($trackLink);
100
+ }
101
+ }
102
+ }
103
+
104
+ }
105
+
106
+ ?>
app/code/community/Solwin/Trackorder/Model/System/Config/Frontend/Widgetsettings.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Solwin_Trackorder_Model_System_Config_Frontend_Widgetsettings
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ return array(
8
+ array('value' => 'left',
9
+ 'label' => Mage::helper('trackorder')->__('Left Column')),
10
+ array('value' => 'right',
11
+ 'label' => Mage::helper('trackorder')->__('Right Column')),
12
+ );
13
+ }
14
+
15
+ }
app/code/community/Solwin/Trackorder/controllers/IndexController.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Solwin_Trackorder_IndexController extends Mage_Core_Controller_Front_Action {
4
+
5
+ public function indexAction() {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+
10
+ public function validate() {
11
+
12
+ }
13
+
14
+ public function initOrder() {
15
+ if ($data = $this->getRequest()->getPost()) {
16
+ $orderId = $data["order_id"];
17
+ $email = $data["email"];
18
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
19
+ $cEmail = $order->getCustomerEmail();
20
+ if ($cEmail == trim($email)) {
21
+ Mage::register('current_order', $order);
22
+ } else {
23
+ Mage::register('current_order', Mage::getModel("sales/order"));
24
+ }
25
+ }
26
+ }
27
+
28
+ public function trackAction() {
29
+ //$orderId = $this->getRequest()->getPost()
30
+ $post = $this->getRequest()->getPost();
31
+
32
+ if ($post) {
33
+ try {
34
+ if (!Zend_Validate::is(trim($post['order_id']), 'NotEmpty')) {
35
+ $error = true;
36
+ }
37
+ if (!Zend_Validate::is(trim($post['email']), 'NotEmpty')) {
38
+ $error = true;
39
+ }
40
+ if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
41
+ $error = true;
42
+ }
43
+ if ($error) {
44
+ throw new Exception();
45
+ }
46
+ $this->initOrder($post);
47
+ $order = Mage::registry('current_order');
48
+ if ($order->getId()) {
49
+
50
+ $this->getResponse()->setBody($this->getLayout()->getMessagesBlock()->getGroupedHtml() . $this->_getGridHtml());
51
+ return;
52
+ /* $this->loadLayout();
53
+ $this->renderLayout(); */
54
+ } else {
55
+ Mage::getSingleton('core/session')->addError(Mage::helper('contacts')->__('Order Not Found.Please try again later'));
56
+ $this->getResponse()->setBody($this->getLayout()->getMessagesBlock()->getGroupedHtml());
57
+ return;
58
+ }
59
+ } catch (Exception $e) {
60
+ Mage::getSingleton('core/session')->addError(Mage::helper('trackorder')->__('Please Enter Order Detail.'));
61
+ $this->getResponse()->setBody($this->getLayout()->getMessagesBlock()->getGroupedHtml());
62
+ return;
63
+ }
64
+ } else {
65
+ $this->_redirect('*/*/');
66
+ }
67
+ }
68
+
69
+ public function viewAction() {
70
+ $actionUrl = $_SERVER['REQUEST_URI'];
71
+ $pathinfo = pathinfo($actionUrl);
72
+ $trackid = $pathinfo['basename'];
73
+
74
+ $orderdata = Mage::getModel('sales/order')->getCollection()
75
+ ->addAttributeToFilter('track_link', $trackid)
76
+ ->getData();
77
+
78
+ $order = Mage::getModel('sales/order')->load($orderdata[0]['entity_id']);
79
+ if ($order->getId()) {
80
+ Mage::register('current_order', $order);
81
+ $this->loadLayout();
82
+ $this->renderLayout();
83
+ return true;
84
+ } else {
85
+ Mage::getSingleton('core/session')->addError($this->__('Order not found. Please try again later.'));
86
+ $this->_redirect('*/*/');
87
+ }
88
+ }
89
+
90
+ protected function _getGridHtml() {
91
+ $layout = $this->getLayout();
92
+ $update = $layout->getUpdate();
93
+ $update->load("trackorder_index_track");
94
+ $layout->generateXml();
95
+ $layout->generateBlocks();
96
+ $output = $layout->getOutput();
97
+ return $output;
98
+ }
99
+
100
+ }
app/code/community/Solwin/Trackorder/etc/config.xml ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Solwin_Trackorder>
5
+ <version>1.0.0</version>
6
+ </Solwin_Trackorder>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <trackorder>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Solwin_Trackorder</module>
14
+ <frontName>trackorder</frontName>
15
+ </args>
16
+ </trackorder>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <trackorder>
21
+ <file>trackorder.xml</file>
22
+ </trackorder>
23
+ </updates>
24
+ </layout>
25
+ <events>
26
+ <sales_order_save_after>
27
+ <observers>
28
+ <trackorder_link>
29
+ <type>singleton</type>
30
+ <class>trackorder/observer</class>
31
+ <method>addlinkFront</method>
32
+ </trackorder_link>
33
+ </observers>
34
+ </sales_order_save_after>
35
+ <checkout_type_multishipping_create_orders_single>
36
+ <observers>
37
+ <trackorder_multishiplink>
38
+ <type>singleton</type>
39
+ <class>trackorder/observer</class>
40
+ <method>addmultishipLink</method>
41
+ </trackorder_multishiplink>
42
+ </observers>
43
+ </checkout_type_multishipping_create_orders_single>
44
+
45
+ </events>
46
+ </frontend>
47
+ <admin>
48
+ <routers>
49
+ <trackorder>
50
+ <use>admin</use>
51
+ <args>
52
+ <module>Solwin_Trackorder</module>
53
+ <frontName>trackorder</frontName>
54
+ </args>
55
+ </trackorder>
56
+ </routers>
57
+ </admin>
58
+ <adminhtml>
59
+ <acl>
60
+ <resources>
61
+ <all>
62
+ <title>Allow Everything</title>
63
+ </all>
64
+ <admin>
65
+ <children>
66
+ <Solwin_Trackorder>
67
+ <title>Trackorder Module</title>
68
+ <sort_order>10</sort_order>
69
+ </Solwin_Trackorder>
70
+ <system>
71
+ <children>
72
+ <config>
73
+ <children>
74
+ <trackorder>
75
+ <title>Track Order</title>
76
+ </trackorder>
77
+ </children>
78
+ </config>
79
+ </children>
80
+ </system>
81
+ </children>
82
+ </admin>
83
+ </resources>
84
+ </acl>
85
+ <layout>
86
+ <updates>
87
+ <trackorder>
88
+ <file>trackorder.xml</file>
89
+ </trackorder>
90
+ </updates>
91
+ </layout>
92
+ <events>
93
+ <admin_system_config_changed_section_trackorder>
94
+ <observers>
95
+ <trackorder_status>
96
+ <type>model</type>
97
+ <class>trackorder/observer</class>
98
+ <method>checkstatus</method>
99
+ </trackorder_status>
100
+ </observers>
101
+ </admin_system_config_changed_section_trackorder>
102
+ <sales_order_save_after>
103
+ <observers>
104
+ <trackorder_link>
105
+ <type>singleton</type>
106
+ <class>trackorder/observer</class>
107
+ <method>addlinkAdmin</method>
108
+ </trackorder_link>
109
+ </observers>
110
+ </sales_order_save_after>
111
+ </events>
112
+ </adminhtml>
113
+ <global>
114
+ <models>
115
+ <trackorder>
116
+ <class>Solwin_Trackorder_Model</class>
117
+ <resourceModel>trackorder_mysql4</resourceModel>
118
+ </trackorder>
119
+ <trackorder_mysql4>
120
+ <class>Solwin_Trackorder_Model_Mysql4</class>
121
+ <entities>
122
+ <trackorder>
123
+ <table>trackorder</table>
124
+ </trackorder>
125
+ </entities>
126
+ </trackorder_mysql4>
127
+ </models>
128
+ <resources>
129
+ <trackorder_setup>
130
+ <setup>
131
+ <module>Solwin_Trackorder</module>
132
+ </setup>
133
+ <connection>
134
+ <use>core_setup</use>
135
+ </connection>
136
+ </trackorder_setup>
137
+ <trackorder_write>
138
+ <connection>
139
+ <use>core_write</use>
140
+ </connection>
141
+ </trackorder_write>
142
+ <trackorder_read>
143
+ <connection>
144
+ <use>core_read</use>
145
+ </connection>
146
+ </trackorder_read>
147
+ </resources>
148
+
149
+
150
+ <blocks>
151
+ <trackorder>
152
+ <class>Solwin_Trackorder_Block</class>
153
+ </trackorder>
154
+ </blocks>
155
+ <helpers>
156
+ <trackorder>
157
+ <class>Solwin_Trackorder_Helper</class>
158
+ </trackorder>
159
+ </helpers>
160
+ </global>
161
+ </config>
app/code/community/Solwin/Trackorder/etc/system.xml ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <config>
3
+ <tabs>
4
+ <solwin translate="label" module="trackorder">
5
+ <label>Solwin</label>
6
+ <sort_order>400</sort_order>
7
+ </solwin>
8
+ </tabs>
9
+ <sections>
10
+ <trackorder translate="label" module="trackorder">
11
+ <label>Track Order</label>
12
+ <tab>solwin</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
+ <trackorder_general translate="label">
20
+ <label>General</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>100</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
+ <toplinks translate="label">
38
+ <label>Display in Top Links</label>
39
+ <frontend_type>select</frontend_type>
40
+ <source_model>adminhtml/system_config_source_yesno</source_model>
41
+ <sort_order>150</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ <comment>Select Yes to allow for Top Links.</comment>
46
+ <depends>
47
+ <enabled>1</enabled>
48
+ </depends>
49
+ </toplinks>
50
+ <topmenu translate="label">
51
+ <label>Display in Top Menu</label>
52
+ <frontend_type>select</frontend_type>
53
+ <source_model>adminhtml/system_config_source_yesno</source_model>
54
+ <sort_order>200</sort_order>
55
+ <show_in_default>1</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ <show_in_store>1</show_in_store>
58
+ <comment>Select Yes to allow for Top Menu.</comment>
59
+ <depends>
60
+ <enabled>1</enabled>
61
+ </depends>
62
+ </topmenu>
63
+ <footerlink translate="label">
64
+ <label>Display in Footer Links</label>
65
+ <frontend_type>select</frontend_type>
66
+ <source_model>adminhtml/system_config_source_yesno</source_model>
67
+ <sort_order>200</sort_order>
68
+ <show_in_default>1</show_in_default>
69
+ <show_in_website>1</show_in_website>
70
+ <show_in_store>1</show_in_store>
71
+ <comment>Select Yes to allow for Footer Links.</comment>
72
+ <depends>
73
+ <enabled>1</enabled>
74
+ </depends>
75
+ </footerlink>
76
+ <show_widget translate="label">
77
+ <label>Show TrackOrder Widget</label>
78
+ <frontend_type>select</frontend_type>
79
+ <source_model>trackorder/system_config_frontend_widgetsettings</source_model>
80
+ <sort_order>250</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>1</show_in_website>
83
+ <show_in_store>1</show_in_store>
84
+ <comment>Choose column for widget to appear</comment>
85
+ </show_widget>
86
+ </fields>
87
+ </trackorder_general>
88
+ <trackorder_orderstatus translate="label">
89
+ <label>Order Status Label</label>
90
+ <frontend_type>text</frontend_type>
91
+ <sort_order>20</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>.
95
+ <comment>Give label which you want to display on front end for particular status.</comment>
96
+ <fields>
97
+ <pending translate="label">
98
+ <label>Pending Status Label</label>
99
+ <frontend_type>text</frontend_type>
100
+ <sort_order>1</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>1</show_in_website>
103
+ <show_in_store>1</show_in_store>
104
+ </pending>
105
+ <processing translate="label">
106
+ <label>Processing Status Label</label>
107
+ <frontend_type>text</frontend_type>
108
+ <sort_order>2</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>1</show_in_store>
112
+ </processing>
113
+ <complete translate="label">
114
+ <label>Complete Status Label</label>
115
+ <frontend_type>text</frontend_type>
116
+ <sort_order>3</sort_order>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>1</show_in_website>
119
+ <show_in_store>1</show_in_store>
120
+ </complete>
121
+ <canceled translate="label">
122
+ <label>Canceled Status Label</label>
123
+ <frontend_type>text</frontend_type>
124
+ <sort_order>3</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>1</show_in_website>
127
+ <show_in_store>1</show_in_store>
128
+ </canceled>
129
+ <closed translate="label">
130
+ <label>Closed Status Label</label>
131
+ <frontend_type>text</frontend_type>
132
+ <sort_order>3</sort_order>
133
+ <show_in_default>1</show_in_default>
134
+ <show_in_website>1</show_in_website>
135
+ <show_in_store>1</show_in_store>
136
+ </closed>
137
+ </fields>
138
+ </trackorder_orderstatus>
139
+ </groups>
140
+ </trackorder>
141
+ </sections>
142
+ </config>
app/code/community/Solwin/Trackorder/etc/widget.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <widgets>
3
+ <trackorder_trackwidget type="trackorder/trackwidget">
4
+ <name>Track Order</name>
5
+ <description type="desc">Track Order Link</description>
6
+ </trackorder_trackwidget>
7
+ </widgets>
app/code/community/Solwin/Trackorder/sql/trackorder_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $installer->run("ALTER TABLE `{$this->getTable('sales/order')}` ADD `track_link` VARCHAR(255) NOT NULL;");
7
+
8
+
9
+
10
+ $widgetParameters = array(
11
+ 'param1' => 'track widget',
12
+ 'template' => 'trackorder/trackwidget.phtml'
13
+ );
14
+
15
+ $instance = Mage::getModel('widget/widget_instance')->setData(array(
16
+ 'type' => 'trackorder/trackwidget',
17
+ 'package_theme' => 'default/default', // has to match the concrete theme containing the template
18
+ 'title' => 'Track Widget',
19
+ 'store_ids' => '0', // or comma separated list of ids
20
+ 'sort_order' => '0',
21
+ 'widget_parameters' => serialize($widgetParameters),
22
+ 'page_groups' => array(array(
23
+ 'page_group' => 'all_pages',
24
+ 'all_pages' => array(
25
+ 'page_id' => null,
26
+ 'group' => 'all_pages',
27
+ 'layout_handle' => 'default',
28
+ 'block' => 'left',
29
+ 'for' => 'all',
30
+ 'template' => $widgetParameters['template'],
31
+
32
+ )
33
+ ))
34
+ ))->save();
35
+
36
+
37
+
38
+ $installer->endSetup();
39
+ ?>
app/design/frontend/default/default/layout/trackorder.xml ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss" >
6
+ <stylesheet>trackorder/css/trackorder.css</stylesheet>
7
+ </action>
8
+ </reference>
9
+ <reference name="top.links">
10
+ <action method="addLink" translate="label title" module="trackorder" ifconfig="trackorder/trackorder_general/toplinks">
11
+ <label>Trackorder</label>
12
+ <url helper="trackorder/getTrackorderUrl"/>
13
+ <title>Trackorder</title>
14
+ <prepare/>
15
+ <urlParams/>
16
+ <position>20</position>
17
+ </action>
18
+ </reference>
19
+ <reference name="top.menu">
20
+ <block type="trackorder/trackorder" template="trackorder/trackorderlink.phtml"/>
21
+ </reference>
22
+ <reference name="footer_links">
23
+ <action method="addLink" translate="label title" module="trackorder" ifconfig="trackorder/trackorder_general/footerlink">
24
+ <label>Trackorder</label>
25
+ <url helper="trackorder/getTrackorderUrl"/>
26
+ <title>Trackorder</title>
27
+ <prepare/>
28
+ <urlParams/>
29
+ <position>20</position>
30
+ </action>
31
+ </reference>
32
+ </default>
33
+ <trackorder_index_index>
34
+ <reference name="root">
35
+ <action method="setTemplate">
36
+ <template>page/1column.phtml</template>
37
+ </action>
38
+ <action method="setHeaderTitle" translate="title" module="trackorder">
39
+ <title>Track Your Order</title>
40
+ </action>
41
+ </reference>
42
+ <reference name="content">
43
+ <block type="trackorder/trackorder" name="trackorder" template="trackorder/trackorder.phtml" />
44
+ </reference>
45
+ </trackorder_index_index>
46
+
47
+ <trackorder_index_track>
48
+ <reference name="content">
49
+ <block type="trackorder/trackorder" name="root" output="toHtml" template="trackorder/trackdetail.phtml">
50
+ </block>
51
+ </reference>
52
+ </trackorder_index_track>
53
+
54
+ <trackorder_index_view>
55
+ <label>Customer My Account Order View</label>
56
+ <reference name="root">
57
+ <action method="setTemplate">
58
+ <template>page/1column.phtml</template>
59
+ </action>
60
+ </reference>
61
+ <reference name="content">
62
+ <block type="sales/order_info" as="info" name="sales.order.info" template="trackorder/info.phtml">
63
+ <block type="sales/order_info_buttons" as="buttons" name="sales.order.info.buttons" />
64
+ </block>
65
+ <block type="sales/order_view" name="sales.order.view" template="trackorder/view.phtml">
66
+ <block type="sales/order_items" name="order_items" template="sales/order/items.phtml">
67
+ <action method="addItemRender">
68
+ <type>default</type>
69
+ <block>sales/order_item_renderer_default</block>
70
+ <template>sales/order/items/renderer/default.phtml</template>
71
+ </action>
72
+ <action method="addItemRender">
73
+ <type>grouped</type>
74
+ <block>sales/order_item_renderer_grouped</block>
75
+ <template>sales/order/items/renderer/default.phtml</template>
76
+ </action>
77
+ <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
78
+ <action method="setLabelProperties">
79
+ <value>colspan="4" class="a-right"</value>
80
+ </action>
81
+ <action method="setValueProperties">
82
+ <value>class="last a-right"</value>
83
+ </action>
84
+ <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml" />
85
+ </block>
86
+ </block>
87
+ </block>
88
+ </reference>
89
+ <reference name="sales.order.info">
90
+ <action method="addLink" translate="label" module="sales">
91
+ <name>view</name>
92
+ <path></path>
93
+ <label>Order Information</label>
94
+ </action>
95
+ <action method="addLink" translate="label" module="sales">
96
+ <name>invoice</name>
97
+ <path>*/*/invoice</path>
98
+ <label>Invoices</label>
99
+ </action>
100
+ <action method="addLink" translate="label" module="sales">
101
+ <name>shipment</name>
102
+ <path>*/*/shipment</path>
103
+ <label>Shipments</label>
104
+ </action>
105
+ <action method="addLink" translate="label" module="sales">
106
+ <name>creditmemo</name>
107
+ <path>*/*/creditmemo</path>
108
+ <label>Refunds</label>
109
+ </action>
110
+ </reference>
111
+ </trackorder_index_view>
112
+
113
+
114
+ <sales_email_order_items>
115
+ <reference name="items">
116
+ <action method="setTemplate" ifconfig="trackorder/trackorder_general/enabled">
117
+ <template>trackorder/order/items.phtml</template>
118
+ </action>
119
+ </reference>
120
+ </sales_email_order_items>
121
+
122
+
123
+ <sales_email_order_shipment_items translate="label">
124
+ <reference name="items">
125
+ <action method="setTemplate" ifconfig="trackorder/trackorder_general/enabled">
126
+ <template>trackorder/shipment/items.phtml</template>
127
+ </action>
128
+ </reference>
129
+ </sales_email_order_shipment_items>
130
+
131
+ </layout>
app/design/frontend/default/default/template/trackorder/info.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /** @var $this Mage_Sales_Block_Order_Info */ ?>
2
+ <?php $_order = $this->getOrder() ?>
3
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
4
+ <div class="page-title title-buttons">
5
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
6
+ <?php echo $this->getChildHtml('buttons') ?>
7
+ </div>
8
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
9
+ <dl class="order-info">
10
+ <dt><?php echo $this->__('Order Information') ?></dt>
11
+ </dl>
12
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
13
+ <?php if (!$_order->getIsVirtual()): ?>
14
+ <div class="col2-set order-info-box">
15
+ <div class="col-1">
16
+ <div class="box">
17
+ <div class="box-title">
18
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
19
+ </div>
20
+ <div class="box-content">
21
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <div class="col-2">
26
+ <div class="box">
27
+ <div class="box-title">
28
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
29
+ </div>
30
+ <div class="box-content">
31
+ <?php if ($_order->getShippingDescription()): ?>
32
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
33
+ <?php else: ?>
34
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
35
+ <?php endif; ?>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ <?php endif; ?>
41
+ <div class="col2-set order-info-box">
42
+ <div class="col-1">
43
+ <div class="box">
44
+ <div class="box-title">
45
+ <h2><?php echo $this->__('Billing Address') ?></h2>
46
+ </div>
47
+ <div class="box-content">
48
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ <div class="col-2">
53
+ <div class="box box-payment">
54
+ <div class="box-title">
55
+ <h2><?php echo $this->__('Payment Method') ?></h2>
56
+ </div>
57
+ <div class="box-content">
58
+ <?php echo $this->getPaymentInfoHtml() ?>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
app/design/frontend/default/default/template/trackorder/order/items.phtml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_order = $this->getOrder() ?>
2
+ <?php if ($_order): ?>
3
+ <table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
4
+ <thead>
5
+ <tr>
6
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Item') ?></th>
7
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
8
+ <th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Qty') ?></th>
9
+ <th align="right" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Subtotal') ?></th>
10
+ </tr>
11
+ </thead>
12
+
13
+ <?php $i=0; foreach ($_order->getAllItems() as $_item): ?>
14
+ <?php if($_item->getParentItem()) continue; else $i++; ?>
15
+ <tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
16
+ <?php echo $this->getItemHtml($_item) ?>
17
+ </tbody>
18
+ <?php endforeach; ?>
19
+
20
+ <tbody>
21
+ <?php echo $this->getChildHtml('order_totals') ?>
22
+ </tbody>
23
+ </table>
24
+ <?php if ($this->helper('giftmessage/message')->isMessagesAvailable('order', $_order, $_order->getStore()) && $_order->getGiftMessageId()): ?>
25
+ <?php $_giftMessage = $this->helper('giftmessage/message')->getGiftMessage($_order->getGiftMessageId()); ?>
26
+ <?php if ($_giftMessage): ?>
27
+ <br />
28
+ <table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #EAEAEA;">
29
+ <thead>
30
+ <tr>
31
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><strong><?php echo $this->__('Gift Message for this Order') ?></strong></th>
32
+ </tr>
33
+ </thead>
34
+
35
+ <tbody>
36
+
37
+ <tr>
38
+ <td colspan="4" align="left" style="padding:3px 9px">
39
+ <strong><?php echo $this->__('From:'); ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?>
40
+ <br /><strong><?php echo $this->__('To:'); ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?>
41
+ <br /><strong><?php echo $this->__('Message:'); ?></strong><br /> <?php echo $this->escapeHtml($_giftMessage->getMessage()) ?>
42
+ </td>
43
+ </tr>
44
+ </tbody>
45
+ </table>
46
+ <?php endif; ?>
47
+ <?php endif; ?>
48
+ <?php if(Mage::getStoreConfig('trackorder/trackorder_general/enabled') && Mage::getStoreConfig('trackorder/trackorder_general/sendtrack_link') && ($_order->getTrackLink() != NULL)) { ?>
49
+ <br />
50
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
51
+ <thead>
52
+ <tr>
53
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Track Your Order') ?></th>
54
+ </tr>
55
+ </thead>
56
+ <tbody>
57
+ <tr>
58
+ <td style="font-size: 12px; padding: 7px 9px 9px 9px; border-left: 1px solid #EAEAEA;
59
+ border-bottom: 1px solid #EAEAEA; border-right: 1px solid #EAEAEA;">
60
+ <?php echo $this->__('Track Your Order ');?>
61
+ <a style="text-decoration: none;" href="<?php echo Mage::getBaseUrl().'trackorder/index/view/'.$_order->getTrackLink();?>"> <?php echo $this->__('Here');?></a>
62
+ </td>
63
+ </tr>
64
+ </tbody>
65
+ </table>
66
+ <?php } ?>
67
+ <?php endif; ?>
app/design/frontend/default/default/template/trackorder/shipment/items.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_shipment = $this->getShipment() ?>
2
+ <?php $_order = $this->getOrder() ?>
3
+ <?php if ($_shipment && $_order): ?>
4
+ <table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
5
+ <thead>
6
+ <tr>
7
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Item') ?></th>
8
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
9
+ <th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Qty') ?></th>
10
+ </tr>
11
+ </thead>
12
+
13
+ <?php $i=0; foreach ($_shipment->getAllItems() as $_item): ?>
14
+ <?php if($_item->getOrderItem()->getParentItem()) continue; else $i++; ?>
15
+ <tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
16
+ <?php echo $this->getItemHtml($_item) ?>
17
+ </tbody>
18
+ <?php endforeach; ?>
19
+ </table>
20
+
21
+ <?php if(Mage::getStoreConfig('trackorder/trackorder_general/enabled') && Mage::getStoreConfig('trackorder/trackorder_general/sendtrack_link') && ($_order->getTrackLink() != NULL)) { ?>
22
+
23
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
24
+ <thead>
25
+ <tr>
26
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Track Your Order') ?></th>
27
+ </tr>
28
+ </thead>
29
+ <tbody bgcolor="#F6F6F6">
30
+ <tr>
31
+ <td style="font-size: 12px; padding: 7px 9px 9px 9px; border-left: 1px solid #EAEAEA;
32
+ border-bottom: 1px solid #EAEAEA; border-right: 1px solid #EAEAEA;">
33
+ <?php echo $this->__('Track Your Order ');?>
34
+ <a style="text-decoration: none;" href="<?php echo Mage::getBaseUrl().'trackorder/index/view/'.$_order->getTrackLink();?>"> <?php echo $this->__('Here');?></a>
35
+ </td>
36
+ </tr>
37
+ </tbody>
38
+ </table>
39
+ <?php } ?>
40
+
41
+ <?php endif; ?>
42
+
43
+
44
+
app/design/frontend/default/default/template/trackorder/trackdetail.phtml ADDED
@@ -0,0 +1,457 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $order = $this->getTrackOrder();
3
+
4
+ $shipTrack = array();
5
+ if ($order) {
6
+ $shipments = $order->getShipmentsCollection();
7
+ foreach ($shipments as $shipment) {
8
+ $increment_id = $shipment->getIncrementId();
9
+ $tracks = $shipment->getTracksCollection();
10
+
11
+ $trackingInfos = array();
12
+ foreach ($tracks as $track) {
13
+ $trackingInfos[] = $track->getNumberDetail();
14
+ }
15
+ $shipTrack[$increment_id] = $trackingInfos;
16
+ }
17
+ }
18
+ $order_id = $order['increment_id'];
19
+ $order_item = Mage::getModel("sales/order")->loadByIncrementId($order_id);
20
+ $items = $order_item->getItemsCollection();
21
+ $order_details = Mage::getModel('sales/order')->loadByIncrementId($order_id);
22
+ $colspan = $rowspan = 2;
23
+
24
+ // Get shipping method
25
+ $shipping_method = $order_details->_data["shipping_description"];
26
+
27
+ // Get ship-to address information
28
+ $shipping_address_data = $order_details->getShippingAddress();
29
+ $billingAddress = $order_details->getBillingAddress();
30
+
31
+ //country codes
32
+ $shippcode = $order_details->getShippingAddress()->getCountry();
33
+ $billcode = $order_details->getBillingAddress()->getCountry();
34
+
35
+ $paymentmethod = $order->getPayment()->getMethodInstance()->getTitle();
36
+ //credit card information
37
+ $payarry = $order->getPayment()->debug();
38
+
39
+ foreach (Mage::getSingleton('payment/config')->getCcTypes() as $code => $name) {
40
+ if ($payarry['cc_type'] == $code) {
41
+ $options = $name;
42
+ }
43
+ }
44
+ $pending = Mage::getStoreConfig('trackorder/trackorder_orderstatus/pending');
45
+ $processing = Mage::getStoreConfig('trackorder/trackorder_orderstatus/processing');
46
+ $complete = Mage::getStoreConfig('trackorder/trackorder_orderstatus/complete');
47
+ $canceled = Mage::getStoreConfig('trackorder/trackorder_orderstatus/canceled');
48
+ $closed = Mage::getStoreConfig('trackorder/trackorder_orderstatus/closed');
49
+
50
+ $pending_class = $processing_class = $complete_pclass = $canceled_class = $closed_class = "";
51
+ if ($order->getStatusLabel() == 'Pending') {
52
+ $pending_class = 'active_order';
53
+ }
54
+ if ($order->getStatusLabel() == 'Processing') {
55
+ $processing_class = 'active_order';
56
+ }
57
+ if ($order->getStatusLabel() == 'Complete') {
58
+ $complete_pclass = 'active_order';
59
+ }
60
+ if ($order->getStatusLabel() == 'Canceled') {
61
+ $canceled_class = 'active_order';
62
+ }
63
+ if ($order->getStatusLabel() == 'Closed') {
64
+ $closed_class = 'active_order';
65
+ }
66
+ ?>
67
+ <?php $_results = $shipTrack; ?>
68
+ <div class="page-title title-buttons">
69
+ <h1><?php echo $this->__('Tracking Information'); ?></h1>
70
+ </div>
71
+
72
+ <div class="statuses">
73
+ <span class="<?php echo $pending_class; ?>"><?php
74
+ if ($pending)
75
+ echo $pending;
76
+ else
77
+ echo "Pending";
78
+ ?></span>
79
+ <span class="<?php echo $processing_class; ?>"><?php
80
+ if ($processing)
81
+ echo $processing;
82
+ else
83
+ echo 'Processing';
84
+ ?></span>
85
+ <span class="<?php echo $complete_pclass; ?>"><?php
86
+ if ($complete)
87
+ echo $complete;
88
+ else
89
+ echo 'Complete';
90
+ ?></span>
91
+ <span class="<?php echo $canceled_class; ?>"><?php
92
+ if ($canceled)
93
+ echo $canceled;
94
+ else
95
+ echo 'Canceled';
96
+ ?></span>
97
+ <span class="<?php echo $closed_class; ?>"><?php
98
+ if ($closed)
99
+ echo $closed;
100
+ else
101
+ echo Closed;
102
+ ?></span>
103
+ </div>
104
+
105
+ <p><?php echo $this->__("Your Order Status is :") ?> <strong><?php echo $order->getStatusLabel() ?></strong></p>
106
+
107
+ <?php if (sizeof($_results) > 0): ?>
108
+ <?php foreach ($_results as $shipid => $_result): ?>
109
+ <?php if ($shipid): ?>
110
+ <h4><?php echo $this->__('Shipment #') . $shipid; ?></h4>
111
+ <?php endif; ?>
112
+ <?php if (sizeof($_result) > 0): ?>
113
+ <?php
114
+ $rowCount = sizeof($_result);
115
+ $counter = 1;
116
+ ?>
117
+ <?php foreach ($_result as $track): ?>
118
+ <table class="data-table track-data-table">
119
+ <col width="15%" />
120
+ <col />
121
+ <tbody>
122
+ <?php if (is_object($track)): ?>
123
+ <tr>
124
+ <th><?php echo $this->__('Tracking Number:'); ?></th>
125
+ <td><?php echo $track->getTracking(); ?></td>
126
+ </tr>
127
+ <?php if ($track->getCarrierTitle()): ?>
128
+ <tr>
129
+ <th><?php echo $this->__('Carrier:'); ?></th>
130
+ <td><?php echo $track->getCarrierTitle(); ?></td>
131
+ </tr>
132
+ <?php endif; ?>
133
+ <?php if ($track->getErrorMessage()): ?>
134
+ <tr>
135
+ <th><?php echo $this->__('Error:'); ?></th>
136
+ <td class="error"><?php if ((bool) Mage::getStoreConfig('contacts/contacts/enabled')) : ?><a href="<?php echo $this->getUrl('contacts') ?>" onclick="this.target = '_blank'"><?php echo $this->__('Click here') ?></a><?php
137
+ echo $this->__(' to get details or ');
138
+ endif;
139
+ echo $this->__('email us at ');
140
+ ?><a href="mailto:<?php echo Mage::getStoreConfig('trans_email/ident_support/email'); ?>"><?php echo Mage::getStoreConfig('trans_email/ident_support/email') ?></a>
141
+
142
+ </td>
143
+ </tr>
144
+ <?php elseif ($track->getTrackSummary()): ?>
145
+ <tr>
146
+ <th><?php echo $this->__('Info:'); ?></th>
147
+ <td><?php echo $track->getTrackSummary(); ?></td>
148
+ </tr>
149
+ <?php elseif ($track->getUrl()): ?>
150
+ <tr>
151
+ <th><?php echo $this->__('Track:'); ?></th>
152
+ <td><a href="<?php echo $track->getUrl(); ?>" onclick="this.target = '_blank'"><?php echo $this->__('Click here to get details'); ?></a></td>
153
+ </tr>
154
+ <?php else: ?>
155
+ <?php if ($track->getStatus()): ?>
156
+ <tr>
157
+ <th><?php echo $this->__('Status:'); ?></th>
158
+ <td><?php echo $track->getStatus(); ?></td>
159
+ </tr>
160
+ <?php endif; ?>
161
+
162
+ <?php if ($track->getDeliverydate()): ?>
163
+ <tr>
164
+ <th><?php echo $this->__('Delivered on:'); ?></th>
165
+ <td><?php echo $this->formatDeliveryDateTime($track->getDeliverydate(), $track->getDeliverytime()); ?></td>
166
+ </tr>
167
+ <?php endif; ?>
168
+
169
+ <?php if ($track->getSignedby()): ?>
170
+ <tr>
171
+ <th><?php echo $this->__('Signed by:'); ?></th>
172
+ <td><?php echo $track->getSignedby(); ?></td>
173
+ </tr>
174
+ <?php endif; ?>
175
+
176
+ <?php if ($track->getDeliveryLocation()): ?>
177
+ <tr>
178
+ <th><?php echo $this->__('Delivered to:'); ?></th>
179
+ <td><?php echo $track->getDeliveryLocation(); ?></td>
180
+ </tr>
181
+ <?php endif; ?>
182
+
183
+ <?php if ($track->getShippedDate()): ?>
184
+ <tr>
185
+ <th><?php echo $this->__('Shipped or billed on:'); ?></th>
186
+ <td><?php echo $track->getShippedDate(); ?></td>
187
+ </tr>
188
+ <?php endif; ?>
189
+
190
+ <?php if ($track->getService()): ?>
191
+ <tr>
192
+ <th><?php echo $this->__('Service Type:'); ?></th>
193
+ <td><?php echo $track->getService(); ?></td>
194
+ </tr>
195
+ <?php endif; ?>
196
+
197
+ <?php if ($track->getWeight()): ?>
198
+ <tr>
199
+ <th><?php echo $this->__('Weight:'); ?></th>
200
+ <td><?php echo $track->getWeight(); ?></td>
201
+ </tr>
202
+ <?php endif; ?>
203
+
204
+ <?php endif; ?>
205
+ <?php elseif (isset($track['title']) && isset($track['number']) && $track['number']): ?>
206
+ <!--if the tracking is custom value-->
207
+ <tr>
208
+ <th><?php echo ($track['title'] ? $this->escapeHtml($track['title']) : $this->__('N/A')); ?>:</th>
209
+ <td><?php echo (isset($track['number']) ? $this->escapeHtml($track['number']) : ''); ?></td>
210
+ </tr>
211
+ <?php endif; ?>
212
+ </tbody>
213
+ </table>
214
+
215
+ <?php if (is_object($track) && sizeof($track->getProgressdetail()) > 0): ?>
216
+ <table class="data-table" id="track-history-table-<?php echo $track->getTracking(); ?>">
217
+ <col />
218
+ <col width="1" />
219
+ <col width="1" />
220
+ <col />
221
+ <thead>
222
+ <tr>
223
+ <th><?php echo $this->__('Location') ?></th>
224
+ <th><?php echo $this->__('Date') ?></th>
225
+ <th><?php echo $this->__('Local Time') ?></th>
226
+ <th><?php echo $this->__('Description') ?></th>
227
+ </tr>
228
+ </thead>
229
+ <tbody>
230
+ <?php foreach ($track->getProgressdetail() as $_detail): ?>
231
+ <?php $_detailDate = (isset($_detail['deliverydate']) ? $this->formatDeliveryDate($_detail['deliverydate']) : '') ?>
232
+ <?php $_detailTime = (isset($_detail['deliverytime']) ? $this->formatDeliveryTime($_detail['deliverytime'], $_detailDate) : '') ?>
233
+ <tr>
234
+ <td><?php echo (isset($_detail['deliverylocation']) ? $_detail['deliverylocation'] : ''); ?></td>
235
+ <td><?php echo $_detailDate ?></td>
236
+ <td><?php echo $_detailTime ?></td>
237
+ <td><?php echo (isset($_detail['activity']) ? $_detail['activity'] : '') ?></td>
238
+ </tr>
239
+ <?php endforeach; ?>
240
+ </tbody>
241
+ </table>
242
+
243
+ <script type="text/javascript">decorateTable('track-history-table-<?php echo $track->getTracking(); ?>');</script>
244
+ <?php endif; ?>
245
+ <?php if ($counter != $rowCount): ?>
246
+ <?php endif; ?>
247
+ <?php $counter++; ?>
248
+
249
+ <?php endforeach; ?>
250
+ <!--end for each tracking information-->
251
+ <?php else: ?>
252
+ <p><?php echo $this->__('There is no tracking available for this shipment.'); ?></p>
253
+ <?php endif; ?>
254
+
255
+ <?php endforeach; ?>
256
+ <?php else: ?>
257
+ <div><?php echo $this->__('There is no tracking available.'); ?></div>
258
+ <?php endif; ?>
259
+
260
+ <div class="myorder-wrapper">
261
+ <div class="myorder">
262
+ <h3>Order Information</h3>
263
+ <?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) : ?>
264
+ <?php echo $this->__('<a class="print-icon" href="%s" onclick="this.target=\'_blank\'">here to print</a>', $this->getPrintUrl()) ?>
265
+ <?php // echo $this->getChildHtml() ?>
266
+ <?php endif; ?>
267
+ <div class="inner_content">
268
+ <label> Date<span>:</span></label>
269
+ <span> <?php echo $order_item->getCreatedAtStoreDate(); ?></span>
270
+ </div>
271
+ <div class="inner_content">
272
+ <label>Order ID<span>:</span></label>
273
+ <span><?php echo $order_id; ?></span>
274
+ </div>
275
+ <div class="inner_content">
276
+ <label>Order Total<span>:</span></label>
277
+ <span> <?php echo $order_item->getGrandTotal(); ?></span>
278
+ </div>
279
+ </div>
280
+ <div class="payment_method">
281
+ <h3>Payment & Shipping Information</h3>
282
+ <div class="inner_content">
283
+ <label><b>Shipping Method</b><span>:</span></label>
284
+ <span> <?php echo $shipping_method; ?></span>
285
+ </div>
286
+ <div class="inner_content">
287
+ <label><b>Payment Method</b><span>:</span> </label>
288
+ <span><?php echo $paymentmethod; ?></span>
289
+ </div>
290
+ <?php if ($paymentmethod == 'Credit Card (saved)') { ?>
291
+ <div class="inner_content">
292
+ <label>Credit Card Type<span>:</span></label>
293
+ <span><?php echo $options; ?></span>
294
+ </div>
295
+ <div class="inner_content">
296
+ <label>Credit Card Number<span>:</span></label>
297
+ <span><?php echo $payarry['cc_last4']; ?></span>
298
+ </div>
299
+ <div class="inner_content">
300
+ <label>Credit Card Owner<span>:</span></label>
301
+ <span><?php echo $payarry['cc_owner']; ?></span>
302
+ </div>
303
+ <?php } ?>
304
+ </div>
305
+ </div>
306
+ <div class="myorder-wrapper">
307
+ <div class="order_summery">
308
+ <h3>Shipping Address</h3>
309
+ <div class="inner_content">
310
+ <label>Name<span>:</span></label>
311
+ <span><?php echo $shipping_address_data['firstname'] . " " . $shipping_address_data['lastname']; ?></span>
312
+ </div>
313
+ <div class="inner_content">
314
+ <label>Delivery Address<span>:</span></label>
315
+ <span> <?php echo $shipping_address_data['street']; ?></span>
316
+ </div>
317
+ <div class="inner_content">
318
+ <label>Delivery City<span>:</span> </label>
319
+ <span> <?php echo $shipping_address_data['city']; ?></span>
320
+ </div>
321
+ <div class="inner_content">
322
+ <label>State<span>:</span></label>
323
+ <span> <?php echo $shipping_address_data['region']; ?></span>
324
+ </div>
325
+ <div class="inner_content">
326
+ <label>Country<span>:</span></label>
327
+ <span> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippcode); ?></span>
328
+ </div>
329
+ <div class="inner_content">
330
+ <label>Postcode<span>:</span></label>
331
+ <span> <?php echo $shipping_address_data['postcode']; ?></span>
332
+ </div>
333
+ <div class="inner_content">
334
+ <label>Telephone<span>:</span></label>
335
+ <span> <?php echo $shipping_address_data['telephone']; ?></span>
336
+ </div>
337
+ </div>
338
+ <div class="order_summery">
339
+ <h3>Billing Address</h3>
340
+ <div class="inner_content">
341
+ <label>Name<span>:</span></label>
342
+ <span><?php echo $billingAddress['firstname'] . " " . $billingAddress['lastname']; ?></span>
343
+ </div>
344
+ <div class="inner_content">
345
+ <label>Delivery Address<span>:</span></label>
346
+ <span><?php echo $billingAddress['street']; ?></span>
347
+ </div>
348
+ <div class="inner_content">
349
+ <label>Delivery City<span>:</span></label>
350
+ <span><?php echo $billingAddress['city']; ?></span>
351
+ </div>
352
+ <div class="inner_content">
353
+ <label>State<span>:</span></label>
354
+ <span><?php echo $billingAddress['region']; ?></span>
355
+ </div>
356
+ <div class="inner_content">
357
+ <label>Country<span>:</span></label>
358
+ <span><?php echo Mage::app()->getLocale()->getCountryTranslation($billcode); ?></span>
359
+ </div>
360
+ <div class="inner_content">
361
+ <label>Postcode<span>:</span></label>
362
+ <span><?php echo $billingAddress['postcode']; ?></span>
363
+ </div>
364
+ <div class="inner_content">
365
+ <label>Telephone<span>:</span> </label>
366
+ <span><?php echo $billingAddress->getTelephone(); ?></span>
367
+ </div>
368
+ </div>
369
+ </div>
370
+ <div id="checkout-review-table-wrapper">
371
+ <table class="data-table" id="checkout-review-table">
372
+ <thead>
373
+ <tr>
374
+ <th rowspan="<?php echo $rowspan ?>"><?php echo $this->__('Product Name') ?></th>
375
+ <th class="a-center"><?php echo $this->__('Unit Price') ?></th>
376
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
377
+ <th class="a-center"><?php echo $this->__('SKU') ?></th>
378
+ <th class="a-center"><?php echo $this->__('Sub Total') ?></th>
379
+ </tr>
380
+ </thead>
381
+ <?php echo $this->getChildHtml('totals'); ?>
382
+ <tbody>
383
+ <?php
384
+ foreach ($items as $i):
385
+ $_product = Mage::getModel('catalog/product')->load($i->getProductId());
386
+ $options = $i->getProductOptions();
387
+ ?>
388
+ <tr>
389
+ <td rowspan="1">
390
+ <img class="product_img" src="<?php echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(75); ?>" alt="product-img" />
391
+ <?php
392
+ echo $i->getName();
393
+
394
+ $customOptions = $options['options'];
395
+ if (!empty($customOptions)) {
396
+ foreach ($customOptions as $option) {
397
+ ?>
398
+ <span class="bottom-align">
399
+ <?php
400
+ echo '<b>' . $option['label'] . '</b> :';
401
+ echo $optionValue = $option['value'];
402
+ ?></span>
403
+ <?php
404
+ }
405
+ }
406
+ ?>
407
+ </td>
408
+ <td><?php echo $this->helper('checkout')->formatPrice($i->getPrice()); ?></td>
409
+ <td><?php echo $i->getQtyOrdered(); ?></td>
410
+ <td><?php echo $i->getSku(); ?></td>
411
+ <td><?php echo $this->helper('checkout')->formatPrice($i->getRowTotal()); ?></td>
412
+ </tr>
413
+ <?php endforeach ?>
414
+ </tbody>
415
+ <tfoot>
416
+ <tr>
417
+ <td colspan="4" class="a-right">
418
+ <small>SubTotal:</small>
419
+ </td>
420
+ <td colspan="2" class="a-right">
421
+ <small><?php echo $this->helper('checkout')->formatPrice($order_item->getSubtotal()); ?></small>
422
+ </td>
423
+ </tr>
424
+ <tr class="shipping">
425
+ <td class="a-right" colspan="4">
426
+ <?php echo $this->__('Shipping & Handling(' . $order_item->getShippingDescription() . ')'); ?>
427
+ </td>
428
+ <td colspan="2" class="last a-right">
429
+ <span class="subtotlal-value">
430
+ <?php echo $this->helper('checkout')->formatPrice($order_item->getShippingInclTax()); ?>
431
+ </span>
432
+ </td>
433
+ </tr>
434
+ <?php if ($order_item->getDiscountAmount() != 0): ?>
435
+ <tr class="discount">
436
+ <td class="a-right" colspan="4">
437
+ <?php echo $this->__('Discount'); echo $order_item->getDiscountDescription() ? '('.$order_item->getDiscountDescription() .')' : ""; ?>
438
+ </td>
439
+ <td class="last a-right">
440
+ <span class="subtotlal-value">
441
+ <?php echo $this->helper('checkout')->formatPrice($order_item->getDiscountAmount()); ?>
442
+ </span>
443
+ </td>
444
+ </tr><?php
445
+ endif;
446
+ ?>
447
+ <tr class="grand_total last">
448
+ <td class="a-right" colspan="4"><strong><?php echo $this->__('Total') ?></strong></td>
449
+ <td colspan="2" class="last a-right">
450
+ <span class="subtotlal-value">
451
+ <strong><?php echo $this->helper('checkout')->formatPrice($order_item->getGrandTotal()); ?></strong>
452
+ </span>
453
+ </td>
454
+ </tr>
455
+ </tfoot>
456
+ </table>
457
+ </div>
app/design/frontend/default/default/template/trackorder/trackorder.phtml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(Mage::getStoreConfig('trackorder/trackorder_general/enabled')):
3
+ ?>
4
+ <div class="page-title"><h1><?php echo $this->__('Track Your Order ') ?></h1></div>
5
+ <div class="form-list">
6
+ <form name="track_order" id="track_order" action="" method="post" onsubmit="sendAjax('track_order','<?php echo Mage::getUrl('*/*/track');?>'); return false;">
7
+ <!--<form name="track_order" method="post" id="track_order" action="<?php echo Mage::getUrl('*/*/view');?>">-->
8
+ <ul class="form-list">
9
+ <li>
10
+ <label for="order_id" class="required"><em>*</em><?php echo $this->__('Order Id') ?></label>
11
+ <div class="input-box">
12
+ <input type="text" name="order_id" id="order_id" value="" title="" class="input-text required-entry" />
13
+ </div>
14
+ </li>
15
+ <li>
16
+ <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
17
+ <div class="input-box" >
18
+ <input type="text" name="email" id="email_address" value="" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
19
+ </div>
20
+ </li>
21
+ </ul>
22
+ <div class="buttons-set">
23
+ <button type="submit" class="button" title="<?php echo $this->__('Track Order') ?>" name="track" id="track">
24
+ <span><span><?php echo $this->__('Track Order') ?></span></span>
25
+ </button>
26
+ </div>
27
+
28
+ </form>
29
+ <div id="loading-details" class="loading-details" style="display:none">
30
+ <div id="loading-mask" >
31
+ <p class="loader" id="loading_mask_loader"><img src="<?php echo $this->getSkinUrl('trackorder/images/ajax-loader-tr.gif') ?>" alt="<?php echo Mage::helper('adminhtml')->__('Loading...') ?>"/><br/><?php echo $this->__('Please wait...') ?></p>
32
+ </div>
33
+ </div>
34
+ </div>
35
+
36
+
37
+
38
+ <div id="oderinfo" class="order-info-message"></div>
39
+
40
+
41
+
42
+ <script type="text/javascript">
43
+ var validateForm = new VarienForm('track_order', true);
44
+ </script>
45
+ <script type="text/javascript">
46
+
47
+ function sendAjax(frmId,url){
48
+ if (!validateForm.validator.validate()) {
49
+ return;
50
+ }
51
+ var data = $(frmId).serialize(this);
52
+ $("loading-details").show();
53
+
54
+
55
+ new Ajax.Updater(
56
+ {
57
+ success:"oderinfo"
58
+ },
59
+
60
+ url,
61
+ {
62
+ asynchronous:true,
63
+ evalScripts:false,
64
+ onComplete:function(request, json){
65
+ $("loading-details").hide();
66
+ return false;
67
+ },
68
+ onLoading:function(request, json){},
69
+ parameters:data
70
+ }
71
+ );
72
+ return false;
73
+ }
74
+
75
+ </script>
76
+ <?php else: ?>
77
+ <?php
78
+ $url = Mage::getBaseUrl();
79
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
80
+ ?>
81
+ <?php endif; ?>
82
+
app/design/frontend/default/default/template/trackorder/trackorderlink.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php if (Mage::getStoreConfig('trackorder/trackorder_general/enabled') && Mage::getStoreConfig('trackorder/trackorder_general/topmenu')) { ?>
3
+ <div id="trackorder_container" style="display: none">
4
+ <li class="level0 nav-3 last level-top">
5
+ <a href="<?php echo $this->getUrl('trackorder') ?>">
6
+ <span><?php echo $this->__('TrackOrder') ?></span></a>
7
+ </li>
8
+ </div>
9
+ <script type="text/javascript">
10
+ var menu = $('nav');
11
+ if (menu) {
12
+ menu.insert($('trackorder_container').innerHTML);
13
+ }
14
+ </script>
15
+ <?php } ?>
app/design/frontend/default/default/template/trackorder/trackwidget.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (Mage::getStoreConfig('trackorder/trackorder_general/enabled')) { ?>
2
+
3
+ <div class = "block block-trackorder">
4
+ <div class = "block-title">
5
+ <strong><span>Track Order Here</span></strong>
6
+ </div>
7
+ <div class = "block-content">
8
+
9
+ <label for = "widget"><a target="_blank" href="<?php echo Mage::getBaseUrl() . 'trackorder/index'; ?>"> Track Order</a></label>
10
+
11
+ </div>
12
+ </div>
13
+
14
+
15
+ <?php } ?>
app/design/frontend/default/default/template/trackorder/view.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="order-items order-details">
2
+ <?php if ($this->helper('giftmessage/message')->getIsMessagesAvailable('items', $this->getOrder())): ?>
3
+ <script type="text/javascript">
4
+ //<![CDATA[
5
+ function giftMessageToogle(giftMessageIdentifier)
6
+ {
7
+ var link = $('order-item-gift-message-link-'+giftMessageIdentifier);
8
+ var container = $('order-item-gift-message-'+giftMessageIdentifier);
9
+ var row = $('order-item-row-'+giftMessageIdentifier);
10
+ if(link.expanded) {
11
+ link.expanded = false;
12
+ link.removeClassName('expanded');
13
+ if(container.hasClassName('last')) {
14
+ row.addClassName('last');
15
+ }
16
+ container.hide();
17
+ } else {
18
+ link.expanded = true;
19
+ link.addClassName('expanded');
20
+ if(container.hasClassName('last')) {
21
+ row.removeClassName('last');
22
+ }
23
+ container.show();
24
+ }
25
+
26
+ return false;
27
+ }
28
+ //]]>
29
+ </script>
30
+ <?php endif; ?>
31
+ <?php $_order = $this->getOrder() ?>
32
+ <h2 class="table-caption"><?php echo $this->__('Items Ordered') ?>
33
+ </h2>
34
+
35
+ <?php echo $this->getChildHtml('order_items') ?>
36
+
37
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order', $_order) && $_order->getGiftMessageId()): ?>
38
+ <div class="order-additional order-gift-message">
39
+ <h2 class="sub-title"><?php echo $this->__('Gift Message for This Order') ?></h2>
40
+ <?php $_giftMessage=$this->helper('giftmessage/message')->getGiftMessageForEntity($_order); ?>
41
+ <dl class="gift-message">
42
+ <dt><strong><?php echo $this->__('From:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?></dt>
43
+ <dt><strong><?php echo $this->__('To:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?></dt>
44
+ <dd><?php echo $this->helper('giftmessage/message')->getEscapedGiftMessage($_order) ?></dd>
45
+ </dl>
46
+ </div>
47
+ <?php endif; ?>
48
+ <?php $_history = $this->getOrder()->getVisibleStatusHistory() ?>
49
+ <?php if (count($_history)): ?>
50
+ <div class="order-additional order-comments">
51
+ <h2 class="sub-title"><?php echo $this->__('About Your Order') ?></h2>
52
+ <dl class="order-about">
53
+ <?php foreach ($_history as $_historyItem): ?>
54
+ <dt><?php echo $this->formatDate($_historyItem->getCreatedAtStoreDate(), 'medium', true) ?></dt>
55
+ <dd><?php echo $this->escapeHtml($_historyItem->getComment()) ?></dd>
56
+ <?php endforeach; ?>
57
+ </dl>
58
+ </div>
59
+ <?php endif; ?>
60
+ </div>
app/etc/modules/Solwin_Trackorder.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Solwin_Trackorder>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Sales/>
9
+ </depends>
10
+ </Solwin_Trackorder>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Solwin_Trackorder</name>
4
+ <version>1.0.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>Simple Order trcking extension which provides all the details including billing address, shipping address, order item details &amp;amp; order status.</summary>
10
+ <description>Simple Order trcking extension which will use ajax to display details and speed up your website.&#xD;
11
+ You just need to provide order id and email address and all the details about your order will be displayed.&#xD;
12
+ You can also change order status labels from admin side.&#xD;
13
+ Also Provide link in header, footer and menu. &#xD;
14
+ Provides a widget in left or right column.</description>
15
+ <notes>Simple ajax order tracking informaion. No need to load whole page. You can change order status labels also from admin side.</notes>
16
+ <authors><author><name>Sanjay Dabhoya</name><user>solwin</user><email>stdabhoya@yahoo.com</email></author></authors>
17
+ <date>2015-07-30</date>
18
+ <time>07:38:28</time>
19
+ <contents><target name="mageetc"><dir name="modules"><file name="Solwin_Trackorder.xml" hash="1d4c1fa2a55d4c79c27d66c396b80998"/></dir></target><target name="magecommunity"><dir name="Solwin"><dir name="Trackorder"><dir name="Block"><file name="Trackorder.php" hash="8960d861fab6e84abf6cc902c3245168"/><file name="Trackwidget.php" hash="e068dfcb077069bcb9d7e2bf6bb717c2"/><file name="View.php" hash="59fac7eb462cecfb7b3a86cd2ef90b35"/></dir><dir name="Helper"><file name="Data.php" hash="594d291dcf63ad86091d34d4e801257e"/></dir><dir name="Model"><file name="Observer.php" hash="32803987ff87e5f1efbeac7d73369517"/><dir name="System"><dir name="Config"><dir name="Frontend"><file name="Widgetsettings.php" hash="1882f66995f901616208de42dcb33aa3"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="1d8fd03bf4c63052c5108863b301eaa5"/></dir><dir name="etc"><file name="config.xml" hash="78a58669ff8c0fe3134f5f1d6533ef9b"/><file name="system.xml" hash="e4b312427b936c580688e5f3af50b14b"/><file name="widget.xml" hash="ff61595a908d0ce4c846f5b330ce5dd7"/></dir><dir name="sql"><dir name="trackorder_setup"><file name="mysql4-install-1.0.0.php" hash="4f08e9d298368363dcf13fd0a9cc9eb8"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="trackorder"><file name="info.phtml" hash="ab2f5760c95196aaea2470f5869a2bbb"/><dir><dir name="order"><file name="items.phtml" hash="dd7194ebb4ad6e57d489e044dbfb55e3"/></dir><dir name="shipment"><file name="items.phtml" hash="11172a03f80ac140f597af87e5c139a9"/></dir></dir><file name="trackdetail.phtml" hash="d1ffb43844b3e335d7451c2f94f85355"/><file name="trackorder.phtml" hash="2939541a8537a23c78cbe5f1ed49f824"/><file name="trackorderlink.phtml" hash="55338259c837d10814a56ed3d6cc1d02"/><file name="trackwidget.phtml" hash="78d940b9765d109236c24ed6d95fdb22"/><file name="view.phtml" hash="71f72f80ecf948a65cba97cbd7ce7e26"/></dir></dir><dir name="layout"><file name="trackorder.xml" hash="35a865a03fb3103b042a5324359997e9"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="trackorder"><dir name="css"><file name="trackorder.css" hash="7d5ade0a2d7ab4c7206a05f9ae0f6b01"/></dir></dir></dir></dir></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
22
+ </package>
skin/frontend/default/default/trackorder/css/trackorder.css ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .loading-details {
2
+ background: url("../images/main-bg.png") repeat scroll 0 0 transparent;
3
+ height: 100%;
4
+ left: 0;
5
+ position: fixed;
6
+ top: 0;
7
+ width: 100%;
8
+ z-index: 99;
9
+ }
10
+ #loading-details .update-popup {
11
+ position:fixed;
12
+ top:45%;
13
+ left:45%;
14
+ width:300px;
15
+ margin-left:-105px;
16
+ padding:15px 30px;
17
+ background:#fff;
18
+ color:#d85909;
19
+ font-weight:bold;
20
+ text-align:center;
21
+ z-index:400;
22
+ webkit-border-radius: 6px;
23
+ -moz-border-radius: 6px;
24
+ border-radius: 6px;
25
+ }
26
+ #loading-mask {
27
+ background: none repeat scroll 0 0 #F5F5F5;
28
+ border: 1px solid #F18200;
29
+ margin: 20% auto;
30
+ padding: 15px;
31
+ text-align: center;
32
+ width: 200px;
33
+ }
34
+ #loading-mask p{
35
+ margin-bottom:0;
36
+ }
37
+
38
+ .track-data-table{
39
+ margin-bottom:20px;
40
+ }
41
+
42
+ .order-info-message{
43
+ padding-top: 15px;
44
+ }
45
+
46
+ .block-trackorder .block-content{
47
+ padding: 5px 10px;
48
+ }
49
+ .statuses{
50
+ float: left;
51
+ margin-bottom: 20px;
52
+ width: 100%;
53
+ }
54
+ .block-trackorder .block-title strong {
55
+ background-image: url("../images/i-trackorder.png");
56
+ background-position: 0 0;
57
+ background-repeat: no-repeat;
58
+ padding-left: 21px;
59
+ }
60
+ .statuses > span.active_order {
61
+ background: #f69838;
62
+ color: #fff;
63
+ font-weight: bold;
64
+ border-color: #f69838;
65
+ }
66
+ .myorder-wrapper{
67
+ margin-top: 20px;
68
+ }
69
+ .statuses > span {
70
+ display: inline-block;
71
+ text-align: center;
72
+ width: 75px;
73
+ padding: 5px 0;
74
+ text-align: center;
75
+ background: #fff;
76
+ border: 1px solid #000;
77
+ }
78
+ #checkout-review-table-wrapper,.myorder-wrapper{
79
+ width:100%;
80
+ float: left;
81
+ }
82
+ .myorder,.order_summery,.payment_method {
83
+ width: 45%;
84
+ float:left;
85
+ background-color: #fff;
86
+ color: #5A5A5C;
87
+ padding: 15px;
88
+ margin-bottom: 20px;
89
+ margin-right: 20px;
90
+ position: relative;
91
+ }
92
+ .myorder-wrapper div:last-child{
93
+ margin-right: 0;
94
+ }
95
+ .myorder h3,.order_summery h3,.payment_method h3{
96
+ background-color: #f69838;
97
+ color: #fff;
98
+ font-weight: bolder;
99
+ text-transform: uppercase;
100
+ margin: -15px -15px 10px;
101
+ padding: 5px 15px;
102
+ }
103
+ .inner_content {
104
+ float: left;
105
+ margin-bottom: 5px;
106
+ width: 100%;
107
+ }
108
+ .inner_content span,.inner_content label{
109
+ width:50%;
110
+ float:left;
111
+ display: block;
112
+ }
113
+ .inner_content label span{
114
+ float: right;
115
+ padding-right: 10px;
116
+ width: auto;
117
+ }
118
+ .data-table thead th{
119
+ background: #dee3e3;
120
+ color: #fff;
121
+ border-right: 1px solid #f69838;
122
+ font-size: 14px;
123
+ text-transform: uppercase;
124
+ padding: 5px 8px;
125
+ }
126
+ .data-table {
127
+ border: 1px solid #dee3e3;
128
+ width: 100%;
129
+ }
130
+ .data-table thead th {
131
+ background: none repeat scroll 0 0 #dee3e3;
132
+ border-right: 1px solid #dee3e3;
133
+ color: #5a5a5c;
134
+ }
135
+ .data-table tfoot {
136
+ border-bottom: 1px solid #d9dde3;
137
+ }
138
+ .data-table tfoot tr {
139
+ background-color: #dee3e3 !important;
140
+ }
141
+ .data-table tbody td {
142
+ color: #5a5a5c;
143
+ }
144
+ .data-table tfoot td {
145
+ border-right: 1px solid #dee3e3;
146
+ color:#5a5a5c;
147
+ }
148
+ img.product_img{
149
+ border: 1px solid #dee3e3;
150
+ vertical-align: middle;
151
+ }
152
+ .sub-title{
153
+ color:#5a5a5c;
154
+ text-transform: uppercase;
155
+ }
156
+ .myorder a.print-icon {
157
+ background: url("../images/i_print.gif") no-repeat scroll left top rgba(0, 0, 0, 0);
158
+ border: medium none !important;
159
+ display: inline-block;
160
+ font-size: 0;
161
+ height: 16px;
162
+ padding: 0;
163
+ position: absolute;
164
+ right: 10px;
165
+ top: 7px;
166
+ width: 16px;
167
+ }
168
+ .bottom-align{
169
+ vertical-align: bottom;
170
+ }