webo2_speedextrack - Version 0.1.0

Version Notes

Speedex Courier - Track & Trace release

Download this release

Release Info

Developer Webo2
Extension webo2_speedextrack
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

Files changed (29) hide show
  1. app/code/local/Webo2/Speedextrack/Block/Speedextrack.php +205 -0
  2. app/code/local/Webo2/Speedextrack/Block/Trackwidget.php +9 -0
  3. app/code/local/Webo2/Speedextrack/Block/View.php +9 -0
  4. app/code/local/Webo2/Speedextrack/Helper/Data.php +9 -0
  5. app/code/local/Webo2/Speedextrack/Model/Observer.php +107 -0
  6. app/code/local/Webo2/Speedextrack/Model/System/Config/Frontend/Widgetsettings.php +15 -0
  7. app/code/local/Webo2/Speedextrack/controllers/IndexController.php +286 -0
  8. app/code/local/Webo2/Speedextrack/etc/config.xml +178 -0
  9. app/code/local/Webo2/Speedextrack/etc/system.xml +105 -0
  10. app/code/local/Webo2/Speedextrack/etc/widget.xml +15 -0
  11. app/code/local/Webo2/Speedextrack/sql/speedextrack_setup/mysql4-install-0.1.0.php +3 -0
  12. app/code/local/Webo2/Speedextrack/sql/speedextrack_setup/mysql4-upgrade-0.1.0-0.1.1.php +39 -0
  13. app/design/frontend/base/default/layout/speedextrack.xml +93 -0
  14. app/design/frontend/base/default/template/speedextrack/info.phtml +88 -0
  15. app/design/frontend/base/default/template/speedextrack/order/items.phtml +93 -0
  16. app/design/frontend/base/default/template/speedextrack/shipment/items.phtml +73 -0
  17. app/design/frontend/base/default/template/speedextrack/speedextrack.phtml +82 -0
  18. app/design/frontend/base/default/template/speedextrack/trackdetail.phtml +32 -0
  19. app/design/frontend/base/default/template/speedextrack/trackorderlink.phtml +15 -0
  20. app/design/frontend/base/default/template/speedextrack/trackwidget.phtml +15 -0
  21. app/design/frontend/base/default/template/speedextrack/view.phtml +60 -0
  22. app/etc/modules/Webo2_Speedextrack.xml +20 -0
  23. app/locale/en_US/Webo2_Speedextrack.csv +7 -0
  24. package.xml +22 -0
  25. skin/frontend/base/default/speedextrack/css/speedextrack.css +13 -0
  26. skin/frontend/base/default/speedextrack/images/ajax-loader-tr.gif +0 -0
  27. skin/frontend/base/default/speedextrack/images/ajax-loader.gif +0 -0
  28. skin/frontend/base/default/speedextrack/images/i-trackorder.png +0 -0
  29. skin/frontend/base/default/speedextrack/images/main-bg.png +0 -0
app/code/local/Webo2/Speedextrack/Block/Speedextrack.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ /**
3
+ * @category Webo2
4
+ * @package Speedextrack
5
+ * @author Mits Xourikis
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ -->
9
+ <?php
10
+ class Webo2_Speedextrack_Block_Speedextrack extends Mage_Core_Block_Template
11
+ {
12
+ public function _prepareLayout()
13
+ {
14
+ return parent::_prepareLayout();
15
+ }
16
+
17
+ public function getSpeedextrack()
18
+ {
19
+ $WebServiceURL = 'http://tempuri.org/';
20
+ $wsdl = "http://www.speedex.gr/getvoutrans/GetVouTrans.asmx?WSDL";
21
+
22
+ if (file_get_contents($wsdl)) {
23
+ $client = new SoapClient($wsdl,
24
+ array(
25
+ 'trace' => true
26
+ )
27
+ );
28
+ } else {
29
+ echo $faulty;
30
+ return false;
31
+ }
32
+ $faulty = 'makis';
33
+ $faulty2 = '!$client';
34
+ $faulty3 = 'exception';
35
+ if ($data = $this->getRequest()->getPost()) {
36
+ $vouch_id = $data["trackcode_id"];
37
+ $Cust_id= Mage::getStoreConfig('speedextrack/speedextrack_general/account_id');
38
+ $custagreement_id = '82873';
39
+ $kind = '0';
40
+ $speedextrackingHelper = Mage::helper('speedextrack');
41
+ $xml = '<VoucherRequest>
42
+ <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
43
+ <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
44
+ <xs:complexType>
45
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
46
+ <xs:element name="kritiria">
47
+ <xs:complexType>
48
+ <xs:sequence>
49
+ <xs:element name="type" type="xs:short" minOccurs="0" />
50
+ <xs:element name="voucher" type="xs:string" minOccurs="0" />
51
+ <xs:element name="customer" type="xs:string" minOccurs="0" />
52
+ </xs:sequence>
53
+ </xs:complexType>
54
+ </xs:element>
55
+ </xs:choice>
56
+ </xs:complexType>
57
+ </xs:element>
58
+ </xs:schema>
59
+ <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
60
+ <NewDataSet xmlns="">
61
+ <kritiria diffgr:id="kritiria1" msdata:rowOrder="0">
62
+ <type>'.$kind.'</type>
63
+ <voucher>'.$vouch_id.'</voucher>
64
+ <customer>'.$Cust_id.'</customer>
65
+ </kritiria>
66
+ </NewDataSet>
67
+ </diffgr:diffgram>
68
+ </VoucherRequest>';
69
+
70
+ $params = new \SoapVar('<GetVouTrans xmlns="http://tempuri.org/">'.$xml.'</GetVouTrans>', XSD_ANYXML);
71
+
72
+ try {
73
+ $result = $client->__call("GetVouTrans", array($params));
74
+ $responsevalues = $client->__getLastResponse();
75
+
76
+ $doc = new DOMdocument();
77
+ $doc->loadXML( $responsevalues );
78
+
79
+ echo "<table class='dtrack-data-table'><tbody><tr class='tg'><th>#ID</th><th>Ημ/νία</th><th>Περιγραφή</th><th>Σχόλιο 1</th><th>Σχόλιο 2</th><th>Περιοχή</th></tr>";
80
+ $rows = $doc->getElementsByTagName("Table");
81
+ $nodeCount = $rows->length;
82
+ foreach( $rows as $rows ) {
83
+ $vousids = $rows->getElementsByTagName( "Voucher_ID" );
84
+ $vousid = $vousids->item(0)->nodeValue;
85
+ $vousdates = $rows->getElementsByTagName( "TranDate" );
86
+ $vousdate = $vousdates->item(0)->nodeValue;
87
+ $vstatus = $rows->getElementsByTagName( "VStatus_Descr" );
88
+ $vstatu = $vstatus->item(0)->nodeValue;
89
+ $branches = $rows->getElementsByTagName( "branch_description" );
90
+ $branch = $branches->item(0)->nodeValue;
91
+ $vparals = $rows->getElementsByTagName( "com1" );
92
+ $vpar = $vparals->item(0)->nodeValue;
93
+ $vdates = $rows->getElementsByTagName( "com2" );
94
+ $vdate = $vdates->item(0)->nodeValue;
95
+ $stat = "\n" . $vousid . "\n";
96
+ $vousdat = "\n" . $vousdate . "\n";
97
+ $descr = "\n" . $vstatu . "\n";
98
+ $vparal = "\n" . $vpar . "\n";
99
+ $bran = "\n" . $branch . "\n";
100
+ $vdatesz = "\n" . $vdate . "\n";
101
+ $colwidth = "15%";
102
+ echo "<tr><td>" . $stat. "</td><td>" . $vousdat. "</td><td>" . $descr. "</td><td>" . $vparal. "</td><td>" . $vdatesz. "</td><td>" . $bran. "</td></tr>";
103
+
104
+ }
105
+ $rows = $doc->getElementsByTagName("Table1");
106
+ $nodeCount = $rows->length;
107
+ foreach( $rows as $rows ) {
108
+ $vousids = $rows->getElementsByTagName( "Voucher_ID" );
109
+ $vousid = $vousids->item(0)->nodeValue;
110
+ $vousdates = $rows->getElementsByTagName( "TranDate" );
111
+ $vousdate = $vousdates->item(0)->nodeValue;
112
+ $vstatus = $rows->getElementsByTagName( "VStatus_Descr" );
113
+ $vstatu = $vstatus->item(0)->nodeValue;
114
+ $branches = $rows->getElementsByTagName( "branch_description" );
115
+ $branch = $branches->item(0)->nodeValue;
116
+ $coms = $rows->getElementsByTagName( "Comments" );
117
+ $com = $coms->item(0)->nodeValue;
118
+ $nothing = '-';
119
+ $stat = "\n" . $vousid . "\n";
120
+ $vousdat = "\n" . $vousdate . "\n";
121
+ $descr = "\n" . $vstatu . "\n";
122
+ $bran = "\n" . $branch . "\n";
123
+ $commentz = "\n" . $com . "\n";
124
+ $null = "\n" .$nothing. "\n";
125
+ $colwidth = "15%";
126
+ echo "<tr><td>" . $stat. "</td><td>" . $vousdat. "</td><td>" . $descr. "</td><td>" . $commentz. "</td><td>" . $null. "</td><td>" . $bran. "</td></tr>";
127
+
128
+ }
129
+ echo "</tbody></table>";
130
+
131
+
132
+ if (isset($response->WSException) && !is_null($response->WSException)) {
133
+ if (isset($response->WSException->Description)) {
134
+ $speedextrackingHelper->log('GetLastVouTrans', $response->WSException->Description);
135
+ }
136
+ return false;
137
+ echo $faulty3;
138
+ }
139
+ } catch (SoapFault $e) {
140
+ echo $faulty;
141
+ return false;
142
+ }
143
+
144
+ return $responsevalues;
145
+ }
146
+ }
147
+ public function getSpeedextrackInfo($order)
148
+ {
149
+ $shipTrack = array();
150
+ if ($order) {
151
+ $shipments = $order->getShipmentsCollection();
152
+ foreach ($shipments as $shipment){
153
+ $increment_id = $shipment->getIncrementId();
154
+ $tracks = $shipment->getTracksCollection();
155
+
156
+ $trackingInfos=array();
157
+ foreach ($tracks as $track){
158
+ $trackingInfos[] = $track->getNumberDetail();
159
+ }
160
+ $shipTrack[$increment_id] = $trackingInfos;
161
+ }
162
+ }
163
+ return $shipTrack;
164
+ }
165
+ public function formatDeliveryDateTime($date, $time)
166
+ {
167
+ return $this->formatDeliveryDate($date) . ' ' . $this->formatDeliveryTime($time);
168
+ }
169
+
170
+ /**
171
+ * Format given date in current locale without changing timezone
172
+ *
173
+ * @param string $date
174
+ * @return string
175
+ */
176
+ public function formatDeliveryDate($date)
177
+ {
178
+ /* @var $locale Mage_Core_Model_Locale */
179
+ $locale = Mage::app()->getLocale();
180
+ $format = $locale->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
181
+ return $locale->date(strtotime($date), Zend_Date::TIMESTAMP, null, false)
182
+ ->toString($format);
183
+ }
184
+
185
+ /**
186
+ * Format given time [+ date] in current locale without changing timezone
187
+ *
188
+ * @param string $time
189
+ * @param string $date
190
+ * @return string
191
+ */
192
+ public function formatDeliveryTime($time, $date = null)
193
+ {
194
+ if (!empty($date)) {
195
+ $time = $date . ' ' . $time;
196
+ }
197
+
198
+ /* @var $locale Mage_Core_Model_Locale */
199
+ $locale = Mage::app()->getLocale();
200
+
201
+ $format = $locale->getTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
202
+ return $locale->date(strtotime($time), Zend_Date::TIMESTAMP, null, false)
203
+ ->toString($format);
204
+ }
205
+ }
app/code/local/Webo2/Speedextrack/Block/Trackwidget.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Webo2_Speedextrack_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/local/Webo2/Speedextrack/Block/View.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Webo2_Speedextrack_Block_View extends Mage_Core_Block_Template {
4
+
5
+ public function _prepareLayout() {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ }
app/code/local/Webo2/Speedextrack/Helper/Data.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Webo2_Speedextrack_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function getSpeedextrackUrl()
6
+ {
7
+ return $this->_getUrl('speedextrack/index');
8
+ }
9
+ }
app/code/local/Webo2/Speedextrack/Model/Observer.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Webo2_Speedextrack_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['speedextrack_general']['fields']['enabled']['value'];
10
+ if ($configValue == 0) {
11
+ $trackOrderConfig = new Mage_Core_Model_Config();
12
+ $trackOrderConfig->saveConfig('speedextrack/speedextrack_general/toplinks', "0");
13
+ $trackOrderConfig->saveConfig('speedextrack/speedextrack_general/topmenu', "0");
14
+ $trackOrderConfig->saveConfig('speedextrack/speedextrack_general/sendtrack_link', "0");
15
+ }
16
+
17
+ $showWidget = $params['speedextrack_general']['fields']['show_widget']['value'];
18
+
19
+
20
+ if(version_compare(Mage::getVersion(), '1.5.1.0', '>')) {
21
+ $widgetInstance = Mage::getModel('widget/widget_instance')->getCollection()->addFieldToFilter('instance_type' , 'speedextrack/trackwidget')->getData();
22
+ }
23
+ else
24
+ {
25
+ $widgetInstance = Mage::getModel('widget/widget_instance')->getCollection()->addFieldToFilter('type' , 'speedextrack/trackwidget')->getData();
26
+ }
27
+
28
+
29
+ $widgetInstanceID = $widgetInstance[0]['instance_id'];
30
+ $widgetParameters = array(
31
+ 'param1' => 'This is some value from the widget form',
32
+ 'template' => 'speedextrack/trackwidget.phtml'
33
+ );
34
+
35
+ $instance = Mage::getModel('widget/widget_instance')->load($widgetInstanceID);
36
+ $instance->setData(array(
37
+ 'instance_id' => $widgetInstanceID,
38
+ 'type' => 'speedextrack/trackwidget',
39
+ 'package_theme' => 'default/default',
40
+ 'title' => 'Track Widget',
41
+ 'store_ids' => '0', // or comma separated list of ids
42
+ 'sort_order' => '0',
43
+ 'widget_parameters' => serialize($widgetParameters),
44
+ 'page_groups' => array(array(
45
+ 'page_group' => 'all_pages',
46
+ 'all_pages' => array(
47
+ 'page_id' => null,
48
+ 'group' => 'all_pages',
49
+ 'layout_handle' => 'default',
50
+ 'block' => $showWidget,
51
+ 'for' => 'all',
52
+ 'template' => $widgetParameters['template'],
53
+ )
54
+ ))
55
+ ))->save();
56
+
57
+ }
58
+
59
+ public function addlinkAdmin(Varien_Event_Observer $observer) {
60
+
61
+ if (Mage::app()->getRequest()->getControllerName() == 'sales_order_create' || Mage::app()->getRequest()->getControllerName() == 'sales_order_edit') {
62
+ if (self::$_handleTrackLinkCounter > 1) {
63
+ return $this;
64
+ }
65
+
66
+ $order = $observer->getEvent()->getOrder();
67
+ self::$_handleTrackLinkCounter++;
68
+ if ($order->getTrackLink() == NULL) {
69
+ $trackLink = substr(md5(microtime()), rand(0, 26), 6);
70
+
71
+ $order->setTrackLink($trackLink);
72
+ }
73
+ }
74
+ }
75
+
76
+ public function addlinkFront(Varien_Event_Observer $observer) {
77
+
78
+ if (Mage::app()->getRequest()->getControllerName() == 'onepage') {
79
+ if (self::$_handleTrackLinkCounter > 1) {
80
+ return $this;
81
+ }
82
+
83
+ $order = $observer->getEvent()->getOrder();
84
+ self::$_handleTrackLinkCounter++;
85
+ if ($order->getTrackLink() == NULL) {
86
+ $trackLink = substr(md5(microtime()), rand(0, 26), 6);
87
+ $order->setTrackLink($trackLink);
88
+ }
89
+ }
90
+ }
91
+
92
+
93
+ public function addmultishipLink(Varien_Event_Observer $observer) {
94
+
95
+ if (Mage::app()->getRequest()->getControllerName() == 'multishipping') {
96
+ $order = $observer->getEvent()->getOrder();
97
+
98
+ if ($order->getTrackLink() == NULL) {
99
+ $trackLink = substr(md5(microtime()), rand(0, 26), 6);
100
+ $order->setTrackLink($trackLink);
101
+ }
102
+ }
103
+ }
104
+
105
+ }
106
+
107
+ ?>
app/code/local/Webo2/Speedextrack/Model/System/Config/Frontend/Widgetsettings.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Webo2_Speedextrack_Model_System_Config_Frontend_Widgetsettings
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ return array(
8
+ array('value' => 'left',
9
+ 'label' => Mage::helper('speedextrack')->__('Left Column')),
10
+ array('value' => 'right',
11
+ 'label' => Mage::helper('speedextrack')->__('Right Column')),
12
+ );
13
+ }
14
+
15
+ }
app/code/local/Webo2/Speedextrack/controllers/IndexController.php ADDED
@@ -0,0 +1,286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ /**
3
+ * @category Webo2
4
+ * @package Speedextrack
5
+ * @author Mits Xourikis
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ -->
9
+ <?php
10
+ class Webo2_Speedextrack_IndexController extends Mage_Core_Controller_Front_Action {
11
+
12
+ public function indexAction() {
13
+ $this->loadLayout();
14
+ $this->renderLayout();
15
+ }
16
+
17
+ public function validate() {
18
+
19
+ }
20
+
21
+ public function initOrder() {
22
+ if ($data = $this->getRequest()->getPost()) {
23
+ $orderId = $data["order_id"];
24
+ $email = $data["email"];
25
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
26
+ $cEmail = $order->getCustomerEmail();
27
+ if ($cEmail == trim($email)) {
28
+ Mage::register('current_order', $order);
29
+ } else {
30
+ Mage::register('current_order', Mage::getModel("sales/order"));
31
+ }
32
+ }
33
+ }
34
+
35
+ public function getSpeedorder() {
36
+ $WebServiceURL = 'http://tempuri.org/';
37
+ $wsdl = "http://www.speedex.gr/getvoutrans/GetVouTrans.asmx?WSDL";
38
+
39
+ if (file_get_contents($wsdl)) {
40
+ $client = new SoapClient($wsdl,
41
+ array(
42
+ 'trace' => true
43
+ )
44
+ );
45
+ } else {
46
+ echo $faulty;
47
+ return false;
48
+ }
49
+ $faulty = 'makis';
50
+ $faulty2 = '!$client';
51
+ $faulty3 = 'exception';
52
+ if ($data = $this->getRequest()->getPost()) {
53
+ $vouch_id = $data["trackcode_id"];
54
+ $Cust_id= Mage::getStoreConfig('speedextrack/speedextrack_general/account_id');
55
+ $custagreement_id = '82873';
56
+ $kind = '0';
57
+ $speedextrackingHelper = Mage::helper('speedextrack');
58
+ $xml = '<VoucherRequest>
59
+ <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
60
+ <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
61
+ <xs:complexType>
62
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
63
+ <xs:element name="kritiria">
64
+ <xs:complexType>
65
+ <xs:sequence>
66
+ <xs:element name="type" type="xs:short" minOccurs="0" />
67
+ <xs:element name="voucher" type="xs:string" minOccurs="0" />
68
+ <xs:element name="customer" type="xs:string" minOccurs="0" />
69
+ </xs:sequence>
70
+ </xs:complexType>
71
+ </xs:element>
72
+ </xs:choice>
73
+ </xs:complexType>
74
+ </xs:element>
75
+ </xs:schema>
76
+ <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
77
+ <NewDataSet xmlns="">
78
+ <kritiria diffgr:id="kritiria1" msdata:rowOrder="0">
79
+ <type>'.$kind.'</type>
80
+ <voucher>'.$vouch_id.'</voucher>
81
+ <customer>'.$Cust_id.'</customer>
82
+ </kritiria>
83
+ </NewDataSet>
84
+ </diffgr:diffgram>
85
+ </VoucherRequest>';
86
+
87
+ $params = new \SoapVar('<GetVouTrans xmlns="http://tempuri.org/">'.$xml.'</GetVouTrans>', XSD_ANYXML);
88
+
89
+ try {
90
+ $result = $client->__call("GetVouTrans", array($params));
91
+ $responsevalues = $client->__getLastResponse();
92
+
93
+ $doc = new DOMdocument();
94
+ $doc->loadXML( $responsevalues );
95
+
96
+ echo "<table class='dtrack-data-table'><tbody><tr class='tg'><th>#ID</th><th>Ημ/νία</th><th>Περιγραφή</th><th>Σχόλιο 1</th><th>Σχόλιο 2</th><th>Περιοχή</th></tr>";
97
+ $rows = $doc->getElementsByTagName("Table");
98
+ $nodeCount = $rows->length;
99
+ foreach( $rows as $rows ) {
100
+ $vousids = $rows->getElementsByTagName( "Voucher_ID" );
101
+ $vousid = $vousids->item(0)->nodeValue;
102
+ $vousdates = $rows->getElementsByTagName( "TranDate" );
103
+ $vousdate = $vousdates->item(0)->nodeValue;
104
+ $vstatus = $rows->getElementsByTagName( "VStatus_Descr" );
105
+ $vstatu = $vstatus->item(0)->nodeValue;
106
+ $branches = $rows->getElementsByTagName( "branch_description" );
107
+ $branch = $branches->item(0)->nodeValue;
108
+ $vparals = $rows->getElementsByTagName( "com1" );
109
+ $vpar = $vparals->item(0)->nodeValue;
110
+ $vdates = $rows->getElementsByTagName( "com2" );
111
+ $vdate = $vdates->item(0)->nodeValue;
112
+ $stat = "\n" . $vousid . "\n";
113
+ $vousdat = "\n" . $vousdate . "\n";
114
+ $descr = "\n" . $vstatu . "\n";
115
+ $vparal = "\n" . $vpar . "\n";
116
+ $bran = "\n" . $branch . "\n";
117
+ $vdatesz = "\n" . $vdate . "\n";
118
+ $colwidth = "15%";
119
+ echo "<tr><td>" . $stat. "</td><td>" . $vousdat. "</td><td>" . $descr. "</td><td>" . $vparal. "</td><td>" . $vdatesz. "</td><td>" . $bran. "</td></tr>";
120
+
121
+ }
122
+ $rows = $doc->getElementsByTagName("Table1");
123
+ $nodeCount = $rows->length;
124
+ foreach( $rows as $rows ) {
125
+ $vousids = $rows->getElementsByTagName( "Voucher_ID" );
126
+ $vousid = $vousids->item(0)->nodeValue;
127
+ $vousdates = $rows->getElementsByTagName( "TranDate" );
128
+ $vousdate = $vousdates->item(0)->nodeValue;
129
+ $vstatus = $rows->getElementsByTagName( "VStatus_Descr" );
130
+ $vstatu = $vstatus->item(0)->nodeValue;
131
+ $branches = $rows->getElementsByTagName( "branch_description" );
132
+ $branch = $branches->item(0)->nodeValue;
133
+ $coms = $rows->getElementsByTagName( "Comments" );
134
+ $com = $coms->item(0)->nodeValue;
135
+ $nothing = '-';
136
+ $stat = "\n" . $vousid . "\n";
137
+ $vousdat = "\n" . $vousdate . "\n";
138
+ $descr = "\n" . $vstatu . "\n";
139
+ $bran = "\n" . $branch . "\n";
140
+ $commentz = "\n" . $com . "\n";
141
+ $null = "\n" .$nothing. "\n";
142
+ $colwidth = "15%";
143
+ echo "<tr><td>" . $stat. "</td><td>" . $vousdat. "</td><td>" . $descr. "</td><td>" . $commentz. "</td><td>" . $null. "</td><td>" . $bran. "</td></tr>";
144
+
145
+ }
146
+ echo "</tbody></table>";
147
+
148
+
149
+ if (isset($response->WSException) && !is_null($response->WSException)) {
150
+ if (isset($response->WSException->Description)) {
151
+ $speedextrackingHelper->log('GetLastVouTrans', $response->WSException->Description);
152
+ }
153
+ return false;
154
+ echo $faulty3;
155
+ }
156
+ } catch (SoapFault $e) {
157
+ echo $faulty;
158
+ return false;
159
+ }
160
+
161
+ return $responsevalues;
162
+ }
163
+ }
164
+
165
+ public function loadorderstatus() {
166
+ $params = new \SoapVar('<GetVouTrans xmlns="http://tempuri.org/">'.$xml.'</GetVouTrans>', XSD_ANYXML);
167
+ $result = $client->__call("GetVouTrans", array($params));
168
+ $responsevalues = $client->__getLastResponse();
169
+ $doc = new DOMdocument();
170
+ $doc->loadXML( $responsevalues );
171
+
172
+ echo "<table class='dtrack-data-table'><tbody><tr><td>#ID</td><td>Ημ/νία</td><td>Περιγραφή</td><td>Σχόλιο 1</td><td>Σχόλιο 2</td><td>Περιοχή</td></tr>";
173
+ $rows = $doc->getElementsByTagName("Table");
174
+ $nodeCount = $rows->length;
175
+ echo ("There are {$nodeCount} records<br />");
176
+ foreach( $rows as $rows ) {
177
+ $vousids = $rows->getElementsByTagName( "Voucher_ID" );
178
+ $vousid = $vousids->item(0)->nodeValue;
179
+ $vousdates = $rows->getElementsByTagName( "TranDate" );
180
+ $vousdate = $vousdates->item(0)->nodeValue;
181
+ $vstatus = $rows->getElementsByTagName( "VStatus_Descr" );
182
+ $vstatu = $vstatus->item(0)->nodeValue;
183
+ $branches = $rows->getElementsByTagName( "branch_description" );
184
+ $branch = $branches->item(0)->nodeValue;
185
+ $vparals = $rows->getElementsByTagName( "com1" );
186
+ $vpar = $vparals->item(0)->nodeValue;
187
+ $vdates = $rows->getElementsByTagName( "com2" );
188
+ $vdate = $vdates->item(0)->nodeValue;
189
+ $stat = "\n" . $vousid . "\n";
190
+ $vousdat = "\n" . $vousdate . "\n";
191
+ $descr = "\n" . $vstatu . "\n";
192
+ $vparal = "\n" . $vpar . "\n";
193
+ $bran = "\n" . $branch . "\n";
194
+ $vdatesz = "\n" . $vdate . "\n";
195
+ $colwidth = "15%";
196
+ echo "<tr><td>" . $stat. "</td><td>" . $vousdat. "</td><td>" . $descr. "</td><td>" . $vparal. "</td><td>" . $vdatesz. "</td><td>" . $bran. "</td></tr>";
197
+
198
+ }
199
+ $rows = $doc->getElementsByTagName("Table1");
200
+ $nodeCount = $rows->length;
201
+ echo ("There are {$nodeCount} records<br />");
202
+ foreach( $rows as $rows ) {
203
+ $vousids = $rows->getElementsByTagName( "Voucher_ID" );
204
+ $vousid = $vousids->item(0)->nodeValue;
205
+ $vousdates = $rows->getElementsByTagName( "TranDate" );
206
+ $vousdate = $vousdates->item(0)->nodeValue;
207
+ $vstatus = $rows->getElementsByTagName( "VStatus_Descr" );
208
+ $vstatu = $vstatus->item(0)->nodeValue;
209
+ $branches = $rows->getElementsByTagName( "branch_description" );
210
+ $branch = $branches->item(0)->nodeValue;
211
+ $coms = $rows->getElementsByTagName( "Comments" );
212
+ $com = $coms->item(0)->nodeValue;
213
+ $stat = "\n" . $vousid . "\n";
214
+ $vousdat = "\n" . $vousdate . "\n";
215
+ $descr = "\n" . $vstatu . "\n";
216
+ $bran = "\n" . $branch . "\n";
217
+ $commentz = "\n" . $com . "\n";
218
+ $colwidth = "15%";
219
+ echo "<tr><td>" . $stat. "</td><td>" . $vousdat. "</td><td>" . $descr. "</td><td>" . $commentz. "</td><td>" . $vdatesz. "</td><td>" . $bran. "</td></tr>";
220
+
221
+ }
222
+ echo "</tbody></table>";
223
+ }
224
+
225
+ public function trackAction() {
226
+ $post = $this->getRequest()->getPost();
227
+
228
+ if ($post) {
229
+ try {
230
+ if (!Zend_Validate::is(trim($post['trackcode_id']), 'NotEmpty')) {
231
+ $error = true;
232
+ }
233
+ if ($error) {
234
+ throw new Exception();
235
+ }
236
+ $this->getSpeedorder($post);
237
+
238
+ } catch (Exception $e) {
239
+ Mage::getSingleton('core/session')->addError(Mage::helper('speedextrack')->__('Please Enter Order Detail.'));
240
+ $this->getResponse()->setBody($this->getLayout()->getMessagesBlock()->getGroupedHtml());
241
+ return;
242
+ }
243
+ } else {
244
+ $this->_redirect('*/*/');
245
+ }
246
+ }
247
+
248
+ public function viewAction() {
249
+
250
+
251
+ $actionUrl = $_SERVER['REQUEST_URI'];
252
+ $pathinfo = pathinfo($actionUrl);
253
+ $trackid = $pathinfo['basename'];
254
+
255
+ $orderdata = Mage::getModel('sales/order')->getCollection()
256
+ ->addAttributeToFilter('track_link', $trackid)
257
+ ->getData();
258
+
259
+ $order = Mage::getModel('sales/order')->load($orderdata[0]['entity_id']);
260
+
261
+
262
+
263
+
264
+ if ($order->getId()) {
265
+ Mage::register('current_order', $order);
266
+ $this->loadLayout();
267
+ $this->renderLayout();
268
+ return true;
269
+
270
+ } else {
271
+ Mage::getSingleton('core/session')->addError($this->__('Order not found. Please try again later.'));
272
+ $this->_redirect('*/*/');
273
+ }
274
+ }
275
+
276
+ protected function _getGridHtml() {
277
+ $layout = $this->getLayout();
278
+ $update = $layout->getUpdate();
279
+ $update->load("speedextrack_index_track");
280
+ $layout->generateXml();
281
+ $layout->generateBlocks();
282
+ $output = $layout->getOutput();
283
+ return $output;
284
+ }
285
+
286
+ }
app/code/local/Webo2/Speedextrack/etc/config.xml ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Webo2
5
+ * @package Speedextrack
6
+ * @author Mits Xourikis
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Webo2_Speedextrack>
13
+ <version>0.1.0</version>
14
+ </Webo2_Speedextrack>
15
+ </modules>
16
+ <frontend>
17
+ <routers>
18
+ <speedextrack>
19
+ <use>standard</use>
20
+ <args>
21
+ <module>Webo2_Speedextrack</module>
22
+ <frontName>speedextrack</frontName>
23
+ </args>
24
+ </speedextrack>
25
+ </routers>
26
+ <layout>
27
+ <updates>
28
+ <speedextrack>
29
+ <file>speedextrack.xml</file>
30
+ </speedextrack>
31
+ </updates>
32
+ </layout>
33
+ <events>
34
+ <sales_order_save_after>
35
+ <observers>
36
+ <speedextrack_link>
37
+ <type>singleton</type>
38
+ <class>speedextrack/observer</class>
39
+ <method>addlinkFront</method>
40
+ </speedextrack_link>
41
+ </observers>
42
+ </sales_order_save_after>
43
+ <checkout_type_multishipping_create_orders_single>
44
+ <observers>
45
+ <speedextrack_multishiplink>
46
+ <type>singleton</type>
47
+ <class>speedextrack/observer</class>
48
+ <method>addmultishipLink</method>
49
+ </speedextrack_multishiplink>
50
+ </observers>
51
+ </checkout_type_multishipping_create_orders_single>
52
+
53
+ </events>
54
+ <translate>
55
+ <modules>
56
+ <Webo2_Speedextrack>
57
+ <files>
58
+ <default>Webo2_Speedextrack.csv</default>
59
+ </files>
60
+ </Webo2_Speedextrack>
61
+ </modules>
62
+ </translate>
63
+ </frontend>
64
+ <admin>
65
+ <routers>
66
+ <speedextrack>
67
+ <use>admin</use>
68
+ <args>
69
+ <module>Webo2_Speedextrack</module>
70
+ <frontName>speedextrack</frontName>
71
+ </args>
72
+ </speedextrack>
73
+ </routers>
74
+ </admin>
75
+ <adminhtml>
76
+ <acl>
77
+ <resources>
78
+ <all>
79
+ <title>Allow Everything</title>
80
+ </all>
81
+ <admin>
82
+ <children>
83
+ <Webo2_Speedextrack>
84
+ <title>Speedex Tracking</title>
85
+ <sort_order>10</sort_order>
86
+ </Webo2_Speedextrack>
87
+ <system>
88
+ <children>
89
+ <config>
90
+ <children>
91
+ <speedextrack>
92
+ <title>Speedex Tracking</title>
93
+ </speedextrack>
94
+ </children>
95
+ </config>
96
+ </children>
97
+ </system>
98
+ </children>
99
+ </admin>
100
+ </resources>
101
+ </acl>
102
+ <layout>
103
+ <updates>
104
+ <speedextrack>
105
+ <file>speedextrack.xml</file>
106
+ </speedextrack>
107
+ </updates>
108
+ </layout>
109
+ <events>
110
+ <admin_system_config_changed_section_speedextrack>
111
+ <observers>
112
+ <speedextrack_status>
113
+ <type>model</type>
114
+ <class>speedextrack/observer</class>
115
+ <method>checkstatus</method>
116
+ </speedextrack_status>
117
+ </observers>
118
+ </admin_system_config_changed_section_speedextrack>
119
+ <sales_order_save_after>
120
+ <observers>
121
+ <speedextrack_link>
122
+ <type>singleton</type>
123
+ <class>speedextrack/observer</class>
124
+ <method>addlinkAdmin</method>
125
+ </speedextrack_link>
126
+ </observers>
127
+ </sales_order_save_after>
128
+ </events>
129
+ </adminhtml>
130
+ <global>
131
+ <models>
132
+ <speedextrack>
133
+ <class>Webo2_Speedextrack_Model</class>
134
+ <resourceModel>speedextrack_mysql4</resourceModel>
135
+ </speedextrack>
136
+ <speedextrack_mysql4>
137
+ <class>Webo2_Speedextrack_Model_Mysql4</class>
138
+ <entities>
139
+ <speedextrack>
140
+ <table>speedextrack</table>
141
+ </speedextrack>
142
+ </entities>
143
+ </speedextrack_mysql4>
144
+ </models>
145
+ <resources>
146
+ <speedextrack_setup>
147
+ <setup>
148
+ <module>Webo2_Speedextrack</module>
149
+ </setup>
150
+ <connection>
151
+ <use>core_setup</use>
152
+ </connection>
153
+ </speedextrack_setup>
154
+ <speedextrack_write>
155
+ <connection>
156
+ <use>core_write</use>
157
+ </connection>
158
+ </speedextrack_write>
159
+ <speedextrack_read>
160
+ <connection>
161
+ <use>core_read</use>
162
+ </connection>
163
+ </speedextrack_read>
164
+ </resources>
165
+
166
+
167
+ <blocks>
168
+ <speedextrack>
169
+ <class>Webo2_Speedextrack_Block</class>
170
+ </speedextrack>
171
+ </blocks>
172
+ <helpers>
173
+ <speedextrack>
174
+ <class>Webo2_Speedextrack_Helper</class>
175
+ </speedextrack>
176
+ </helpers>
177
+ </global>
178
+ </config>
app/code/local/Webo2/Speedextrack/etc/system.xml ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * @category Webo2
5
+ * @package Speedextrack
6
+ * @author Mits Xourikis
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <tabs>
12
+ <webo2 translate="label" module="speedextrack">
13
+ <label>Webo2 Extensions</label>
14
+ <sort_order>400</sort_order>
15
+ </webo2>
16
+ </tabs>
17
+ <sections>
18
+ <speedextrack translate="label" module="speedextrack">
19
+ <label>Speedex Tracking</label>
20
+ <tab>webo2</tab>
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
+ <groups>
27
+ <speedextrack_general translate="label">
28
+ <label>General</label>
29
+ <frontend_type>text</frontend_type>
30
+ <sort_order>10</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ <fields>
35
+ <enabled translate="label">
36
+ <label>Enabled</label>
37
+ <frontend_type>select</frontend_type>
38
+ <source_model>adminhtml/system_config_source_yesno</source_model>
39
+ <sort_order>100</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <comment>Select Yes to enable this feature.</comment>
44
+ </enabled>
45
+ <account_id>
46
+ <label>Speedex Account ID</label>
47
+ <frontend_type>text</frontend_type>
48
+ <sort_order>120</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ <comment><![CDATA[ Fill your customer ID here. ]]></comment>
53
+ </account_id>
54
+ <toplinks translate="label">
55
+ <label>Visible at Top Links</label>
56
+ <frontend_type>select</frontend_type>
57
+ <source_model>adminhtml/system_config_source_yesno</source_model>
58
+ <sort_order>150</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ <comment>Select Yes to allow for Top Links.</comment>
63
+ <depends>
64
+ <enabled>1</enabled>
65
+ </depends>
66
+ </toplinks>
67
+ <topmenu translate="label">
68
+ <label>Visible at Top Menu</label>
69
+ <frontend_type>select</frontend_type>
70
+ <source_model>adminhtml/system_config_source_yesno</source_model>
71
+ <sort_order>200</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ <comment>Select Yes to allow for Top Menu.</comment>
76
+ <depends>
77
+ <enabled>1</enabled>
78
+ </depends>
79
+ </topmenu>
80
+ <sendtrack_link translate="label">
81
+ <label>Send TrackOrder Link</label>
82
+ <frontend_type>select</frontend_type>
83
+ <source_model>adminhtml/system_config_source_yesno</source_model>
84
+ <sort_order>250</sort_order>
85
+ <show_in_default>1</show_in_default>
86
+ <show_in_website>1</show_in_website>
87
+ <show_in_store>1</show_in_store>
88
+ <comment>Select Yes to send track order link in email.</comment>
89
+ </sendtrack_link>
90
+ <show_widget translate="label">
91
+ <label>Show TrackOrder Widget</label>
92
+ <frontend_type>select</frontend_type>
93
+ <source_model>speedextrack/system_config_frontend_widgetsettings</source_model>
94
+ <sort_order>250</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ <comment>Choose column for widget to appear</comment>
99
+ </show_widget>
100
+ </fields>
101
+ </speedextrack_general>
102
+ </groups>
103
+ </speedextrack>
104
+ </sections>
105
+ </config>
app/code/local/Webo2/Speedextrack/etc/widget.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Webo2
5
+ * @package Speedextrack
6
+ * @author Mits Xourikis
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <widgets>
11
+ <speedextrack_trackwidget type="speedextrack/trackwidget">
12
+ <name>Track Order</name>
13
+ <description type="desc">Track Order Link</description>
14
+ </speedextrack_trackwidget>
15
+ </widgets>
app/code/local/Webo2/Speedextrack/sql/speedextrack_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ ?>
app/code/local/Webo2/Speedextrack/sql/speedextrack_setup/mysql4-upgrade-0.1.0-0.1.1.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' => 'speedextrack/trackwidget.phtml'
13
+ );
14
+
15
+ $instance = Mage::getModel('widget/widget_instance')->setData(array(
16
+ 'type' => 'speedextrack/trackwidget',
17
+ 'package_theme' => 'default/default', // according to 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/base/default/layout/speedextrack.xml ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+
4
+ <default>
5
+ <reference name="head">
6
+ <action method="addCss" >speedextrack
7
+ <stylesheet>speedextrack/css/speedextrack.css</stylesheet>
8
+ </action>
9
+ </reference>
10
+ <reference name="top.links">
11
+ <action method="addLink" translate="label title" module="speedextrack" ifconfig="speedextrackr/speedextrack_general/toplinks">
12
+ <label>Trackorder</label>
13
+ <url helper="speedextrack/getTrackorderUrl"/>
14
+ <title>Trackorder</title>
15
+ <prepare/>
16
+ <urlParams/>
17
+ <position>20</position>
18
+ </action>
19
+ </reference>
20
+ <reference name="top.menu">
21
+ <block type="speedextrack/speedextrack" template="speedextrack/trackorderlink.phtml"/>
22
+ </reference>
23
+
24
+
25
+ </default>
26
+
27
+
28
+ <speedextrack_index_index>
29
+
30
+ <reference name="root">
31
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
32
+ <action method="setHeaderTitle" translate="title" module="speedextrack"><title>Track Your Order</title></action>
33
+ </reference>
34
+ <reference name="content">
35
+ <block type="speedextrack/speedextrack" name="speedextrack" template="speedextrack/speedextrack.phtml" />
36
+ </reference>
37
+ </speedextrack_index_index>
38
+
39
+ <speedextrack_index_track>
40
+ <reference name="content">
41
+ <block type="speedextrack/speedextrack" name="root" output="toHtml" template="speedextrack/trackdetail.phtml">
42
+ </block>
43
+ </reference>
44
+ </speedextrack_index_track>
45
+
46
+ <speedextrack_index_view>
47
+ <label>Customer My Account Order View</label>
48
+ <reference name="root">
49
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
50
+ </reference>
51
+ <reference name="content">
52
+ <block type="sales/order_info" as="info" name="sales.order.info" template="speedextrack/info.phtml">
53
+ <block type="sales/order_info_buttons" as="buttons" name="sales.order.info.buttons" />
54
+ </block>
55
+ <block type="sales/order_view" name="sales.order.view" template="speedextrack/view.phtml">
56
+ <block type="sales/order_items" name="order_items" template="sales/order/items.phtml">
57
+ <action method="addItemRender"><type>default</type><block>sales/order_item_renderer_default</block><template>sales/order/items/renderer/default.phtml</template></action>
58
+ <action method="addItemRender"><type>grouped</type><block>sales/order_item_renderer_grouped</block><template>sales/order/items/renderer/default.phtml</template></action>
59
+ <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
60
+ <action method="setLabelProperties"><value>colspan="4" class="a-right"</value></action>
61
+ <action method="setValueProperties"><value>class="last a-right"</value></action>
62
+ <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml" />
63
+ </block>
64
+ </block>
65
+ </block>
66
+ </reference>
67
+ <reference name="sales.order.info">
68
+ <action method="addLink" translate="label" module="sales"><name>view</name><path></path><label>Order Information</label></action>
69
+ <action method="addLink" translate="label" module="sales"><name>invoice</name><path>*/*/invoice</path><label>Invoices</label></action>
70
+ <action method="addLink" translate="label" module="sales"><name>shipment</name><path>*/*/shipment</path><label>Shipments</label></action>
71
+ <action method="addLink" translate="label" module="sales"><name>creditmemo</name><path>*/*/creditmemo</path><label>Refunds</label></action>
72
+ </reference>
73
+ </speedextrack_index_view>
74
+
75
+
76
+ <sales_email_order_items>
77
+ <reference name="items">
78
+ <action method="setTemplate" ifconfig="speedextrack/speedextrack_general/enabled">
79
+ <template>speedextrack/order/items.phtml</template>
80
+ </action>
81
+ </reference>
82
+ </sales_email_order_items>
83
+
84
+
85
+ <sales_email_order_shipment_items translate="label">
86
+ <reference name="items">
87
+ <action method="setTemplate" ifconfig="speedextrack/speedextrack_general/enabled">
88
+ <template>speedextrack/shipment/items.phtml</template>
89
+ </action>
90
+ </reference>
91
+ </sales_email_order_shipment_items>
92
+
93
+ </layout>
app/design/frontend/base/default/template/speedextrack/info.phtml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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) 2013 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_Sales_Block_Order_Info */ ?>
28
+ <?php $_order = $this->getOrder() ?>
29
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
30
+ <div class="page-title title-buttons">
31
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
32
+ <?php echo $this->getChildHtml('buttons') ?>
33
+ </div>
34
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
35
+ <dl class="order-info">
36
+ <dt><?php echo $this->__('Order Information') ?></dt>
37
+ </dl>
38
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
39
+ <?php if (!$_order->getIsVirtual()): ?>
40
+ <div class="col2-set order-info-box">
41
+ <div class="col-1">
42
+ <div class="box">
43
+ <div class="box-title">
44
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
45
+ </div>
46
+ <div class="box-content">
47
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <div class="col-2">
52
+ <div class="box">
53
+ <div class="box-title">
54
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
55
+ </div>
56
+ <div class="box-content">
57
+ <?php if ($_order->getShippingDescription()): ?>
58
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
59
+ <?php else: ?>
60
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
61
+ <?php endif; ?>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <?php endif; ?>
67
+ <div class="col2-set order-info-box">
68
+ <div class="col-1">
69
+ <div class="box">
70
+ <div class="box-title">
71
+ <h2><?php echo $this->__('Billing Address') ?></h2>
72
+ </div>
73
+ <div class="box-content">
74
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ <div class="col-2">
79
+ <div class="box box-payment">
80
+ <div class="box-title">
81
+ <h2><?php echo $this->__('Payment Method') ?></h2>
82
+ </div>
83
+ <div class="box-content">
84
+ <?php echo $this->getPaymentInfoHtml() ?>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </div>
app/design/frontend/base/default/template/speedextrack/order/items.phtml ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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) 2013 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 $_order = $this->getOrder() ?>
28
+ <?php if ($_order): ?>
29
+ <table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
30
+ <thead>
31
+ <tr>
32
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Item') ?></th>
33
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
34
+ <th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Qty') ?></th>
35
+ <th align="right" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Subtotal') ?></th>
36
+ </tr>
37
+ </thead>
38
+
39
+ <?php $i=0; foreach ($_order->getAllItems() as $_item): ?>
40
+ <?php if($_item->getParentItem()) continue; else $i++; ?>
41
+ <tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
42
+ <?php echo $this->getItemHtml($_item) ?>
43
+ </tbody>
44
+ <?php endforeach; ?>
45
+
46
+ <tbody>
47
+ <?php echo $this->getChildHtml('order_totals') ?>
48
+ </tbody>
49
+ </table>
50
+ <?php if ($this->helper('giftmessage/message')->isMessagesAvailable('order', $_order, $_order->getStore()) && $_order->getGiftMessageId()): ?>
51
+ <?php $_giftMessage = $this->helper('giftmessage/message')->getGiftMessage($_order->getGiftMessageId()); ?>
52
+ <?php if ($_giftMessage): ?>
53
+ <br />
54
+ <table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #EAEAEA;">
55
+ <thead>
56
+ <tr>
57
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><strong><?php echo $this->__('Gift Message for this Order') ?></strong></th>
58
+ </tr>
59
+ </thead>
60
+
61
+ <tbody>
62
+
63
+ <tr>
64
+ <td colspan="4" align="left" style="padding:3px 9px">
65
+ <strong><?php echo $this->__('From:'); ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?>
66
+ <br /><strong><?php echo $this->__('To:'); ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?>
67
+ <br /><strong><?php echo $this->__('Message:'); ?></strong><br /> <?php echo $this->escapeHtml($_giftMessage->getMessage()) ?>
68
+ </td>
69
+ </tr>
70
+ </tbody>
71
+ </table>
72
+ <?php endif; ?>
73
+ <?php endif; ?>
74
+ <?php if(Mage::getStoreConfig('speedextrack/speedextrack_general/enabled') && Mage::getStoreConfig('speedextrack/speedextrack_general/sendtrack_link') && ($_order->getTrackLink() != NULL)) { ?>
75
+ <br />
76
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
77
+ <thead>
78
+ <tr>
79
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Track Your Order') ?></th>
80
+ </tr>
81
+ </thead>
82
+ <tbody>
83
+ <tr>
84
+ <td style="font-size: 12px; padding: 7px 9px 9px 9px; border-left: 1px solid #EAEAEA;
85
+ border-bottom: 1px solid #EAEAEA; border-right: 1px solid #EAEAEA;">
86
+ <?php echo $this->__('Track Your Order ');?>
87
+ <a style="text-decoration: none;" href="<?php echo Mage::getBaseUrl().'speedextrack/index/view/'.$_order->getTrackLink();?>"> <?php echo $this->__('Here');?></a>
88
+ </td>
89
+ </tr>
90
+ </tbody>
91
+ </table>
92
+ <?php } ?>
93
+ <?php endif; ?>
app/design/frontend/base/default/template/speedextrack/shipment/items.phtml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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) 2013 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
+
28
+
29
+
30
+ <?php $_shipment = $this->getShipment() ?>
31
+ <?php $_order = $this->getOrder() ?>
32
+ <?php if ($_shipment && $_order): ?>
33
+ <table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
34
+ <thead>
35
+ <tr>
36
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Item') ?></th>
37
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
38
+ <th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Qty') ?></th>
39
+ </tr>
40
+ </thead>
41
+
42
+ <?php $i=0; foreach ($_shipment->getAllItems() as $_item): ?>
43
+ <?php if($_item->getOrderItem()->getParentItem()) continue; else $i++; ?>
44
+ <tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
45
+ <?php echo $this->getItemHtml($_item) ?>
46
+ </tbody>
47
+ <?php endforeach; ?>
48
+ </table>
49
+
50
+ <?php if(Mage::getStoreConfig('speedextrack/speedextrack_general/enabled') && Mage::getStoreConfig('speedextrack/speedextrack_general/sendtrack_link') && ($_order->getTrackLink() != NULL)) { ?>
51
+
52
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
53
+ <thead>
54
+ <tr>
55
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Track Your Order') ?></th>
56
+ </tr>
57
+ </thead>
58
+ <tbody bgcolor="#F6F6F6">
59
+ <tr>
60
+ <td style="font-size: 12px; padding: 7px 9px 9px 9px; border-left: 1px solid #EAEAEA;
61
+ border-bottom: 1px solid #EAEAEA; border-right: 1px solid #EAEAEA;">
62
+ <?php echo $this->__('Track Your Order ');?>
63
+ <a style="text-decoration: none;" href="<?php echo Mage::getBaseUrl().'speedextrack/index/view/'.$_order->getTrackLink();?>"> <?php echo $this->__('Here');?></a>
64
+ </td>
65
+ </tr>
66
+ </tbody>
67
+ </table>
68
+ <?php } ?>
69
+
70
+ <?php endif; ?>
71
+
72
+
73
+
app/design/frontend/base/default/template/speedextrack/speedextrack.phtml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style type="text/css">
2
+ .main-container {min-height: 450px;}
3
+ .dtrack-data-table {border-collapse:collapse;border-spacing:0;}
4
+ .dtrack-data-table td{font-family:Arial, sans-serif;font-size:14px;padding:15px 15px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color: #E4D2D2;}
5
+ .dtrack-data-table th{font-family:Arial, sans-serif;font-size:14px;font-weight:bold;padding:15px 15px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;background-color: #3399cc;text-align: center;color: #fff;}
6
+ </style>
7
+ <?php
8
+ if(Mage::getStoreConfig('speedextrack/speedextrack_general/enabled')):
9
+ ?>
10
+ <img src="http://v2.readytogo.gr/media/wysiwyg/LOGONI.gif" alt="speedex-tracking" width="120" style="float: left;"><div class="page-title"><h1 style="padding-top: 10px;text-align: center;border: none;"><?php echo $this->__('Speedex tracking ') ?></h1></div>
11
+ <div class="form-list" style="padding-left: 35%;">
12
+ <form name="track_order" id="track_order" action="" method="post" onsubmit="sendAjax('track_order','<?php echo Mage::getUrl('*/*/track');?>'); return false;">
13
+ <!--<form name="track_order" method="post" id="track_order" action="<?php echo Mage::getUrl('*/*/view');?>">-->
14
+ <ul class="form-list">
15
+ <li>
16
+ <label for="trackcode_id" class="required"><em>*</em><?php echo $this->__('Tracking ID') ?></label>
17
+ <div class="input-box">
18
+ <input type="text" name="trackcode_id" id="trackcode_id" value="" title="" class="input-text 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('speedextrack/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/base/default/template/speedextrack/trackdetail.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $order = $this->getTrackOrder();
3
+ $doc = new DOMdocument();
4
+ $doc->loadXML( $responsevalues );
5
+ $voustatuses = $doc->getElementsByTagName( "voustatus" );
6
+ $voustatus = $voustatuses->item(0)->nodeValue;
7
+ $voustatus_descrs = $doc->getElementsByTagName( "voustatus_descr" );
8
+ $voustatus_descr = $voustatus_descrs->item(0)->nodeValue;
9
+ $branches = $doc->getElementsByTagName( "branch" );
10
+ $branch = $branches->item(0)->nodeValue;
11
+ $comments = $doc->getElementsByTagName( "comments" );
12
+ $comment = $comments->item(0)->nodeValue;
13
+ $paralavons = $doc->getElementsByTagName( "paralavon" );
14
+ $paralavon = $paralavons->item(0)->nodeValue;
15
+ $dateparals = $doc->getElementsByTagName( "dateparal" );
16
+ $dateparal = $dateparals->item(0)->nodeValue;
17
+ echo "Status:\n" . htmlentities($voustatus) . "\n";
18
+ echo "Status Description:\n" . htmlentities($voustatus_descr) . "\n";
19
+ echo "Branch:\n" . htmlentities($branch) . "\n";
20
+ echo "Comment:\n" . htmlentities($comment) . "\n";
21
+ echo "Person:\n" . htmlentities($paralavon) . "\n";
22
+ echo "Date:\n" . htmlentities($dateparal) . "\n";
23
+
24
+ //try tables
25
+ $stat = "\n" . htmlentities($voustatus) . "\n";
26
+ $descr = "\n" . htmlentities($voustatus_descr) . "\n";
27
+ $bran = "\n" . htmlentities($branch) . "\n";
28
+ $comme = "\n" . htmlentities($comment) . "\n";
29
+ $paral = "\n" . htmlentities($paralavon) . "\n";
30
+ $datpar = "\n" . htmlentities($dateparal) . "\n";
31
+ ?>
32
+
app/design/frontend/base/default/template/speedextrack/trackorderlink.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php if (Mage::getStoreConfig('speedextrack/speedextrack_general/enabled') && Mage::getStoreConfig('speedextrack/speedextrack_general/topmenu')) { ?>
3
+ <div id="speedextrack_container" style="display: none">
4
+ <li class="level0 nav-3 last level-top">
5
+ <a href="<?php echo $this->getUrl('speedextrack') ?>">
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($('speedextrack_container').innerHTML);
13
+ }
14
+ </script>
15
+ <?php } ?>
app/design/frontend/base/default/template/speedextrack/trackwidget.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (Mage::getStoreConfig('speedextrack/speedextrack_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() . 'speedextrack/index'; ?>"> Track Order</a></label>
10
+
11
+ </div>
12
+ </div>
13
+
14
+
15
+ <?php } ?>
app/design/frontend/base/default/template/speedextrack/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/Webo2_Speedextrack.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Webo2
5
+ * @package Speedextrack
6
+ * @author Mits Xourikis
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Webo2_Speedextrack>
13
+ <active>true</active>
14
+ <codePool>local</codePool>
15
+ <depends>
16
+ <Mage_Sales/>
17
+ </depends>
18
+ </Webo2_Speedextrack>
19
+ </modules>
20
+ </config>
app/locale/en_US/Webo2_Speedextrack.csv ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ "Tracking ID","Αριθμός Αποστολής"
2
+ "Track Order","Αναζήτηση"
3
+ "Loading...","Φορτώνει..."
4
+ "Please wait...","Παρακαλώ περιμένετε..."
5
+ "Track Widget","Track Widget"
6
+ "Speedex tracking ","Αναζήτηση Αποστολής"
7
+ "TrackOrder","TrackOrder"
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>webo2_speedextrack</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>Speedex Courier - Track &amp; Trace module makes easier for your customers to track their order's progress.</summary>
10
+ <description>Speedex Courier - Track &amp; Trace module makes easier for your customers to track their order's real-time progress.&#xD;
11
+ &#xD;
12
+ Fast and easy installation and configuration&#xD;
13
+ No need to log in&#xD;
14
+ Send track link via email (order confirmation &amp; shipment notification)</description>
15
+ <notes>Speedex Courier - Track &amp; Trace release</notes>
16
+ <authors><author><name>Webo2</name><user>Webo2</user><email>mitsxourikis@gmail.com</email></author></authors>
17
+ <date>2015-08-03</date>
18
+ <time>06:08:57</time>
19
+ <contents><target name="magelocal"><dir name="Webo2"><dir name="Speedextrack"><dir name="Block"><file name="Speedextrack.php" hash="623af300feb67149394dbfcae508191a"/><file name="Trackwidget.php" hash="acc662e6acd3a8e84c755833eac694af"/><file name="View.php" hash="42ff62ae94213d1776de885dc2690c24"/></dir><dir name="Helper"><file name="Data.php" hash="8e2feb11db2d1667d60d7f0ebf2f2bc5"/></dir><dir name="Model"><file name="Observer.php" hash="fece084e34e6b690eb5c1401082bd05a"/><dir name="System"><dir name="Config"><dir name="Frontend"><file name="Widgetsettings.php" hash="01e0b56b70253c7e8bdde36ac176c7cf"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="512807df1c7719398fe86f41cf8b4d13"/></dir><dir name="etc"><file name="config.xml" hash="40a83fa15245eccd752c2b473358ff60"/><file name="system.xml" hash="7e95941847d7ad97b83544a0e13e7566"/><file name="widget.xml" hash="2c4dc1aae4b34f4a4fe407eca95c95f5"/></dir><dir name="sql"><dir name="speedextrack_setup"><file name="mysql4-install-0.1.0.php" hash="47c62d342c96c4628c2da5c2e3dafacf"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="a8c712a7128d8350c4e238c44d49d47b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="speedextrack"><file name="info.phtml" hash="5d1c1a5edf9de1a3692ad1d66508d280"/><dir name="order"><file name="items.phtml" hash="4b4da74f29e06b7bfa904cf202ff0268"/></dir><dir name="shipment"><file name="items.phtml" hash="25c1dd57c7c7f6439fc96182a58bb011"/></dir><file name="speedextrack.phtml" hash="7f9e9246c95b80b363db537198f363b2"/><file name="trackdetail.phtml" hash="2950dabe514b50f5769665ef8785c97b"/><file name="trackorderlink.phtml" hash="5319fab1284da222dba4bbf110039819"/><file name="trackwidget.phtml" hash="37ca8ce45b5fe8393826f9eb5743e6b4"/><file name="view.phtml" hash="71f72f80ecf948a65cba97cbd7ce7e26"/></dir></dir><dir name="layout"><file name="speedextrack.xml" hash="92c0618c64a10c6c2a2ec45a022a37c9"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Webo2_Speedextrack.xml" hash="7b9ac2b5e9fe69427c9e98f1698e4a9c"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Webo2_Speedextrack.csv" hash="f3105f62e2546f58a27b2b88e588828a"/></dir><dir name="el_GR"><file name="Webo2_Speedextrack.csv" hash=""/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="speedextrack"><dir name="css"><file name="speedextrack.css" hash="9bfecdaa1cf87a42f67f642dc865bea6"/></dir><dir name="images"><file name="ajax-loader-tr.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/><file name="ajax-loader.gif" hash="57ca1a2085d82f0574e3ef740b9a5ead"/><file name="i-trackorder.png" hash="65f5d4dbeafa21878e487859e29b0453"/><file name="main-bg.png" hash="615e539beac7fc4ad7b6aa7e519ca2ee"/></dir></dir></dir></dir></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
22
+ </package>
skin/frontend/base/default/speedextrack/css/speedextrack.css ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .loading-details { background: url("../images/main-bg.png") repeat scroll 0 0 transparent; height: 100%; left: 0; position: fixed; top: 0; width: 100%; z-index: 99; }
2
+ #loading-details .update-popup { position:fixed; top:45%; left:45%; width:300px; margin-left:-105px; padding:15px 30px; background:#fff; color:#d85909; font-weight:bold; text-align:center; z-index:400;webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px;}
3
+ #loading-mask { background: none repeat scroll 0 0 #F5F5F5; border: 1px solid #F18200; margin: 20% auto; padding: 15px; text-align: center; width: 200px;}
4
+ #loading-mask p{ margin-bottom:0;}
5
+
6
+ .track-data-table{ margin-bottom:20px;}
7
+
8
+ .order-info-message{ padding-top: 15px;}
9
+
10
+ .block-trackorder .block-content{ padding: 5px 10px;}
11
+
12
+ .block-trackorder .block-title strong { background-image: url("../images/i-trackorder.png"); background-position: 0 0;
13
+ background-repeat: no-repeat; padding-left: 21px;}
skin/frontend/base/default/speedextrack/images/ajax-loader-tr.gif ADDED
Binary file
skin/frontend/base/default/speedextrack/images/ajax-loader.gif ADDED
Binary file
skin/frontend/base/default/speedextrack/images/i-trackorder.png ADDED
Binary file
skin/frontend/base/default/speedextrack/images/main-bg.png ADDED
Binary file