Version Notes
Customer can check delivery status of his order.
* Track airwaybill number from multiple courier companies at one place.
* Track complete shipping status from confirm order to order delivery
* Shows shipment realtime status details.
Download this release
Release Info
Developer | Onjection |
Extension | bebe68374a49cb41b7c9219e97250044 |
Version | 1.2.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.0 to 1.2.1
- app/code/community/Company/Shipwa/Block/Adminhtml/Couriermapping.php +24 -0
- app/code/community/Company/Shipwa/Block/Adminhtml/Shipwa.php +16 -0
- app/code/{local/Onj/Shipway → community/Company/Shipwa}/Block/Links.php +1 -1
- app/code/community/Company/Shipwa/Block/Shipwa.php +10 -0
- app/code/community/Company/Shipwa/Helper/Data.php +6 -0
- app/code/community/Company/Shipwa/Model/Mysql4/Shipwa.php +10 -0
- app/code/community/Company/Shipwa/Model/Mysql4/Shipwa/Collection.php +10 -0
- app/code/{local/Onj/Shipway → community/Company/Shipwa}/Model/Order/Shipment.php +159 -157
- app/code/{local/Onj/Shipway → community/Company/Shipwa}/Model/Order/Shipment/Api.php +0 -0
- app/code/community/Company/Shipwa/Model/Shipwa.php +10 -0
- app/code/community/Company/Shipwa/Model/Status.php +15 -0
- app/code/{local/Onj/Shipway/Controllers/Adminhtml/ShipwayController.php → community/Company/Shipwa/controllers/Adminhtml/ShipwaController.php} +26 -12
- app/code/community/Company/Shipwa/controllers/Adminhtml/ShipwaController_1.php +185 -0
- app/code/{local/Onj/Shipway/Controllers/ShipwayController.php → community/Company/Shipwa/controllers/IndexController.php} +118 -118
- app/code/community/Company/Shipwa/etc/config.xml +150 -0
- app/code/{local/Onj/Shipway/sql/shipway_setup → community/Company/Shipwa/sql/shipwa_setup}/mysql4-install-0.1.0.php +34 -29
- app/code/community/Company/Shipwa/sql/shipwa_setup/upgrade-3.1.5.6-3.2.0.1.php_ +37 -0
- app/code/local/Onj/Shipway/Block/Adminhtml/Couriermapping.php +0 -24
- app/code/local/Onj/Shipway/Block/Adminhtml/Shipway.php +0 -18
- app/code/local/Onj/Shipway/Block/Shipway.php +0 -11
- app/code/local/Onj/Shipway/Helper/Data.php +0 -6
- app/code/local/Onj/Shipway/Model/Mysql4/Shipway.php +0 -10
- app/code/local/Onj/Shipway/Model/Mysql4/Shipway/Collection.php +0 -10
- app/code/local/Onj/Shipway/Model/Shipway.php +0 -10
- app/code/local/Onj/Shipway/Model/Status.php +0 -15
- app/code/local/Onj/Shipway/etc/config.xml +0 -147
- app/design/adminhtml/default/default/layout/shipwa.xml +42 -0
- app/design/adminhtml/default/default/layout/shipway.xml +0 -32
- app/design/adminhtml/default/default/template/shipwa/couriermapping.phtml +1 -0
- app/design/adminhtml/default/default/template/{shipway/shipway.phtml → shipwa/shipwa.phtml} +0 -2
- app/design/adminhtml/default/default/template/{shipway → shipwa}/tracking.phtml +91 -92
- app/design/adminhtml/default/default/template/shipway/couriermapping.phtml +0 -133
- app/design/frontend/base/default/layout/shipwa.xml +31 -0
- app/design/frontend/base/default/layout/shipway.xml +0 -26
- app/design/frontend/base/default/template/shipwa/trackorder.phtml +68 -0
- app/design/frontend/base/default/template/shipway/trackorder.phtml +0 -43
- app/etc/modules/Company_Shipwa.xml +9 -0
- app/etc/modules/Onj_Shipway.xml +0 -10
- package.xml +5 -5
app/code/community/Company/Shipwa/Block/Adminhtml/Couriermapping.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Company_Shipwa_Block_Adminhtml_Couriermapping extends Mage_Adminhtml_Block_Widget
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
|
9 |
+
|
10 |
+
parent::__construct();
|
11 |
+
$this->setTemplate('shipwa/couriermapping.phtml');
|
12 |
+
$this->setFormAction(Mage::getUrl('*/*/savecouriermapp'));
|
13 |
+
|
14 |
+
$this->_controller = 'adminhtml_shipwa';
|
15 |
+
$this->_blockGroup = 'shipwa';
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
}
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
?>
|
app/code/community/Company/Shipwa/Block/Adminhtml/Shipwa.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Company_Shipwa_Block_Adminhtml_Shipwa extends Mage_Adminhtml_Block_Widget
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setTemplate('shipway/shipway.phtml');
|
8 |
+
$this->setFormAction(Mage::getUrl('*/*/showdetails'));
|
9 |
+
$this->_controller = 'adminhtml_shipwa';
|
10 |
+
$this->_blockGroup = 'shipwa';
|
11 |
+
|
12 |
+
//$this->_headerText = Mage::helper('shipwa')->__('Item Manager');
|
13 |
+
//$this->_addButtonLabel = Mage::helper('shipwa')->__('Add Item');
|
14 |
+
|
15 |
+
}
|
16 |
+
}
|
app/code/{local/Onj/Shipway → community/Company/Shipwa}/Block/Links.php
RENAMED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php class
|
2 |
{
|
3 |
/**
|
4 |
* Position in link list
|
1 |
+
<?php class Company_Shipwa_Block_Links extends Mage_Page_Block_Template_Links_Block
|
2 |
{
|
3 |
/**
|
4 |
* Position in link list
|
app/code/community/Company/Shipwa/Block/Shipwa.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Company_Shipwa_Block_Shipwa extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
protected function _prepareLayout()
|
5 |
+
{
|
6 |
+
$this->setFormAction(Mage::getUrl('*/*/showdetails'));
|
7 |
+
return parent::_prepareLayout();
|
8 |
+
}
|
9 |
+
|
10 |
+
}
|
app/code/community/Company/Shipwa/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Company_Shipwa_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Company/Shipwa/Model/Mysql4/Shipwa.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Company_Shipwa_Model_Mysql4_Shipwa extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the shipwa_id refers to the key field in your database table.
|
8 |
+
$this->_init('shipwa/shipwa', 'shipwa_id');
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Company/Shipwa/Model/Mysql4/Shipwa/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Company_Shipwa_Model_Mysql4_Shipwa_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('shipwa/shipwa');
|
9 |
+
}
|
10 |
+
}
|
app/code/{local/Onj/Shipway → community/Company/Shipwa}/Model/Order/Shipment.php
RENAMED
@@ -1,158 +1,160 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class
|
4 |
-
{
|
5 |
-
protected function _afterSave()
|
6 |
-
{
|
7 |
-
if (null !== $this->_items) {
|
8 |
-
foreach ($this->_items as $item) {
|
9 |
-
$item->save();
|
10 |
-
}
|
11 |
-
}
|
12 |
-
|
13 |
-
if (null !== $this->_tracks) {
|
14 |
-
foreach($this->_tracks as $track) {
|
15 |
-
$track->save();
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
if (null !== $this->_comments) {
|
20 |
-
foreach($this->_comments as $comment) {
|
21 |
-
$comment->save();
|
22 |
-
}
|
23 |
-
}
|
24 |
-
$order__id=$this->getOrderId();
|
25 |
-
$order = Mage::getModel('sales/order')->load($order__id);
|
26 |
-
|
27 |
-
|
28 |
-
$
|
29 |
-
$
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
$
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
$
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
$
|
47 |
-
|
48 |
-
|
49 |
-
$
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
'
|
56 |
-
'
|
57 |
-
'
|
58 |
-
'
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
$
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
$orderdetails['
|
76 |
-
$orderdetails['
|
77 |
-
|
78 |
-
|
79 |
-
$
|
80 |
-
|
81 |
-
$
|
82 |
-
$
|
83 |
-
$
|
84 |
-
$
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
'
|
89 |
-
'
|
90 |
-
'
|
91 |
-
'
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
$
|
100 |
-
|
101 |
-
|
102 |
-
'
|
103 |
-
'
|
104 |
-
'
|
105 |
-
'
|
106 |
-
'
|
107 |
-
'
|
108 |
-
'
|
109 |
-
'
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
'
|
114 |
-
'
|
115 |
-
'
|
116 |
-
'
|
117 |
-
'
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
$data['
|
125 |
-
|
126 |
-
$data['
|
127 |
-
$data['
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
curl_setopt($curl,
|
139 |
-
curl_setopt($curl,
|
140 |
-
curl_setopt($curl,
|
141 |
-
curl_setopt($curl,
|
142 |
-
|
143 |
-
$
|
144 |
-
|
145 |
-
|
146 |
-
$
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
echo $result['message'];
|
153 |
-
}
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
}
|
|
|
|
|
158 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Company_shipwa_Model_Order_Shipment extends Mage_Sales_Model_Order_Shipment
|
4 |
+
{
|
5 |
+
protected function _afterSave()
|
6 |
+
{
|
7 |
+
if (null !== $this->_items) {
|
8 |
+
foreach ($this->_items as $item) {
|
9 |
+
$item->save();
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
if (null !== $this->_tracks) {
|
14 |
+
foreach($this->_tracks as $track) {
|
15 |
+
$track->save();
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
if (null !== $this->_comments) {
|
20 |
+
foreach($this->_comments as $comment) {
|
21 |
+
$comment->save();
|
22 |
+
}
|
23 |
+
}
|
24 |
+
$order__id=$this->getOrderId();
|
25 |
+
$order = Mage::getModel('sales/order')->load($order__id);
|
26 |
+
$increment_id=$order->getIncrementId();
|
27 |
+
foreach ($order->getTracksCollection() as $_track){
|
28 |
+
$track_no=$_track->getNumber();
|
29 |
+
$track_code=$_track->getCarrier_code();
|
30 |
+
$track_title=$_track->getTitle();
|
31 |
+
}
|
32 |
+
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
33 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
34 |
+
if($track_code!='custom'){
|
35 |
+
$courierDetail= $read->fetchAll("select * from shipway_couriermapping where default_courier='".$track_code."'");
|
36 |
+
}else{
|
37 |
+
$courierDetail= $read->fetchAll("select * from shipway_couriermapping where default_courier='".$track_title."'");
|
38 |
+
}
|
39 |
+
$logindetail= $read->fetchAll("select * from shipway where shipway_id=1");
|
40 |
+
if(count($logindetail)){
|
41 |
+
|
42 |
+
$shipway_loginid= $logindetail[0]['loginid'];
|
43 |
+
$shipway_licencekey= $logindetail[0]['licencekey'];
|
44 |
+
}
|
45 |
+
else{
|
46 |
+
$shipway_loginid= '';
|
47 |
+
$shipway_licencekey= '';
|
48 |
+
}
|
49 |
+
if(count($courierDetail)){
|
50 |
+
$shipway_carrier_id= $courierDetail[0]['shipway_courierid'];
|
51 |
+
}else{
|
52 |
+
$shipway_carrier_id= '';
|
53 |
+
}
|
54 |
+
$data = array(
|
55 |
+
'carrier_id' => $shipway_carrier_id,
|
56 |
+
'order_id' => $increment_id,
|
57 |
+
'awb' => $track_no,
|
58 |
+
'username' => $shipway_loginid,
|
59 |
+
'password' => $shipway_licencekey
|
60 |
+
);
|
61 |
+
$this->assignAwb($data);
|
62 |
+
return parent::_afterSave();
|
63 |
+
}
|
64 |
+
|
65 |
+
public function assignAwb($data)
|
66 |
+
{
|
67 |
+
|
68 |
+
$order = Mage::getModel("sales/order")->loadByIncrementId($data['order_id']);
|
69 |
+
$payment_code= $order->getPayment()->getMethodInstance()->getCode();
|
70 |
+
$pos = strpos($payment_code, 'cash');
|
71 |
+
$payment_type = 'P';
|
72 |
+
if( strpos($payment_code, 'cash')){
|
73 |
+
$payment_type = 'C';
|
74 |
+
}
|
75 |
+
$orderdetails['payment_type'] = $payment_type;
|
76 |
+
$orderdetails['payment_method'] = $payment_code;
|
77 |
+
$orderdetails['return_address'] = 'abc';
|
78 |
+
|
79 |
+
$orderTotalValue = number_format ($order->getGrandTotal(), 2, '.' , $thousands_sep = '');
|
80 |
+
$orderdetails['collectable_amount'] = $orderTotalValue;
|
81 |
+
$orderdetails['collectable_amount'] = ($payment_type == 'C') ? $orderTotalValue : 0;
|
82 |
+
$ordered_items = $order->getAllItems();
|
83 |
+
$itms='';
|
84 |
+
$products=array();
|
85 |
+
$orderdetails=array();
|
86 |
+
foreach($ordered_items as $item){
|
87 |
+
$products[]=array(
|
88 |
+
'product_id'=> $item->getProductId(),
|
89 |
+
'name'=> $item->getName(),
|
90 |
+
'price'=> $item->getPrice(),
|
91 |
+
'quantity'=> $item->getQtyOrdered(),
|
92 |
+
'url'=> 'abc'
|
93 |
+
);
|
94 |
+
|
95 |
+
$itms .= $item->getName().' ';
|
96 |
+
}
|
97 |
+
|
98 |
+
$itms=substr($itms,0,35);
|
99 |
+
$shipping_address = $order->getShippingAddress();
|
100 |
+
$orderdetails=array(
|
101 |
+
'order_id' => $data['order_id'],
|
102 |
+
'order_date' => $order->getCreatedAt(),
|
103 |
+
'firstname' => $shipping_address->getFirstname(),
|
104 |
+
'lastname' =>$shipping_address->getLastname(),
|
105 |
+
'email' => $shipping_address->getEmail(),
|
106 |
+
'phone' => $shipping_address->getTelephone(),
|
107 |
+
'address' => $shipping_address->getCity(),
|
108 |
+
'city' => $shipping_address->getCity(),
|
109 |
+
'state' => $shipping_address->getRegion(),
|
110 |
+
'zipcode' => $shipping_address->getPostcode(),
|
111 |
+
|
112 |
+
'country' => 'India',
|
113 |
+
'products' => $products,
|
114 |
+
'amount' => $orderTotalValue,
|
115 |
+
'payment_type' => $payment_type,
|
116 |
+
'payment_method' => $payment_code,
|
117 |
+
'collectable_amount' => $orderTotalValue,
|
118 |
+
'return_address' => 'abc',
|
119 |
+
|
120 |
+
|
121 |
+
);
|
122 |
+
$company_name= $_SERVER['SERVER_NAME'];
|
123 |
+
$data['first_name'] = $shipping_address->getFirstname();
|
124 |
+
$data['last_name'] = $shipping_address->getLastname();
|
125 |
+
$data['email'] = $shipping_address->getEmail();
|
126 |
+
$data['phone'] = $shipping_address->getTelephone();
|
127 |
+
$data['products'] = $itms;
|
128 |
+
$data['company'] = $company_name;
|
129 |
+
$data['order'] = $orderdetails;
|
130 |
+
|
131 |
+
$url = "http://shipway.in/api/pushOrderData";
|
132 |
+
|
133 |
+
$data_string = json_encode($data);
|
134 |
+
$curl = curl_init();
|
135 |
+
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
|
136 |
+
'Content-Type:application/json'
|
137 |
+
));
|
138 |
+
curl_setopt($curl, CURLOPT_URL, $url);
|
139 |
+
curl_setopt($curl, CURLOPT_POST, true);
|
140 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);
|
141 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
142 |
+
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
|
143 |
+
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
144 |
+
|
145 |
+
$output = curl_exec($curl);
|
146 |
+
$output = json_decode($output);
|
147 |
+
curl_close($curl);
|
148 |
+
$result=(array)$output;
|
149 |
+
|
150 |
+
if ($result['status'] == 'Failed ') {
|
151 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('shipwa')->__($result['message']));
|
152 |
+
// echo $result['message'];
|
153 |
+
} else {
|
154 |
+
// echo $result['message'];
|
155 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('shipwa')->__($result['message']));
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
}
|
160 |
?>
|
app/code/{local/Onj/Shipway → community/Company/Shipwa}/Model/Order/Shipment/Api.php
RENAMED
File without changes
|
app/code/community/Company/Shipwa/Model/Shipwa.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Company_Shipwa_Model_Shipwa extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('shipwa/shipwa');
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Company/Shipwa/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Company_Shipwa_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 2;
|
7 |
+
|
8 |
+
static public function getOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
self::STATUS_ENABLED => Mage::helper('shipwa')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('shipwa')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/{local/Onj/Shipway/Controllers/Adminhtml/ShipwayController.php → community/Company/Shipwa/controllers/Adminhtml/ShipwaController.php}
RENAMED
@@ -1,18 +1,32 @@
|
|
1 |
<?php
|
2 |
-
class
|
3 |
{
|
4 |
|
5 |
|
6 |
-
public function indexAction() {
|
7 |
-
|
8 |
$this->loadLayout();
|
9 |
-
$block = $this->getLayout()->createBlock('
|
10 |
$this->getLayout()->getBlock('content')->append($block);
|
11 |
$this->renderLayout();
|
12 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
public function showdetailsAction(){
|
14 |
|
15 |
$data = $this->getRequest()->getPost();
|
|
|
16 |
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
17 |
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
18 |
$table='shipway';
|
@@ -37,14 +51,14 @@ $data = $this->getRequest()->getPost();
|
|
37 |
$output = curl_exec($curl);
|
38 |
curl_close($curl);
|
39 |
|
40 |
-
$output = json_decode($output);
|
41 |
if(isset($output->status) && strtolower($output->status) == 'success'){
|
42 |
$query = "UPDATE {$table} SET loginid= '{$loginid}' , licencekey= '{$licencekey}' WHERE shipway_id = 1";
|
43 |
$write->query($query);
|
44 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('
|
45 |
}
|
46 |
else{
|
47 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('
|
48 |
|
49 |
}
|
50 |
|
@@ -62,7 +76,7 @@ public function couriermappingAction(){
|
|
62 |
|
63 |
|
64 |
$this->loadLayout();
|
65 |
-
$block=$this->getLayout()->createblock('
|
66 |
$this->getLayout()->getBlock('content')->append($block);
|
67 |
$this->renderLayout();
|
68 |
}
|
@@ -71,9 +85,9 @@ public function savecouriermappAction(){
|
|
71 |
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
72 |
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
73 |
$data = $this->getRequest()->getPost();
|
74 |
-
|
75 |
-
//print_r($data); die;
|
76 |
-
//$read->fetchAll(" DELETE FROM
|
77 |
$write->delete("shipway_couriermapping");
|
78 |
|
79 |
$i=1;
|
@@ -89,7 +103,7 @@ $i++;
|
|
89 |
}
|
90 |
}
|
91 |
|
92 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('
|
93 |
|
94 |
|
95 |
$this->_redirect('*/*/couriermapping');
|
1 |
<?php
|
2 |
+
class Company_Shipwa_Adminhtml_ShipwaController extends Mage_Adminhtml_Controller_action
|
3 |
{
|
4 |
|
5 |
|
6 |
+
public function indexAction() {
|
|
|
7 |
$this->loadLayout();
|
8 |
+
$block = $this->getLayout()->createBlock('company_shipwa/adminhtml_shipwa');
|
9 |
$this->getLayout()->getBlock('content')->append($block);
|
10 |
$this->renderLayout();
|
11 |
}
|
12 |
+
/* protected function _initAction() {
|
13 |
+
$this->loadLayout()
|
14 |
+
->_setActiveMenu('shipwa/items')
|
15 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
16 |
+
|
17 |
+
return $this;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function indexAction() {
|
21 |
+
$this->_initAction()
|
22 |
+
->renderLayout();
|
23 |
+
}
|
24 |
+
*/
|
25 |
+
|
26 |
public function showdetailsAction(){
|
27 |
|
28 |
$data = $this->getRequest()->getPost();
|
29 |
+
|
30 |
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
31 |
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
32 |
$table='shipway';
|
51 |
$output = curl_exec($curl);
|
52 |
curl_close($curl);
|
53 |
|
54 |
+
$output = json_decode($output); // print_r($output); die;
|
55 |
if(isset($output->status) && strtolower($output->status) == 'success'){
|
56 |
$query = "UPDATE {$table} SET loginid= '{$loginid}' , licencekey= '{$licencekey}' WHERE shipway_id = 1";
|
57 |
$write->query($query);
|
58 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('shipwa')->__('Setting saved '));
|
59 |
}
|
60 |
else{
|
61 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('shipwa')->__('Invalid Access'));
|
62 |
|
63 |
}
|
64 |
|
76 |
|
77 |
|
78 |
$this->loadLayout();
|
79 |
+
$block=$this->getLayout()->createblock('company_shipwa/adminhtml_couriermapping');
|
80 |
$this->getLayout()->getBlock('content')->append($block);
|
81 |
$this->renderLayout();
|
82 |
}
|
85 |
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
86 |
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
87 |
$data = $this->getRequest()->getPost();
|
88 |
+
|
89 |
+
//print_r($data); die;
|
90 |
+
//$read->fetchAll(" DELETE FROM shipwa_couriermapping where 1 ");
|
91 |
$write->delete("shipway_couriermapping");
|
92 |
|
93 |
$i=1;
|
103 |
}
|
104 |
}
|
105 |
|
106 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('shipwa')->__('Courier has mapped '));
|
107 |
|
108 |
|
109 |
$this->_redirect('*/*/couriermapping');
|
app/code/community/Company/Shipwa/controllers/Adminhtml/ShipwaController_1.php
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Company_Shipwa_Adminhtml_ShipwaController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('shipwa/items')
|
9 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
+
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction() {
|
15 |
+
$this->_initAction()
|
16 |
+
->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function couriermappingAction() {
|
20 |
+
$this->_initAction()
|
21 |
+
->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
public function editAction() {
|
25 |
+
$id = $this->getRequest()->getParam('id');
|
26 |
+
$model = Mage::getModel('shipwa/shipwa')->load($id);
|
27 |
+
|
28 |
+
if ($model->getId() || $id == 0) {
|
29 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
30 |
+
if (!empty($data)) {
|
31 |
+
$model->setData($data);
|
32 |
+
}
|
33 |
+
|
34 |
+
Mage::register('shipwa_data', $model);
|
35 |
+
|
36 |
+
$this->loadLayout();
|
37 |
+
$this->_setActiveMenu('shipwa/items');
|
38 |
+
|
39 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
40 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
41 |
+
|
42 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
43 |
+
|
44 |
+
$this->_addContent($this->getLayout()->createBlock('shipwa/adminhtml_shipwa_edit'))
|
45 |
+
->_addLeft($this->getLayout()->createBlock('shipwa/adminhtml_shipwa_edit_tabs'));
|
46 |
+
|
47 |
+
$this->renderLayout();
|
48 |
+
} else {
|
49 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('shipwa')->__('Item does not exist'));
|
50 |
+
$this->_redirect('*/*/');
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
public function newAction() {
|
55 |
+
$this->_forward('edit');
|
56 |
+
}
|
57 |
+
|
58 |
+
public function saveAction() {
|
59 |
+
if ($data = $this->getRequest()->getPost()) {
|
60 |
+
|
61 |
+
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
62 |
+
try {
|
63 |
+
/* Starting upload */
|
64 |
+
$uploader = new Varien_File_Uploader('filename');
|
65 |
+
|
66 |
+
// Any extention would work
|
67 |
+
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
68 |
+
$uploader->setAllowRenameFiles(false);
|
69 |
+
|
70 |
+
// Set the file upload mode
|
71 |
+
// false -> get the file directly in the specified folder
|
72 |
+
// true -> get the file in the product like folders
|
73 |
+
// (file.jpg will go in something like /media/f/i/file.jpg)
|
74 |
+
$uploader->setFilesDispersion(false);
|
75 |
+
|
76 |
+
// We set media as the upload dir
|
77 |
+
$path = Mage::getBaseDir('media') . DS ;
|
78 |
+
$uploader->save($path, $_FILES['filename']['name'] );
|
79 |
+
|
80 |
+
} catch (Exception $e) {
|
81 |
+
|
82 |
+
}
|
83 |
+
|
84 |
+
//this way the name is saved in DB
|
85 |
+
$data['filename'] = $_FILES['filename']['name'];
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
$model = Mage::getModel('shipwa/shipwa');
|
90 |
+
$model->setData($data)
|
91 |
+
->setId($this->getRequest()->getParam('id'));
|
92 |
+
|
93 |
+
try {
|
94 |
+
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
95 |
+
$model->setCreatedTime(now())
|
96 |
+
->setUpdateTime(now());
|
97 |
+
} else {
|
98 |
+
$model->setUpdateTime(now());
|
99 |
+
}
|
100 |
+
|
101 |
+
$model->save();
|
102 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('shipwa')->__('Item was successfully saved'));
|
103 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
104 |
+
|
105 |
+
if ($this->getRequest()->getParam('back')) {
|
106 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
$this->_redirect('*/*/');
|
110 |
+
return;
|
111 |
+
} catch (Exception $e) {
|
112 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
113 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
114 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
115 |
+
return;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('shipwa')->__('Unable to find item to save'));
|
119 |
+
$this->_redirect('*/*/');
|
120 |
+
}
|
121 |
+
|
122 |
+
public function deleteAction() {
|
123 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
124 |
+
try {
|
125 |
+
$model = Mage::getModel('shipwa/shipwa');
|
126 |
+
|
127 |
+
$model->setId($this->getRequest()->getParam('id'))
|
128 |
+
->delete();
|
129 |
+
|
130 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
131 |
+
$this->_redirect('*/*/');
|
132 |
+
} catch (Exception $e) {
|
133 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
134 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
135 |
+
}
|
136 |
+
}
|
137 |
+
$this->_redirect('*/*/');
|
138 |
+
}
|
139 |
+
|
140 |
+
public function massDeleteAction() {
|
141 |
+
$shipwaIds = $this->getRequest()->getParam('shipwa');
|
142 |
+
if(!is_array($shipwaIds)) {
|
143 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
144 |
+
} else {
|
145 |
+
try {
|
146 |
+
foreach ($shipwaIds as $shipwaId) {
|
147 |
+
$shipwa = Mage::getModel('shipwa/shipwa')->load($shipwaId);
|
148 |
+
$shipwa->delete();
|
149 |
+
}
|
150 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
151 |
+
Mage::helper('adminhtml')->__(
|
152 |
+
'Total of %d record(s) were successfully deleted', count($shipwaIds)
|
153 |
+
)
|
154 |
+
);
|
155 |
+
} catch (Exception $e) {
|
156 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
157 |
+
}
|
158 |
+
}
|
159 |
+
$this->_redirect('*/*/index');
|
160 |
+
}
|
161 |
+
|
162 |
+
public function massStatusAction()
|
163 |
+
{
|
164 |
+
$shipwaIds = $this->getRequest()->getParam('shipwa');
|
165 |
+
if(!is_array($shipwaIds)) {
|
166 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
167 |
+
} else {
|
168 |
+
try {
|
169 |
+
foreach ($shipwaIds as $shipwaId) {
|
170 |
+
$shipwa = Mage::getSingleton('shipwa/shipwa')
|
171 |
+
->load($shipwaId)
|
172 |
+
->setStatus($this->getRequest()->getParam('status'))
|
173 |
+
->setIsMassupdate(true)
|
174 |
+
->save();
|
175 |
+
}
|
176 |
+
$this->_getSession()->addSuccess(
|
177 |
+
$this->__('Total of %d record(s) were successfully updated', count($shipwaIds))
|
178 |
+
);
|
179 |
+
} catch (Exception $e) {
|
180 |
+
$this->_getSession()->addError($e->getMessage());
|
181 |
+
}
|
182 |
+
}
|
183 |
+
$this->_redirect('*/*/index');
|
184 |
+
}
|
185 |
+
}
|
app/code/{local/Onj/Shipway/Controllers/ShipwayController.php → community/Company/Shipwa/controllers/IndexController.php}
RENAMED
@@ -1,118 +1,118 @@
|
|
1 |
-
<?php
|
2 |
-
class
|
3 |
-
{
|
4 |
-
public function
|
5 |
-
{
|
6 |
-
|
7 |
-
|
8 |
-
$this->getLayout()->
|
9 |
-
$this->
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
$
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
$
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
$
|
64 |
-
$
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
$
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
)
|
103 |
-
|
104 |
-
curl_setopt($curl,
|
105 |
-
|
106 |
-
|
107 |
-
curl_setopt($curl,
|
108 |
-
curl_setopt($curl,
|
109 |
-
$
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
1 |
+
<?php
|
2 |
+
class Company_Shipwa_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
|
7 |
+
$this->loadLayout();
|
8 |
+
$block = $this->getLayout()->createBlock('company_shipwa/shipwa','shipwa');
|
9 |
+
$this->getLayout()->getBlock('content')->append($block);
|
10 |
+
$this->renderLayout();
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
public function showdetailsAction(){
|
15 |
+
|
16 |
+
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
17 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
18 |
+
|
19 |
+
$logindetail= $read->fetchAll("select * from shipway where shipway_id=1");
|
20 |
+
if(count($logindetail)){
|
21 |
+
$username = $logindetail[0]['loginid'];
|
22 |
+
$password = $logindetail[0]['licencekey'];
|
23 |
+
$data['hasAccount'] = true;
|
24 |
+
}
|
25 |
+
else{
|
26 |
+
$username = '';
|
27 |
+
$password = '';
|
28 |
+
$data['hasAccount'] = false;
|
29 |
+
echo "<p style='color:#BA1A1A;font-size:14px;'>Something went wrong.Please inform the website administrator.</p>";die;
|
30 |
+
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
if ($this->getRequest()->getPost()) {
|
36 |
+
$data= $this->getRequest()->getPost();
|
37 |
+
$status_result = '';
|
38 |
+
|
39 |
+
|
40 |
+
if (isset($data['order_id'])) {
|
41 |
+
$increment__id=$data['order_id'];
|
42 |
+
//$order = Mage::getModel('sales/order')->load($order__id);
|
43 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($increment__id);
|
44 |
+
// $order__id=$order->getId();
|
45 |
+
$order__id=$increment__id;
|
46 |
+
foreach ($order->getTracksCollection() as $_track){
|
47 |
+
$track_no=$_track->getNumber();
|
48 |
+
$track_code=$_track->getCarrier_code();
|
49 |
+
$track_title=$_track->getTitle();
|
50 |
+
}
|
51 |
+
if($track_code!='custom'){
|
52 |
+
$courierDetail= $read->fetchAll("select * from shipway_couriermapping where default_courier='".$track_code."'");
|
53 |
+
}else{
|
54 |
+
$courierDetail= $read->fetchAll("select * from shipway_couriermapping where default_courier='".$track_title."'");
|
55 |
+
}
|
56 |
+
if(count($courierDetail)){
|
57 |
+
$shipway_carrier_id= $courierDetail[0]['shipway_courierid'];
|
58 |
+
}else{
|
59 |
+
$shipway_carrier_id= '';
|
60 |
+
}
|
61 |
+
}
|
62 |
+
if (!empty($track_no)) {
|
63 |
+
$awbno = $track_no;
|
64 |
+
$data['awbno'] = $awbno;
|
65 |
+
$data['carrier_name'] = $track_title;
|
66 |
+
|
67 |
+
$courier_id = $shipway_carrier_id;
|
68 |
+
$order_id = $order__id;
|
69 |
+
|
70 |
+
$status_result = $this->getAWBResults($username, $password, $courier_id, $awbno,$order_id);
|
71 |
+
|
72 |
+
$isJson = json_decode($status_result);
|
73 |
+
if(!empty($isJson) && strtolower($isJson->status) == 'failed'){
|
74 |
+
$status_result = "<p style='color:#BA1A1A;font-size:14px;'>Something went wrong.Please inform the website administrator.</p>";
|
75 |
+
}
|
76 |
+
} else {
|
77 |
+
$status_result = 'No tracking number associated with this order';
|
78 |
+
}
|
79 |
+
|
80 |
+
if ($status_result != '') {
|
81 |
+
$data['status_result'] = $status_result;
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
85 |
+
print_r($status_result);
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
public function getAWBResults($username, $password, $carrier_id, $awbno, $order_id)
|
92 |
+
{
|
93 |
+
$url = "http://shipway.in/api/getawbresult";
|
94 |
+
$data_string = array(
|
95 |
+
"username" => $username,
|
96 |
+
"password" => $password,
|
97 |
+
"carrier_id" => $carrier_id,
|
98 |
+
"awb" => $awbno,
|
99 |
+
"order_id" => $order_id
|
100 |
+
);
|
101 |
+
//print_r($data_string);
|
102 |
+
$data_string = json_encode($data_string);
|
103 |
+
$curl = curl_init();
|
104 |
+
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
|
105 |
+
'Content-Type:application/json'
|
106 |
+
));
|
107 |
+
curl_setopt($curl, CURLOPT_URL, $url);
|
108 |
+
curl_setopt($curl, CURLOPT_POST, true);
|
109 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);
|
110 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
111 |
+
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
|
112 |
+
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
113 |
+
$output = curl_exec($curl);
|
114 |
+
curl_close($curl);
|
115 |
+
return $output;
|
116 |
+
|
117 |
+
}
|
118 |
+
}
|
app/code/community/Company/Shipwa/etc/config.xml
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Company_Shipwa>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Company_Shipwa>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<shipwa>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Company_Shipwa</module>
|
14 |
+
<frontName>shipwa</frontName>
|
15 |
+
</args>
|
16 |
+
</shipwa>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<shipwa>
|
21 |
+
<file>shipwa.xml</file>
|
22 |
+
</shipwa>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<shipwa>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Company_Shipwa</module>
|
32 |
+
<frontName>shipwa</frontName>
|
33 |
+
</args>
|
34 |
+
</shipwa>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<menu>
|
39 |
+
<shipwa module="shipwa">
|
40 |
+
<title>Shipway Track</title>
|
41 |
+
<sort_order>71</sort_order>
|
42 |
+
<children>
|
43 |
+
<!--<items module="shipwa">
|
44 |
+
<title>Manage Items</title>
|
45 |
+
<sort_order>0</sort_order>
|
46 |
+
<action>shipwa/adminhtml_shipwa</action>
|
47 |
+
</items>-->
|
48 |
+
<sub_menu1 module="shipwa">
|
49 |
+
<title>Shipway Setting</title>
|
50 |
+
<sort_order>0</sort_order>
|
51 |
+
<action>shipwa/adminhtml_shipwa</action>
|
52 |
+
</sub_menu1>
|
53 |
+
|
54 |
+
<sub_menu2 module="shipwa">
|
55 |
+
<title>Shipway Courier Mapping</title>
|
56 |
+
<sort_order>1</sort_order>
|
57 |
+
<action>shipwa/adminhtml_shipwa/couriermapping</action>
|
58 |
+
</sub_menu2>
|
59 |
+
</children>
|
60 |
+
</shipwa>
|
61 |
+
</menu>
|
62 |
+
<acl>
|
63 |
+
<resources>
|
64 |
+
<all>
|
65 |
+
<title>Allow Everything</title>
|
66 |
+
</all>
|
67 |
+
<admin>
|
68 |
+
<children>
|
69 |
+
<Company_Shipwa>
|
70 |
+
<title>Shipwa Module</title>
|
71 |
+
<sort_order>10</sort_order>
|
72 |
+
</Company_Shipwa>
|
73 |
+
</children>
|
74 |
+
</admin>
|
75 |
+
</resources>
|
76 |
+
</acl>
|
77 |
+
<layout>
|
78 |
+
<updates>
|
79 |
+
<shipwa>
|
80 |
+
<file>shipwa.xml</file>
|
81 |
+
</shipwa>
|
82 |
+
</updates>
|
83 |
+
</layout>
|
84 |
+
</adminhtml>
|
85 |
+
<global>
|
86 |
+
<models>
|
87 |
+
<shipwa>
|
88 |
+
<class>Company_Shipwa_Model</class>
|
89 |
+
<resourceModel>shipwa_mysql4</resourceModel>
|
90 |
+
</shipwa>
|
91 |
+
<shipwa_mysql4>
|
92 |
+
<class>Company_Shipwa_Model_Mysql4</class>
|
93 |
+
<entities>
|
94 |
+
<shipwa>
|
95 |
+
<table>shipwa</table>
|
96 |
+
</shipwa>
|
97 |
+
</entities>
|
98 |
+
</shipwa_mysql4>
|
99 |
+
</models>
|
100 |
+
<resources>
|
101 |
+
<shipwa_setup>
|
102 |
+
<setup>
|
103 |
+
<module>Company_Shipwa</module>
|
104 |
+
</setup>
|
105 |
+
<connection>
|
106 |
+
<use>core_setup</use>
|
107 |
+
</connection>
|
108 |
+
</shipwa_setup>
|
109 |
+
<shipwa_write>
|
110 |
+
<connection>
|
111 |
+
<use>core_write</use>
|
112 |
+
</connection>
|
113 |
+
</shipwa_write>
|
114 |
+
<shipwa_read>
|
115 |
+
<connection>
|
116 |
+
<use>core_read</use>
|
117 |
+
</connection>
|
118 |
+
</shipwa_read>
|
119 |
+
</resources>
|
120 |
+
<blocks>
|
121 |
+
<shipwa>
|
122 |
+
<class>Company_Shipwa_Block</class>
|
123 |
+
</shipwa>
|
124 |
+
</blocks>
|
125 |
+
<helpers>
|
126 |
+
<shipwa>
|
127 |
+
<class>Company_Shipwa_Helper</class>
|
128 |
+
</shipwa>
|
129 |
+
</helpers>
|
130 |
+
|
131 |
+
<models>
|
132 |
+
<sales>
|
133 |
+
<rewrite>
|
134 |
+
<order_shipment>Company_Shipwa_Model_Order_Shipment</order_shipment>
|
135 |
+
</rewrite>
|
136 |
+
</sales>
|
137 |
+
</models>
|
138 |
+
|
139 |
+
|
140 |
+
<models>
|
141 |
+
<sales>
|
142 |
+
<rewrite>
|
143 |
+
<order_shipment_api>Company_Shipwa_Model_Order_Shipment_Api</order_shipment_api>
|
144 |
+
</rewrite>
|
145 |
+
</sales>
|
146 |
+
</models>
|
147 |
+
|
148 |
+
|
149 |
+
</global>
|
150 |
+
</config>
|
app/code/{local/Onj/Shipway/sql/shipway_setup → community/Company/Shipwa/sql/shipwa_setup}/mysql4-install-0.1.0.php
RENAMED
@@ -1,30 +1,35 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$installer = $this;
|
4 |
-
|
5 |
-
$installer->startSetup();
|
6 |
-
|
7 |
-
$installer->run("
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
`
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
`
|
19 |
-
`
|
20 |
-
`
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
(
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
30 |
$installer->endSetup();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
CREATE TABLE IF NOT EXISTS `shipwa` (
|
9 |
+
`shipway_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
10 |
+
`loginid` varchar(255) NOT NULL DEFAULT '',
|
11 |
+
PRIMARY KEY (`shipway_id`)
|
12 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
13 |
+
|
14 |
+
|
15 |
+
CREATE TABLE IF NOT EXISTS `shipway` (
|
16 |
+
`shipway_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
17 |
+
`loginid` varchar(255) NOT NULL DEFAULT '',
|
18 |
+
`licencekey` varchar(255) NOT NULL DEFAULT '',
|
19 |
+
`created_time` timestamp NULL DEFAULT NULL,
|
20 |
+
PRIMARY KEY (`shipway_id`)
|
21 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
22 |
+
|
23 |
+
CREATE TABLE IF NOT EXISTS `shipway_couriermapping` (
|
24 |
+
`id` int(255) NOT NULL,
|
25 |
+
`default_courier` varchar(255) NOT NULL,
|
26 |
+
`shipway_courierid` int(255) NOT NULL,
|
27 |
+
`courier_type` varchar(255) NOT NULL,
|
28 |
+
PRIMARY KEY (`id`)
|
29 |
+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
30 |
+
|
31 |
+
INSERT INTO `shipway` (`shipway_id`, `loginid`, `licencekey`, `created_time`) VALUES
|
32 |
+
(1, '', '', '')
|
33 |
+
");
|
34 |
+
|
35 |
$installer->endSetup();
|
app/code/community/Company/Shipwa/sql/shipwa_setup/upgrade-3.1.5.6-3.2.0.1.php_
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
$connection = $installer->getConnection();
|
5 |
+
|
6 |
+
$installer->startSetup();
|
7 |
+
|
8 |
+
$installer->run("
|
9 |
+
|
10 |
+
CREATE TABLE IF NOT EXISTS `shipwa` (
|
11 |
+
`shipway_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
12 |
+
`loginid` varchar(255) NOT NULL DEFAULT '',
|
13 |
+
PRIMARY KEY (`shipway_id`)
|
14 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
15 |
+
|
16 |
+
|
17 |
+
CREATE TABLE IF NOT EXISTS `shipway` (
|
18 |
+
`shipway_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
19 |
+
`loginid` varchar(255) NOT NULL DEFAULT '',
|
20 |
+
`licencekey` varchar(255) NOT NULL DEFAULT '',
|
21 |
+
`created_time` timestamp NULL DEFAULT NULL,
|
22 |
+
PRIMARY KEY (`shipway_id`)
|
23 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
24 |
+
|
25 |
+
CREATE TABLE IF NOT EXISTS `shipway_couriermapping` (
|
26 |
+
`id` int(255) NOT NULL,
|
27 |
+
`default_courier` varchar(255) NOT NULL,
|
28 |
+
`shipway_courierid` int(255) NOT NULL,
|
29 |
+
`courier_type` varchar(255) NOT NULL,
|
30 |
+
PRIMARY KEY (`id`)
|
31 |
+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
32 |
+
|
33 |
+
INSERT INTO `shipway` (`shipway_id`, `loginid`, `licencekey`, `created_time`) VALUES
|
34 |
+
(1, '', '', '')
|
35 |
+
");
|
36 |
+
|
37 |
+
$installer->endSetup();
|
app/code/local/Onj/Shipway/Block/Adminhtml/Couriermapping.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Onj_Shipway_Block_Adminhtml_Couriermapping extends Mage_Adminhtml_Block_Widget
|
4 |
-
{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
|
9 |
-
|
10 |
-
parent::__construct();
|
11 |
-
$this->setTemplate('shipway/couriermapping.phtml');
|
12 |
-
$this->setFormAction(Mage::getUrl('*/*/savecouriermapp'));
|
13 |
-
|
14 |
-
$this->_controller = 'adminhtml_shipway';
|
15 |
-
$this->_blockGroup = 'shipway';
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
}
|
20 |
-
|
21 |
-
}
|
22 |
-
|
23 |
-
|
24 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Onj/Shipway/Block/Adminhtml/Shipway.php
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Onj_Shipway_Block_Adminhtml_Shipway extends Mage_Adminhtml_Block_Widget
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
|
7 |
-
|
8 |
-
parent::__construct();
|
9 |
-
$this->setTemplate('shipway/shipway.phtml');
|
10 |
-
$this->setFormAction(Mage::getUrl('*/*/showdetails'));
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
$this->_controller = 'adminhtml_shipway';
|
15 |
-
$this->_blockGroup = 'shipway';
|
16 |
-
|
17 |
-
}
|
18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Onj/Shipway/Block/Shipway.php
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Onj_Shipway_Block_Shipway extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
protected function _prepareLayout()
|
5 |
-
{
|
6 |
-
$this->setFormAction(Mage::getUrl('*/*/showdetails'));
|
7 |
-
return parent::_prepareLayout();
|
8 |
-
}
|
9 |
-
|
10 |
-
|
11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Onj/Shipway/Helper/Data.php
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Onj_Shipway_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
-
{
|
5 |
-
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Onj/Shipway/Model/Mysql4/Shipway.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Onj_Shipway_Model_Mysql4_Shipway extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
// Note that the shipway_id refers to the key field in your database table.
|
8 |
-
$this->_init('shipway/shipway', 'shipway_id');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Onj/Shipway/Model/Mysql4/Shipway/Collection.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Onj_Shipway_Model_Mysql4_Shipway_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('shipway/shipway');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Onj/Shipway/Model/Shipway.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Onj_Shipway_Model_Shipway extends Mage_Core_Model_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('shipway/shipway_order');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Onj/Shipway/Model/Status.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Onj_Shipway_Model_Status extends Varien_Object
|
4 |
-
{
|
5 |
-
const STATUS_ENABLED = 1;
|
6 |
-
const STATUS_DISABLED = 2;
|
7 |
-
|
8 |
-
static public function getOptionArray()
|
9 |
-
{
|
10 |
-
return array(
|
11 |
-
self::STATUS_ENABLED => Mage::helper('shipway')->__('Enabled'),
|
12 |
-
self::STATUS_DISABLED => Mage::helper('shipway')->__('Disabled')
|
13 |
-
);
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Onj/Shipway/etc/config.xml
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Onj_Shipway>
|
5 |
-
<version>0.1.0</version>
|
6 |
-
</Onj_Shipway>
|
7 |
-
</modules>
|
8 |
-
<frontend>
|
9 |
-
<routers>
|
10 |
-
<shipway>
|
11 |
-
<use>standard</use>
|
12 |
-
<args>
|
13 |
-
<module>Onj_Shipway</module>
|
14 |
-
<frontName>shipway</frontName>
|
15 |
-
</args>
|
16 |
-
</shipway>
|
17 |
-
</routers>
|
18 |
-
<layout>
|
19 |
-
<updates>
|
20 |
-
<shipway>
|
21 |
-
<file>shipway.xml</file>
|
22 |
-
</shipway>
|
23 |
-
</updates>
|
24 |
-
</layout>
|
25 |
-
</frontend>
|
26 |
-
<admin>
|
27 |
-
<routers>
|
28 |
-
<shipway>
|
29 |
-
<use>admin</use>
|
30 |
-
<args>
|
31 |
-
<module>Onj_Shipway</module>
|
32 |
-
<frontName>shipway</frontName>
|
33 |
-
</args>
|
34 |
-
</shipway>
|
35 |
-
</routers>
|
36 |
-
</admin>
|
37 |
-
<adminhtml>
|
38 |
-
<menu>
|
39 |
-
<shipway module="shipway">
|
40 |
-
<title>Shipway Track</title>
|
41 |
-
<sort_order>71</sort_order>
|
42 |
-
<children>
|
43 |
-
<sub_menu1 module="shipway">
|
44 |
-
<title>Shipway Setting</title>
|
45 |
-
<sort_order>0</sort_order>
|
46 |
-
<action>shipway/adminhtml_shipway</action>
|
47 |
-
</sub_menu1>
|
48 |
-
|
49 |
-
<sub_menu2 module="shipway">
|
50 |
-
<title>Shipway Courier Mapping</title>
|
51 |
-
<sort_order>1</sort_order>
|
52 |
-
<action>shipway/adminhtml_shipway/couriermapping</action>
|
53 |
-
</sub_menu2>
|
54 |
-
</children>
|
55 |
-
</shipway>
|
56 |
-
</menu>
|
57 |
-
<acl>
|
58 |
-
<resources>
|
59 |
-
<all>
|
60 |
-
<title>Allow Everything</title>
|
61 |
-
</all>
|
62 |
-
<admin>
|
63 |
-
<children>
|
64 |
-
<Onj_Shipway>
|
65 |
-
<title>Shipway Module</title>
|
66 |
-
<sort_order>10</sort_order>
|
67 |
-
</Onj_Shipway>
|
68 |
-
</children>
|
69 |
-
</admin>
|
70 |
-
</resources>
|
71 |
-
</acl>
|
72 |
-
<layout>
|
73 |
-
<updates>
|
74 |
-
<shipway>
|
75 |
-
<file>shipway.xml</file>
|
76 |
-
</shipway>
|
77 |
-
</updates>
|
78 |
-
</layout>
|
79 |
-
</adminhtml>
|
80 |
-
<global>
|
81 |
-
<models>
|
82 |
-
<shipway>
|
83 |
-
<class>Onj_Shipway_Model</class>
|
84 |
-
<resourceModel>shipway_mysql4</resourceModel>
|
85 |
-
</shipway>
|
86 |
-
<shipway_mysql4>
|
87 |
-
<class>Onj_Shipway_Model_Mysql4</class>
|
88 |
-
<entities>
|
89 |
-
<shipway>
|
90 |
-
<table>shipway</table>
|
91 |
-
</shipway>
|
92 |
-
</entities>
|
93 |
-
</shipway_mysql4>
|
94 |
-
</models>
|
95 |
-
<resources>
|
96 |
-
<shipway_setup>
|
97 |
-
<setup>
|
98 |
-
<module>Onj_Shipway</module>
|
99 |
-
</setup>
|
100 |
-
<connection>
|
101 |
-
<use>core_setup</use>
|
102 |
-
</connection>
|
103 |
-
</shipway_setup>
|
104 |
-
<shipway_write>
|
105 |
-
<connection>
|
106 |
-
<use>core_write</use>
|
107 |
-
</connection>
|
108 |
-
</shipway_write>
|
109 |
-
<shipway_read>
|
110 |
-
<connection>
|
111 |
-
<use>core_read</use>
|
112 |
-
</connection>
|
113 |
-
</shipway_read>
|
114 |
-
</resources>
|
115 |
-
<blocks>
|
116 |
-
<shipway>
|
117 |
-
<class>Onj_Shipway_Block</class>
|
118 |
-
</shipway>
|
119 |
-
</blocks>
|
120 |
-
<helpers>
|
121 |
-
<shipway>
|
122 |
-
<class>Onj_Shipway_Helper</class>
|
123 |
-
</shipway>
|
124 |
-
</helpers>
|
125 |
-
|
126 |
-
|
127 |
-
<models>
|
128 |
-
<sales>
|
129 |
-
<rewrite>
|
130 |
-
<order_shipment>Onj_Shipway_Model_Order_Shipment</order_shipment>
|
131 |
-
</rewrite>
|
132 |
-
</sales>
|
133 |
-
</models>
|
134 |
-
|
135 |
-
|
136 |
-
<models>
|
137 |
-
<sales>
|
138 |
-
<rewrite>
|
139 |
-
<order_shipment_api>Onj_Shipway_Model_Order_Shipment_Api</order_shipment_api>
|
140 |
-
</rewrite>
|
141 |
-
</sales>
|
142 |
-
</models>
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
</global>
|
147 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/layout/shipwa.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--<layout version="0.1.0">
|
3 |
+
<shipwa_adminhtml_shipwa_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="shipwa/adminhtml_shipwa" name="shipwa" />
|
6 |
+
</reference>
|
7 |
+
</shipwa_adminhtml_shipwa_index>
|
8 |
+
|
9 |
+
|
10 |
+
</layout> -->
|
11 |
+
|
12 |
+
<layout version="0.1.0">
|
13 |
+
<adminhtml_sales_order_shipment_addtrack>
|
14 |
+
<reference name="content">
|
15 |
+
<block type="adminhtml/sales_order_shipment_view_tracking" name="shipment_tracking" >
|
16 |
+
<action method="setTemplate">
|
17 |
+
<template>shipwa/tracking.phtml</template>
|
18 |
+
</action>
|
19 |
+
|
20 |
+
</block>
|
21 |
+
</reference>
|
22 |
+
|
23 |
+
</adminhtml_sales_order_shipment_addtrack>
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
<shipwa_adminhtml_shipwa_index>
|
29 |
+
<reference name="content">
|
30 |
+
<block type="shipwa/adminhtml_shipwa" name="shipwa" template="shipwa/shipwa.phtml" />
|
31 |
+
</reference>
|
32 |
+
</shipwa_adminhtml_shipwa_index>
|
33 |
+
|
34 |
+
<shipwa_adminhtml_shipwa_couriermapping>
|
35 |
+
<reference name="content">
|
36 |
+
<block type="shipwa/adminhtml_couriermapping" name="couriermapp" template="shipwa/couriermapping.phtml"></block>
|
37 |
+
|
38 |
+
</reference>
|
39 |
+
|
40 |
+
</shipwa_adminhtml_shipwa_couriermapping>
|
41 |
+
|
42 |
+
</layout>
|
app/design/adminhtml/default/default/layout/shipway.xml
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
<adminhtml_sales_order_shipment_addtrack>
|
4 |
-
<reference name="content">
|
5 |
-
<block type="adminhtml/sales_order_shipment_view_tracking" name="shipment_tracking" >
|
6 |
-
<action method="setTemplate">
|
7 |
-
<template>shipway/tracking.phtml</template>
|
8 |
-
</action>
|
9 |
-
|
10 |
-
</block>
|
11 |
-
</reference>
|
12 |
-
|
13 |
-
</adminhtml_sales_order_shipment_addtrack>
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
<shipway_adminhtml_shipway_index>
|
19 |
-
<reference name="content">
|
20 |
-
<block type="shipway/adminhtml_shipway" name="shipway" template="shipway/shipway.phtml" />
|
21 |
-
</reference>
|
22 |
-
</shipway_adminhtml_shipway_index>
|
23 |
-
|
24 |
-
<shipway_adminhtml_shipway_couriermapping>
|
25 |
-
<reference name="content">
|
26 |
-
<block type="shipway/adminhtml_couriermapping" name="couriermapp" template="shipway/couriermapping.phtml"></block>
|
27 |
-
|
28 |
-
</reference>
|
29 |
-
|
30 |
-
</shipway_adminhtml_shipway_couriermapping>
|
31 |
-
|
32 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/shipwa/couriermapping.phtml
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
|
1 |
$carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers( );
|
2 |
//$carriers['custom'] = Mage::helper('sales')->__('Custom Value');
|
3 |
foreach ($carrierInstances as $code => $carrier) {
|
4 |
if ($carrier->isTrackingAvailable()) {
|
5 |
$carriers_title = $carrier->getConfigData('title');
|
6 |
}
|
7 |
}
|
8 |
<table cellspacing="0">
|
9 |
<?php } ?>
|
1 |
+
<?php
|
2 |
|
3 |
$carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers( );
|
4 |
//$carriers['custom'] = Mage::helper('sales')->__('Custom Value');
|
5 |
foreach ($carrierInstances as $code => $carrier) {
|
6 |
if ($carrier->isTrackingAvailable()) {
|
7 |
$carriers_title = $carrier->getConfigData('title');
|
8 |
}
|
9 |
}
|
10 |
<table cellspacing="0">
|
11 |
<?php } ?>
|
app/design/adminhtml/default/default/template/{shipway/shipway.phtml → shipwa/shipwa.phtml}
RENAMED
@@ -61,8 +61,6 @@ $shipway_licencekey= '';
|
|
61 |
<script>
|
62 |
|
63 |
function checkvalue(){
|
64 |
-
|
65 |
-
alert("hello");
|
66 |
//var login=$( "#loginid").val();
|
67 |
var login=document.getElementById("loginid").value;
|
68 |
var licencekey=document.getElementById("licencekey").value;
|
61 |
<script>
|
62 |
|
63 |
function checkvalue(){
|
|
|
|
|
64 |
//var login=$( "#loginid").val();
|
65 |
var login=document.getElementById("loginid").value;
|
66 |
var licencekey=document.getElementById("licencekey").value;
|
app/design/adminhtml/default/default/template/{shipway → shipwa}/tracking.phtml
RENAMED
@@ -1,92 +1,91 @@
|
|
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@magento.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.magento.com for more information.
|
20 |
-
*
|
21 |
-
* @category design
|
22 |
-
* @package default_default
|
23 |
-
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
24 |
-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
-
*/
|
26 |
-
?>
|
27 |
-
<?php /** @var $this Mage_Adminhtml_Block_Sales_Order_Shipment_View_Tracking */ ?>
|
28 |
-
<div class="field-row grid" id="shipment_tracking_info">
|
29 |
-
<table cellspacing="0" class="data">
|
30 |
-
<col width="100" />
|
31 |
-
<col />
|
32 |
-
<col />
|
33 |
-
<col width="80" />
|
34 |
-
<thead>
|
35 |
-
<tr class="headings">
|
36 |
-
<th><?php echo Mage::helper('sales')->__('Carrier') ?></th>
|
37 |
-
<th><?php echo Mage::helper('sales')->__('Title') ?></th>
|
38 |
-
<th><?php echo Mage::helper('sales')->__('Number') ?></th>
|
39 |
-
<th class="last"><?php echo Mage::helper('sales')->__('Action') ?></th>
|
40 |
-
</tr>
|
41 |
-
</thead>
|
42 |
-
<tfoot>
|
43 |
-
<tr>
|
44 |
-
<td>
|
45 |
-
<select name="carrier" class="select" style="width:110px" onchange="selectCarrier(this)">
|
46 |
-
<?php foreach ($this->getCarriers() as $_code=>$_name): ?>
|
47 |
-
<option value="<?php echo $_code ?>"><?php echo $this->escapeHtml($_name) ?></option>
|
48 |
-
<?php endforeach; ?>
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
<td><input class="input-text" type="text" id="
|
54 |
-
<td
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
<td><?php echo $this->escapeHtml($
|
63 |
-
<td
|
64 |
-
|
65 |
-
<?php
|
66 |
-
<?php
|
67 |
-
<?php
|
68 |
-
<
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
</
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
</script>
|
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@magento.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.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php /** @var $this Mage_Adminhtml_Block_Sales_Order_Shipment_View_Tracking */ ?>
|
28 |
+
<div class="field-row grid" id="shipment_tracking_info">
|
29 |
+
<table cellspacing="0" class="data">
|
30 |
+
<col width="100" />
|
31 |
+
<col />
|
32 |
+
<col />
|
33 |
+
<col width="80" />
|
34 |
+
<thead>
|
35 |
+
<tr class="headings">
|
36 |
+
<th><?php echo Mage::helper('sales')->__('Carrier') ?></th>
|
37 |
+
<th><?php echo Mage::helper('sales')->__('Title') ?></th>
|
38 |
+
<th><?php echo Mage::helper('sales')->__('Number') ?></th>
|
39 |
+
<th class="last"><?php echo Mage::helper('sales')->__('Action') ?></th>
|
40 |
+
</tr>
|
41 |
+
</thead>
|
42 |
+
<tfoot>
|
43 |
+
<tr>
|
44 |
+
<td>
|
45 |
+
<select name="carrier" class="select" style="width:110px" onchange="selectCarrier(this)">
|
46 |
+
<?php foreach ($this->getCarriers() as $_code=>$_name): ?>
|
47 |
+
<option value="<?php echo $_code ?>"><?php echo $this->escapeHtml($_name) ?></option>
|
48 |
+
<?php endforeach; ?>
|
49 |
+
|
50 |
+
</select>
|
51 |
+
</td>
|
52 |
+
<td><input class="input-text" type="text" id="tracking_title" name="title" value="" /></td>
|
53 |
+
<td><input class="input-text" type="text" id="tracking_number" name="number" value="" /></td>
|
54 |
+
<td class="last"><?php echo $this->getSaveButtonHtml() ?></td>
|
55 |
+
</tr>
|
56 |
+
</tfoot>
|
57 |
+
<?php if($_tracks = $this->getShipment()->getAllTracks()): ?>
|
58 |
+
<tbody>
|
59 |
+
<?php $i=0;foreach ($_tracks as $_track):$i++ ?>
|
60 |
+
<tr class="<?php echo ($i%2==0)?'even':'odd' ?>">
|
61 |
+
<td><?php echo $this->escapeHtml($this->getCarrierTitle($_track->getCarrierCode())) ?></td>
|
62 |
+
<td><?php echo $this->escapeHtml($_track->getTitle()) ?></td>
|
63 |
+
<td>
|
64 |
+
<?php if ($_track->isCustom()): ?>
|
65 |
+
<?php echo $this->escapeHtml($_track->getNumber()) ?>
|
66 |
+
<?php else: ?>
|
67 |
+
<a href="#" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_track) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')"><?php echo $this->escapeHtml($_track->getNumber()) ?></a>
|
68 |
+
<div id="shipment_tracking_info_response_<?php echo $_track->getId() ?>"></div>
|
69 |
+
<?php endif; ?>
|
70 |
+
</td>
|
71 |
+
<td class="last"><a href="#" onclick="deleteTrackingNumber('<?php echo $this->getRemoveUrl($_track) ?>'); return false;"><?php echo Mage::helper('sales')->__('Delete') ?></a></td>
|
72 |
+
</tr>
|
73 |
+
<?php endforeach; ?>
|
74 |
+
</tbody>
|
75 |
+
<?php endif; ?>
|
76 |
+
</table>
|
77 |
+
</div>
|
78 |
+
<script type="text/javascript">
|
79 |
+
//<![CDATA[
|
80 |
+
function selectCarrier(elem) {
|
81 |
+
var option = elem.options[elem.selectedIndex];
|
82 |
+
$('tracking_title').value = option.value && option.value != 'custom' ? option.text : '';
|
83 |
+
}
|
84 |
+
|
85 |
+
function deleteTrackingNumber(url) {
|
86 |
+
if (confirm('<?php echo Mage::helper('sales')->__('Are you sure?') ?>')) {
|
87 |
+
submitAndReloadArea($('shipment_tracking_info').parentNode, url)
|
88 |
+
}
|
89 |
+
}
|
90 |
+
//]]>
|
91 |
+
</script>
|
|
app/design/adminhtml/default/default/template/shipway/couriermapping.phtml
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
3 |
-
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
4 |
-
|
5 |
-
$logindetail= $read->fetchAll("select * from shipway where shipway_id=1");
|
6 |
-
$couriermap= $read->fetchAll("select * from shipway_couriermapping ");
|
7 |
-
$customecouriermap= $read->fetchAll("select * from shipway_couriermapping where courier_type='custom' ");
|
8 |
-
/* echo '<pre>';
|
9 |
-
print_r($customecouriermap);
|
10 |
-
echo '</pre>'; */
|
11 |
-
if(count($logindetail)){
|
12 |
-
|
13 |
-
$shipway_loginid= $logindetail[0]['loginid'];
|
14 |
-
$shipway_licencekey= $logindetail[0]['licencekey'];
|
15 |
-
}
|
16 |
-
else{
|
17 |
-
$shipway_loginid= '';
|
18 |
-
$shipway_licencekey= '';
|
19 |
-
}
|
20 |
-
|
21 |
-
?>
|
22 |
-
<?php
|
23 |
-
$options = array();
|
24 |
-
$carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers( );
|
25 |
-
//$carriers['custom'] = Mage::helper('sales')->__('Custom Value');
|
26 |
-
foreach ($carrierInstances as $code => $carrier) {
|
27 |
-
if ($carrier->isTrackingAvailable()) {
|
28 |
-
$carriers_title = $carrier->getConfigData('title');
|
29 |
-
$options[] = array('value' => $code, 'label' => $carriers_title );
|
30 |
-
}
|
31 |
-
}
|
32 |
-
$url = "http://shipway.in/api/getcarrier";
|
33 |
-
$data_string = array(
|
34 |
-
"username" => $shipway_loginid,
|
35 |
-
"password" => $shipway_licencekey
|
36 |
-
);
|
37 |
-
|
38 |
-
$data_string = json_encode($data_string);
|
39 |
-
$curl = curl_init();
|
40 |
-
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
|
41 |
-
'Content-Type:application/json'
|
42 |
-
));
|
43 |
-
curl_setopt($curl, CURLOPT_URL, $url);
|
44 |
-
curl_setopt($curl, CURLOPT_POST, true);
|
45 |
-
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);
|
46 |
-
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
47 |
-
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
|
48 |
-
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
49 |
-
$output = curl_exec($curl);
|
50 |
-
|
51 |
-
curl_close($curl);
|
52 |
-
$output = (array)json_decode($output);
|
53 |
-
|
54 |
-
?>
|
55 |
-
|
56 |
-
<form action="<?php echo $this->getFormAction().'key/'.$this->getFormKey(); ?>" method="POST">
|
57 |
-
<div class="content-header">
|
58 |
-
<table cellspacing="0">
|
59 |
-
<tbody>
|
60 |
-
<tr>
|
61 |
-
<td style="width:50%;"><h3 class="icon-head head-sales-order">Shipway Courier Mapping</h3></td>
|
62 |
-
<td class="form-buttons"><button class="scalable" onclick="<?php echo $this->getFormAction(); ?>">Save Mapping</button></td>
|
63 |
-
</tr>
|
64 |
-
</tbody>
|
65 |
-
</table>
|
66 |
-
</div>
|
67 |
-
|
68 |
-
<div class="grid">
|
69 |
-
<h2>Shipway Courier Mapping</h2> <br>
|
70 |
-
<input type="hidden" name="form_key" value="<?php echo $this->getFormKey(); ?>" />
|
71 |
-
|
72 |
-
<table style=" width: 40%; float: left;" id="myTable">
|
73 |
-
<tr>
|
74 |
-
<th>Courier Name</th><th>Shipway Courier</th>
|
75 |
-
</tr>
|
76 |
-
<?php foreach($options as $key1 => $value){ ?>
|
77 |
-
<tr>
|
78 |
-
<td><?php echo $options[$key1]['label']?></td>
|
79 |
-
<td>
|
80 |
-
<select name="shipway[<?php echo $options[$key1]['value']?>]">
|
81 |
-
<option value="">Select courier</option>
|
82 |
-
<?php foreach($output as $key => $carrier_name){?>
|
83 |
-
<option value="<?php echo $key; ?>" <?php if($couriermap[$key1]['shipway_courierid']==$key){echo "selected";}?>><?php echo ucfirst($carrier_name);?></option>
|
84 |
-
<?php } ?>
|
85 |
-
</select>
|
86 |
-
</td>
|
87 |
-
</tr>
|
88 |
-
<?php } ?>
|
89 |
-
<?php foreach($customecouriermap as $key1 => $value){ ?>
|
90 |
-
<tr>
|
91 |
-
<td><input type="text" name="shipway_customcourier_name[]" value="<?php echo $customecouriermap[$key1]['default_courier']?>"></td>
|
92 |
-
<td>
|
93 |
-
<select name="shipway_courier_id[]">
|
94 |
-
<option value="">Select courier</option>
|
95 |
-
<?php foreach($output as $key => $carrier_name){?>
|
96 |
-
<option value="<?php echo $key; ?>" <?php if($customecouriermap[$key1]['shipway_courierid']==$key){echo "selected";}?>><?php echo ucfirst($carrier_name);?></option>
|
97 |
-
<?php } ?>
|
98 |
-
</select>
|
99 |
-
</td>
|
100 |
-
</tr>
|
101 |
-
<?php } ?>
|
102 |
-
</table>
|
103 |
-
</div>
|
104 |
-
<div style="clear:both;"></div>
|
105 |
-
<div style="margin-top:20px; margin-left: 30%;"><input type="button" class="addCF" onclick="addcustomcourier();" value="Add Custom Courier" ></div>
|
106 |
-
</form>
|
107 |
-
<script>
|
108 |
-
function addcustomcourier(){
|
109 |
-
|
110 |
-
//$('#myTable').append('<tr><td>my data</td><td>more data</td></tr>');
|
111 |
-
var table = document.getElementById("myTable");
|
112 |
-
|
113 |
-
// Create an empty <tr> element and add it to the 1st position of the table:
|
114 |
-
var row = table.insertRow(-1);
|
115 |
-
|
116 |
-
// Insert new cells (<td> elements) at the 1st and 2nd position of the "new" <tr> element:
|
117 |
-
var cell1 = row.insertCell(0);
|
118 |
-
var cell2 = row.insertCell(1);
|
119 |
-
|
120 |
-
// Add some text to the new cells:
|
121 |
-
cell1.innerHTML = "<input type='text' placeholder='custom courier' name='shipway_customcourier_name[]'>";
|
122 |
-
var html="";
|
123 |
-
html+='<select name="shipway_courier_id[]">';
|
124 |
-
<?php foreach ($output as $key=> $carrier_name) { ?>
|
125 |
-
html += '<option value="<?php echo $key; ?>"><?php echo ucfirst($carrier_name);?></option>';
|
126 |
-
<?php } ?>
|
127 |
-
html+='</select>';
|
128 |
-
cell2.innerHTML = html;
|
129 |
-
}
|
130 |
-
|
131 |
-
</script>
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/layout/shipwa.xml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<!-- <shipwa_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="shipwa/shipwa" name="shipwa" template="shipwa/shipwa.phtml" />
|
8 |
+
</reference>
|
9 |
+
</shipwa_index_index> -->
|
10 |
+
|
11 |
+
<shipwa_index_index>
|
12 |
+
<reference name="content">
|
13 |
+
<block type="shipwa/shipwa" name="shipway1" template="shipwa/trackorder.phtml"/>
|
14 |
+
</reference>
|
15 |
+
</shipwa_index_index>
|
16 |
+
<default>
|
17 |
+
<reference name="top.links">
|
18 |
+
<block type="shipwa/links" name="shipwa_link" />
|
19 |
+
<action method="addLinkBlock"><blockName>shipwa_link</blockName></action>
|
20 |
+
</reference>
|
21 |
+
|
22 |
+
<reference name="footer_links">
|
23 |
+
<action method="addLink" translate="label title" module="shipwa" >
|
24 |
+
<label>Track Order</label>
|
25 |
+
<url>shipwa/index/index</url>
|
26 |
+
<title>Contact Us</title>
|
27 |
+
<prepare>true</prepare>
|
28 |
+
</action>
|
29 |
+
</reference>
|
30 |
+
</default>
|
31 |
+
</layout>
|
app/design/frontend/base/default/layout/shipway.xml
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<layout version="0.1.0">
|
2 |
-
|
3 |
-
<shipway_shipway_trackorder>
|
4 |
-
<reference name="content">
|
5 |
-
<block type="shipway/shipway" name="shipway1" template="shipway/trackorder.phtml"/>
|
6 |
-
</reference>
|
7 |
-
</shipway_shipway_trackorder>
|
8 |
-
<default>
|
9 |
-
<reference name="top.links">
|
10 |
-
<block type="shipway/links" name="shipway_link" />
|
11 |
-
<action method="addLinkBlock"><blockName>shipway_link</blockName></action>
|
12 |
-
</reference>
|
13 |
-
|
14 |
-
<reference name="footer_links">
|
15 |
-
<action method="addLink" translate="label title" module="shipway" >
|
16 |
-
<label>Track Order</label>
|
17 |
-
<url>shipway/shipway/trackorder</url>
|
18 |
-
<title>Contact Us</title>
|
19 |
-
<prepare>true</prepare>
|
20 |
-
</action>
|
21 |
-
</reference>
|
22 |
-
</default>
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/shipwa/trackorder.phtml
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$url = $this->getFormAction();
|
3 |
+
|
4 |
+
?>
|
5 |
+
<style>
|
6 |
+
.col3-layout .col-wrapper .col-main{
|
7 |
+
float:left!important;
|
8 |
+
}
|
9 |
+
</style>
|
10 |
+
<script type="text/javascript">
|
11 |
+
|
12 |
+
// Please add jquery library if it is not included in your Magento.
|
13 |
+
|
14 |
+
jQuery.noConflict();
|
15 |
+
jQuery(document).ready(function(){
|
16 |
+
jQuery('#submit_cod').click(function(){
|
17 |
+
jQuery(".pin-loading").show();
|
18 |
+
var postcode = jQuery('#order_id').val();
|
19 |
+
if(postcode != ''){
|
20 |
+
jQuery.ajax({
|
21 |
+
url: "<?php echo $url; ?>",
|
22 |
+
type: "POST",
|
23 |
+
data: {order_id : postcode,submit_cod:'submit_cod'},
|
24 |
+
dataType: "html",
|
25 |
+
success:function(data){
|
26 |
+
jQuery('#result').html(data);
|
27 |
+
}
|
28 |
+
});
|
29 |
+
}
|
30 |
+
else{
|
31 |
+
alert("Please enter a valid Order Id");
|
32 |
+
}
|
33 |
+
});});
|
34 |
+
</script>
|
35 |
+
|
36 |
+
<div class="breadcrumbs">
|
37 |
+
<ul>
|
38 |
+
<li class="home">
|
39 |
+
<a href="<?php echo Mage::getBaseUrl() ;?>" title="Go to Home Page">Home</a>
|
40 |
+
<span>/ </span>
|
41 |
+
</li>
|
42 |
+
<li class="cms_page">
|
43 |
+
<strong>Track order</strong>
|
44 |
+
</li>
|
45 |
+
</ul>
|
46 |
+
</div>
|
47 |
+
<div id="shipway_track_wrapper">
|
48 |
+
<form id="form" method="post" style="margin:0 auto;" >
|
49 |
+
<!-- <fieldset>
|
50 |
+
<div class="std"> <h1>Track Your Shipment Status</h1></div><br>
|
51 |
+
<p><b>Order ID: </b><input type="text" name="order_id" id="order_id" value="">
|
52 |
+
<input type="button" id="submit_cod" class="button" value="Track" name="btnSubmit"></p>
|
53 |
+
</fieldset> -->
|
54 |
+
<fieldset style="
|
55 |
+
">
|
56 |
+
<div class="std"> <h1>Track Your Shipment Status</h1></div><br>
|
57 |
+
<p><b>Order ID: </b><input type="text" name="order_id" id="order_id" value="" style="
|
58 |
+
padding: 4px;
|
59 |
+
">
|
60 |
+
<input type="button" id="submit_cod" class="button" value="Track" name="btnSubmit" style="
|
61 |
+
line-height: 26px;
|
62 |
+
padding: 0 20px; color: #fff; background: #6bc59a; };
|
63 |
+
"></p>
|
64 |
+
</fieldset>
|
65 |
+
</form>
|
66 |
+
</div>
|
67 |
+
</br>
|
68 |
+
<span id="result"></span>
|
app/design/frontend/base/default/template/shipway/trackorder.phtml
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
|
2 |
-
<?php
|
3 |
-
$url = $this->getFormAction();
|
4 |
-
|
5 |
-
?>
|
6 |
-
<script type="text/javascript">
|
7 |
-
|
8 |
-
// Please add jquery library if it is not included in your Magento.
|
9 |
-
|
10 |
-
jQuery.noConflict();
|
11 |
-
jQuery(document).ready(function(){
|
12 |
-
jQuery('#submit_cod').click(function(){
|
13 |
-
jQuery(".pin-loading").show();
|
14 |
-
var postcode = jQuery('#order_id').val();
|
15 |
-
if(postcode != ''){
|
16 |
-
jQuery.ajax({
|
17 |
-
url: "<?php echo $url; ?>",
|
18 |
-
type: "POST",
|
19 |
-
data: {order_id : postcode,submit_cod:'submit_cod'},
|
20 |
-
dataType: "html",
|
21 |
-
success:function(data){
|
22 |
-
jQuery('#result').html(data);
|
23 |
-
}
|
24 |
-
});
|
25 |
-
}
|
26 |
-
else{
|
27 |
-
alert("Please enter a valid Order Id");
|
28 |
-
}
|
29 |
-
});});
|
30 |
-
</script>
|
31 |
-
|
32 |
-
|
33 |
-
<div id="shipway_track_wrapper" style=" text-align: center;" >
|
34 |
-
<form id="form" method="post" style="margin:0 auto;" >
|
35 |
-
<fieldset>
|
36 |
-
<h2 style=" font-size: 18px;">Track Your Shipment Status</h2><br>
|
37 |
-
<p><b>Order ID: </b><input type="text" name="order_id" id="order_id" value="">
|
38 |
-
<input type="button" id="submit_cod" value="Track" name="btnSubmit"></p>
|
39 |
-
</fieldset>
|
40 |
-
</form>
|
41 |
-
</div>
|
42 |
-
</br>
|
43 |
-
<span id="result"></span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Company_Shipwa.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Company_Shipwa>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Company_Shipwa>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/etc/modules/Onj_Shipway.xml
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Onj_Shipway>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>local</codePool>
|
7 |
-
</Onj_Shipway>
|
8 |
-
</modules>
|
9 |
-
</config>
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>bebe68374a49cb41b7c9219e97250044</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl-2.0.html">bebe68374a49cb41b7c9219e97250044</license>
|
7 |
<channel>community</channel>
|
@@ -19,9 +19,9 @@
|
|
19 |
* Track complete shipping status from confirm order to order delivery
|
20 |
* Shows shipment realtime status details.</notes>
|
21 |
<authors><author><name>Onjection</name><user>MAG003087332</user><email>contact@onjection.com</email></author></authors>
|
22 |
-
<date>2015-
|
23 |
-
<time>
|
24 |
-
<contents><target name="
|
25 |
<compatible/>
|
26 |
-
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php
|
27 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>bebe68374a49cb41b7c9219e97250044</name>
|
4 |
+
<version>1.2.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl-2.0.html">bebe68374a49cb41b7c9219e97250044</license>
|
7 |
<channel>community</channel>
|
19 |
* Track complete shipping status from confirm order to order delivery
|
20 |
* Shows shipment realtime status details.</notes>
|
21 |
<authors><author><name>Onjection</name><user>MAG003087332</user><email>contact@onjection.com</email></author></authors>
|
22 |
+
<date>2015-09-02</date>
|
23 |
+
<time>07:05:38</time>
|
24 |
+
<contents><target name="magecommunity"><dir name="Company"><dir name="Shipwa"><dir name="Block"><dir name="Adminhtml"><file name="Couriermapping.php" hash="0e9e80a88c818a0e94d4a4319e781924"/><file name="Shipwa.php" hash="56311b36ddad063101e781aa07ccea04"/></dir><file name="Links.php" hash="a7dfa030bc0fe183a23b0287c170becb"/><file name="Shipwa.php" hash="016d0cb15f230986fa7aa1914086e99a"/></dir><dir name="Helper"><file name="Data.php" hash="31da429ad650b742946a14ac4ea89e9e"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Shipwa"><file name="Collection.php" hash="5e701a8d637061922180d4ccf0492a08"/></dir><file name="Shipwa.php" hash="91605c25c9e8a6d1a44c2462427a2926"/></dir><dir name="Order"><dir name="Shipment"><file name="Api.php" hash="4474a6d9ba04e4d8d4038b79c78bccbb"/></dir><file name="Shipment.php" hash="d75eddc7a80fa3aa31271c7639ed2c76"/></dir><file name="Shipwa.php" hash="4abd712f83f6a3a925263b1e7882ed23"/><file name="Status.php" hash="17d8312147c6ad3fb198bd04883b41bb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShipwaController.php" hash="2bd7e8bd754afa001952ce4dc45d6097"/><file name="ShipwaController_1.php" hash="019f7f816a159874df6143f9fa93b141"/></dir><file name="IndexController.php" hash="1bc73e04fc38ece4fa05c37224b35281"/></dir><dir name="etc"><file name="config.xml" hash="7aece3508bd28d05d4ee4527e1a15a58"/></dir><dir name="sql"><dir name="shipwa_setup"><file name="mysql4-install-0.1.0.php" hash="44cb81e008e546855c58e002b717c9f3"/><file name="upgrade-3.1.5.6-3.2.0.1.php_" hash="f396b2a8dbb8e299653a840cb8a40fb2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="shipwa.xml" hash="d749f4133bb3f889d93127fa077a9ae0"/></dir><dir name="template"><dir name="shipwa"><file name="couriermapping.phtml" hash="af79957c530b70069577845f1ffb69a6"/><file name="shipwa.phtml" hash="321be0d8644e6065c69a9e1f4a2c9812"/><file name="tracking.phtml" hash="5ad534b830aef506e31697d0b15c4162"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="shipwa"><file name="trackorder.phtml" hash="977fe9301d5991a2748a08e71ed927b9"/></dir></dir><dir name="layout"><file name="shipwa.xml" hash="3ca444d3e6782924b70ae009871d9578"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Company_Shipwa.xml" hash="98f3ddaf12884000de7c1773eb3e3d02"/></dir></target></contents>
|
25 |
<compatible/>
|
26 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
27 |
</package>
|