ship200_onebyone - Version 1.0.0

Version Notes

nothing

Download this release

Release Info

Developer Ship200
Extension ship200_onebyone
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Ship200/Onebyone/Block/Adminhtml/Sales/Order/View.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ship200_Onebyone_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View{
4
+
5
+
6
+
7
+ public function __construct()
8
+
9
+ {
10
+
11
+ parent::__construct();
12
+
13
+
14
+
15
+ $this->_addButton('pdf_label', array(
16
+
17
+ 'label' => Mage::helper('sales')->__('Make Return PDF Label'),
18
+
19
+ 'onclick' => 'open_ship200_return();;',
20
+
21
+ 'class' => 'btn grey return',
22
+
23
+ ));
24
+
25
+
26
+
27
+ $this->_addButton('shipping_label', array(
28
+
29
+ 'label' => Mage::helper('sales')->__('Create Shipping Label'),
30
+
31
+ 'onclick' => 'open_ship200();',
32
+
33
+ 'class' => 'btn grey ship',
34
+
35
+ ));
36
+
37
+
38
+
39
+ }
40
+
41
+
42
+
43
+ }
44
+
45
+ ?>
app/code/local/Ship200/Onebyone/Block/Adminhtml/Ship200.php ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ship200_Onebyone_Block_Adminhtml_Ship200 extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected $_storeModel;
5
+ protected $_attributes;
6
+ protected $_addMapButtonHtml;
7
+ protected $_removeMapButtonHtml;
8
+ protected $_shortDateFormat;
9
+
10
+
11
+ public function __construct()
12
+ {
13
+ parent::__construct();
14
+ $this->setTemplate('onebyone/ship200.phtml');
15
+ }
16
+
17
+ public function getAttributes($entityType)
18
+ {
19
+ //$methods = array(array('value'=>'','label'=>Mage::helper('adminhtml')->__('--Choose Magento Shipping Method--')));
20
+
21
+ $methods[""] = Mage::helper('adminhtml')->__('--Choose Magento Shipping Method--');
22
+
23
+ $activeCarriers = Mage::getSingleton('shipping/config')->getActiveCarriers();
24
+ foreach($activeCarriers as $carrierCode => $carrierModel)
25
+ {
26
+ $options = array();
27
+ if( $carrierMethods = $carrierModel->getAllowedMethods() )
28
+ {
29
+ foreach ($carrierMethods as $methodCode => $method)
30
+ {
31
+ $code= $carrierCode.'_'.$methodCode;
32
+ //$options[]=array('value'=>$code,'label'=>$method);
33
+ //$options[$code]=$method;
34
+
35
+ }
36
+ $carrierTitle = Mage::getStoreConfig('carriers/'.$carrierCode.'/title');
37
+
38
+ }
39
+ //$methods[]=array('value'=>$code,'label'=>$carrierTitle);
40
+ $methods[$code]=$carrierTitle;
41
+ }
42
+
43
+ Zend_Debug::dump($methods);
44
+ return $methods;
45
+ }
46
+
47
+ public function getValue($key, $default='', $defaultNew = null)
48
+ {
49
+ if (null !== $defaultNew) {
50
+ if (0 == $this->getProfileId()) {
51
+ $default = $defaultNew;
52
+ }
53
+ }
54
+
55
+ $value = $this->getData($key);
56
+ return $this->htmlEscape(strlen($value) > 0 ? $value : $default);
57
+ }
58
+ public function getAddMapButtonHtml()
59
+ {
60
+ if (!$this->_addMapButtonHtml) {
61
+ $this->_addMapButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')
62
+ ->setClass('add')->setLabel($this->__('Add Field Mapping'))
63
+ ->setOnClick("addFieldMapping()")->toHtml();
64
+ }
65
+ return $this->_addMapButtonHtml;
66
+ }
67
+
68
+ public function getRemoveMapButtonHtml()
69
+ {
70
+ if (!$this->_removeMapButtonHtml) {
71
+ $this->_removeMapButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')
72
+ ->setClass('delete')->setLabel($this->__('Remove'))
73
+ ->setOnClick("removeFieldMapping(this)")->toHtml();
74
+ }
75
+ return $this->_removeMapButtonHtml;
76
+ }
77
+
78
+ public function getFileData(){
79
+
80
+ $returnArray=array();
81
+ $hlp = Mage::helper('onebyone');
82
+
83
+ //return array("USPS-01"=>'USPS First-Class Mail');
84
+
85
+ $returnArray[""]=$hlp->__('Choose Ship200 shipping Method');
86
+ $returnArray["USPS-01"]=$hlp->__('USPS First-Class Mail');
87
+ $returnArray["USPS-02"]=$hlp->__('USPS Media Mail');
88
+ $returnArray["USPS-03"]=$hlp->__('USPS Parcel Post');
89
+ $returnArray["USPS-04"]=$hlp->__('USPS Priority Mail');
90
+ $returnArray["USPS-05"]=$hlp->__('USPS Express Mail');
91
+ $returnArray["USPS-06"]=$hlp->__('USPS Express Mail International');
92
+ $returnArray["USPS-07"]=$hlp->__('USPS Priority Mail International');
93
+ $returnArray["USPS-08"]=$hlp->__('USPS First Class Mail International');
94
+ $returnArray["UPS-01"]=$hlp->__('UPS Next Day Air');
95
+ $returnArray["UPS-01-S"]=$hlp->__('UPS Next Day Air Signature Required');
96
+ $returnArray["UPS-02"]=$hlp->__('UPS Second Day Air');
97
+ $returnArray["UPS-02-S"]=$hlp->__('UPS Second Day Air Signature Required');
98
+ $returnArray["UPS-03"]=$hlp->__('UPS Ground');
99
+ $returnArray["UPS-03-S"]=$hlp->__('UPS Ground Signature Required');
100
+ $returnArray["UPS-04"]=$hlp->__('UPS Worldwide ExpressSM');
101
+ $returnArray["UPS-05"]=$hlp->__('UPS Worldwide ExpeditedSM');
102
+ $returnArray["UPS-06"]=$hlp->__('UPS Standard');
103
+ $returnArray["UPS-07"]=$hlp->__('UPS Three-Day Select');
104
+ $returnArray["UPS-07-S"]=$hlp->__('UPS Three-Day Select Signature Required');
105
+ $returnArray["UPS-08"]=$hlp->__('UPS Next Day Air Saver');
106
+ $returnArray["UPS-08-S"]=$hlp->__('UPS Next Day Air Saver Signature Required');
107
+ $returnArray["UPS-09"]=$hlp->__('UPS Next Day Air Early A.M. SM');
108
+ $returnArray["UPS-09-S"]=$hlp->__('UPS Next Day Air Early A.M. SM Signature Required');
109
+ $returnArray["UPS-10"]=$hlp->__('UPS Worldwide Express PlusSM');
110
+ $returnArray["UPS-11"]=$hlp->__('UPS Second Day Air A.M.');
111
+ $returnArray["UPS-11-S"]=$hlp->__('UPS Second Day Air A.M. Signature Required');
112
+ $returnArray["UPS-12"]=$hlp->__('UPS Worldwide Saver (Express)');
113
+ $returnArray["Fedex-01"]=$hlp->__('FedEx Ground');
114
+ $returnArray["Fedex-01-S"]=$hlp->__('FedEx Ground Signature Required');
115
+ $returnArray["Fedex-02"]=$hlp->__('INTERNATIONAL PRIORITY');
116
+ $returnArray["Fedex-03"]=$hlp->__('INTERNATIONAL ECONOMY');
117
+ $returnArray["Fedex-04"]=$hlp->__('FedEx Express Saver');
118
+ $returnArray["Fedex-04-S"]=$hlp->__('FedEx Express Saver Signature Required');
119
+ $returnArray["Fedex-05"]=$hlp->__('FedEx 2Day');
120
+ $returnArray["Fedex-05-S"]=$hlp->__('FedEx 2Day Signature Required');
121
+ $returnArray["Fedex-06"]=$hlp->__('FedEx 2Day AM');
122
+ $returnArray["Fedex-06-S"]=$hlp->__('FedEx 2Day AM Signature Required');
123
+ $returnArray["Fedex-07"]=$hlp->__('FedEx Standard Overnight');
124
+ $returnArray["Fedex-07-S"]=$hlp->__('FedEx Standard Overnight Signature Required');
125
+ $returnArray["Fedex-08"]=$hlp->__('FedEx Priority Overnight');
126
+ $returnArray["Fedex-08-S"]=$hlp->__('FedEx Priority Overnight Signature Required');
127
+ $returnArray["Fedex-09-S"]=$hlp->__('FedEx First Overnight Signature Required');
128
+ $returnArray["Fedex-09"]=$hlp->__('FedEx First Overnigh');
129
+
130
+
131
+
132
+
133
+ return $returnArray;
134
+
135
+
136
+
137
+ return array(
138
+
139
+ ""=> $hlp->__('Choose Ship200 shipping Method'),
140
+
141
+ "USPS-01"=> $hlp->__('USPS First-Class Mail'),
142
+
143
+ "USPS-02" => $hlp->__('USPS Media Mail'),
144
+
145
+ "USPS-03" => $hlp->__('USPS Parcel Post'),
146
+
147
+ "USPS-04" => $hlp->__('USPS Priority Mail'),
148
+
149
+ "USPS-05" => $hlp->__('USPS Express Mail'),
150
+
151
+ "USPS-06" => $hlp->__('USPS Express Mail International'),
152
+
153
+ "USPS-07" => $hlp->__('USPS Priority Mail International'),
154
+
155
+ "USPS-08" => $hlp->__('USPS First Class Mail International'),
156
+
157
+
158
+
159
+ "UPS-01" => $hlp->__('UPS Next Day Air'),
160
+
161
+ "UPS-01-S" => $hlp->__('UPS Next Day Air Signature Required'),
162
+
163
+ "UPS-02" => $hlp->__('UPS Second Day Air'),
164
+
165
+ "UPS-02-S" => $hlp->__('UPS Second Day Air Signature Required'),
166
+
167
+ "UPS-03" => $hlp->__('UPS Ground'),
168
+
169
+ "UPS-03-S" => $hlp->__('UPS Ground Signature Required'),
170
+
171
+ "UPS-04" => $hlp->__('UPS Worldwide ExpressSM'),
172
+
173
+ "UPS-05" => $hlp->__('UPS Worldwide ExpeditedSM'),
174
+
175
+ "UPS-06" => $hlp->__('UPS Standard'),
176
+
177
+ "UPS-07" => $hlp->__('UPS Three-Day Select'),
178
+
179
+ "UPS-07-S" => $hlp->__('UPS Three-Day Select Signature Required'),
180
+
181
+ "UPS-08" => $hlp->__('UPS Next Day Air Saver'),
182
+
183
+ "UPS-08-S" => $hlp->__('UPS Next Day Air Saver Signature Required'),
184
+
185
+ "UPS-09" => $hlp->__('UPS Next Day Air Early A.M. SM'),
186
+
187
+ "UPS-09-S" => $hlp->__('UPS Next Day Air Early A.M. SM Signature Required'),
188
+
189
+ "UPS-10" => $hlp->__('UPS Worldwide Express PlusSM'),
190
+
191
+ "UPS-11" => $hlp->__('UPS Second Day Air A.M.'),
192
+
193
+ "UPS-11-S" => $hlp->__('UPS Second Day Air A.M. Signature Required'),
194
+
195
+ "UPS-12" => $hlp->__('UPS Worldwide Saver (Express)'),
196
+
197
+
198
+
199
+ "Fedex-01" => $hlp->__('FedEx Ground'),
200
+
201
+ "Fedex-01-S" => $hlp->__('FedEx Ground Signature Required'),
202
+
203
+ "Fedex-02" => $hlp->__('INTERNATIONAL PRIORITY'),
204
+
205
+ "Fedex-03" => $hlp->__('INTERNATIONAL ECONOMY'),
206
+
207
+ "Fedex-04" => $hlp->__('FedEx Express Saver'),
208
+
209
+ "Fedex-04-S" => $hlp->__('FedEx Express Saver Signature Required'),
210
+
211
+ "Fedex-05" => $hlp->__('FedEx 2Day'),
212
+
213
+ "Fedex-05-S" => $hlp->__('FedEx 2Day Signature Required'),
214
+
215
+ "Fedex-06" => $hlp->__('FedEx 2Day AM'),
216
+
217
+ "Fedex-06-S" => $hlp->__('FedEx 2Day AM Signature Required'),
218
+
219
+ "Fedex-07" => $hlp->__('FedEx Standard Overnight'),
220
+
221
+ "Fedex-07-S" => $hlp->__('FedEx Standard Overnight Signature Required'),
222
+
223
+ "Fedex-08" => $hlp->__('FedEx Priority Overnight'),
224
+
225
+ "Fedex-08-S" => $hlp->__('FedEx Priority Overnight Signature Required'),
226
+
227
+ "Fedex-09-S" => $hlp->__('FedEx First Overnight Signature Required'),
228
+
229
+ "Fedex-09" => $hlp->__('FedEx First Overnigh'),
230
+
231
+
232
+
233
+
234
+
235
+ );
236
+
237
+
238
+ }
239
+
240
+ }
app/code/local/Ship200/Onebyone/Block/Adminhtml/System/Config/Form/Button.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Atwix
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+
15
+ * @category Atwix Mod
16
+ * @package Evirtual_Autoimport
17
+ * @author Atwix Core Team
18
+ * @copyright Copyright (c) 2012 Atwix (http://www.atwix.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Ship200_Onebyone_Block_Adminhtml_System_Config_Form_Button extends Mage_Adminhtml_Block_System_Config_Form_Field
23
+ {
24
+ /*
25
+ * Set template
26
+ */
27
+ protected function _construct()
28
+ {
29
+
30
+ parent::_construct();
31
+ $this->setTemplate('onebyone/system/config/button.phtml');
32
+ }
33
+
34
+ /**
35
+ * Return element html
36
+ *
37
+ * @param Varien_Data_Form_Element_Abstract $element
38
+ * @return string
39
+ */
40
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
41
+ {
42
+ return $this->_toHtml();
43
+ }
44
+
45
+ /**
46
+ * Return ajax url for button
47
+ *
48
+ * @return string
49
+ */
50
+ public function getAjaxCheckUrl()
51
+ {
52
+ return Mage::helper('adminhtml')->getUrl('onebyone/adminhtml_ship200/getmapp');
53
+ }
54
+
55
+ /**
56
+ * Generate button html
57
+ *
58
+ * @return string
59
+ */
60
+ public function getButtonHtml()
61
+ {
62
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
63
+ ->setData(array(
64
+ 'id' => 'onebyone_button',
65
+ 'label' => $this->helper('adminhtml')->__('Generate Mapping'),
66
+ 'onclick' => 'javascript:check(); return false;'
67
+ ));
68
+
69
+ return $button->toHtml();
70
+ }
71
+ }
app/code/local/Ship200/Onebyone/Helper/Data.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ship200_Onebyone_Helper_Data extends Mage_Core_Helper_Abstract{
4
+
5
+
6
+
7
+ }
8
+
9
+ ?>
app/code/local/Ship200/Onebyone/Model/Source/Carrier.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+
5
+ class Ship200_Onebyone_Model_Source_Carrier extends Varien_Object
6
+
7
+ {
8
+
9
+ public function toOptionArray()
10
+
11
+ {
12
+
13
+ $hlp = Mage::helper('onebyone');
14
+
15
+ return array(
16
+
17
+ array('value' => "USPS-01", 'label' => $hlp->__('USPS First-Class Mail')),
18
+
19
+ array('value' => "USPS-02", 'label' => $hlp->__('USPS Media Mail')),
20
+
21
+ array('value' => "USPS-03", 'label' => $hlp->__('USPS Parcel Post')),
22
+
23
+ array('value' => "USPS-04", 'label' => $hlp->__('USPS Priority Mail')),
24
+
25
+ array('value' => "USPS-05", 'label' => $hlp->__('USPS Express Mail')),
26
+
27
+ array('value' => "USPS-06", 'label' => $hlp->__('USPS Express Mail International')),
28
+
29
+ array('value' => "USPS-07", 'label' => $hlp->__('USPS Priority Mail International')),
30
+
31
+ array('value' => "USPS-08", 'label' => $hlp->__('USPS First Class Mail International')),
32
+
33
+
34
+
35
+ array('value' => "UPS-01", 'label' => $hlp->__('UPS Next Day Air')),
36
+
37
+ array('value' => "UPS-01-S", 'label' => $hlp->__('UPS Next Day Air Signature Required')),
38
+
39
+ array('value' => "UPS-02", 'label' => $hlp->__('UPS Second Day Air')),
40
+
41
+ array('value' => "UPS-02-S", 'label' => $hlp->__('UPS Second Day Air Signature Required')),
42
+
43
+ array('value' => "UPS-03", 'label' => $hlp->__('UPS Ground')),
44
+
45
+ array('value' => "UPS-03-S", 'label' => $hlp->__('UPS Ground Signature Required')),
46
+
47
+ array('value' => "UPS-04", 'label' => $hlp->__('UPS Worldwide ExpressSM')),
48
+
49
+ array('value' => "UPS-05", 'label' => $hlp->__('UPS Worldwide ExpeditedSM')),
50
+
51
+ array('value' => "UPS-06", 'label' => $hlp->__('UPS Standard')),
52
+
53
+ array('value' => "UPS-07", 'label' => $hlp->__('UPS Three-Day Select')),
54
+
55
+ array('value' => "UPS-07-S", 'label' => $hlp->__('UPS Three-Day Select Signature Required')),
56
+
57
+ array('value' => "UPS-08", 'label' => $hlp->__('UPS Next Day Air Saver')),
58
+
59
+ array('value' => "UPS-08-S", 'label' => $hlp->__('UPS Next Day Air Saver Signature Required')),
60
+
61
+ array('value' => "UPS-09", 'label' => $hlp->__('UPS Next Day Air Early A.M. SM')),
62
+
63
+ array('value' => "UPS-09-S", 'label' => $hlp->__('UPS Next Day Air Early A.M. SM Signature Required')),
64
+
65
+ array('value' => "UPS-10", 'label' => $hlp->__('UPS Worldwide Express PlusSM')),
66
+
67
+ array('value' => "UPS-11", 'label' => $hlp->__('UPS Second Day Air A.M.')),
68
+
69
+ array('value' => "UPS-11-S", 'label' => $hlp->__('UPS Second Day Air A.M. Signature Required')),
70
+
71
+ array('value' => "UPS-12", 'label' => $hlp->__('UPS Worldwide Saver (Express)')),
72
+
73
+
74
+
75
+ array('value' => "Fedex-01", 'label' => $hlp->__('FedEx Ground')),
76
+
77
+ array('value' => "Fedex-01-S", 'label' => $hlp->__('FedEx Ground Signature Required')),
78
+
79
+ array('value' => "Fedex-02", 'label' => $hlp->__('INTERNATIONAL PRIORITY')),
80
+
81
+ array('value' => "Fedex-03", 'label' => $hlp->__('INTERNATIONAL ECONOMY')),
82
+
83
+ array('value' => "Fedex-04", 'label' => $hlp->__('FedEx Express Saver')),
84
+
85
+ array('value' => "Fedex-04-S", 'label' => $hlp->__('FedEx Express Saver Signature Required')),
86
+
87
+ array('value' => "Fedex-05", 'label' => $hlp->__('FedEx 2Day')),
88
+
89
+ array('value' => "Fedex-05-S", 'label' => $hlp->__('FedEx 2Day Signature Required')),
90
+
91
+ array('value' => "Fedex-06", 'label' => $hlp->__('FedEx 2Day AM')),
92
+
93
+ array('value' => "Fedex-06-S", 'label' => $hlp->__('FedEx 2Day AM Signature Required')),
94
+
95
+ array('value' => "Fedex-07", 'label' => $hlp->__('FedEx Standard Overnight')),
96
+
97
+ array('value' => "Fedex-07-S", 'label' => $hlp->__('FedEx Standard Overnight Signature Required')),
98
+
99
+ array('value' => "Fedex-08", 'label' => $hlp->__('FedEx Priority Overnight')),
100
+
101
+ array('value' => "Fedex-08-S", 'label' => $hlp->__('FedEx Priority Overnight Signature Required')),
102
+
103
+ array('value' => "Fedex-09-S", 'label' => $hlp->__('FedEx First Overnight Signature Required')),
104
+
105
+ array('value' => "Fedex-09", 'label' => $hlp->__('FedEx First Overnigh')),
106
+
107
+
108
+
109
+
110
+
111
+ );
112
+
113
+ }
114
+
115
+ }
app/code/local/Ship200/Onebyone/controllers/Adminhtml/Ship200Controller.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Evirtual
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+
15
+ * @category Evirtual Mod
16
+ * @package Evirtual_Autoimport
17
+ * @author Evirtual Core Team
18
+ * @copyright Copyright (c) 2012 Evirtual (http://www.evirtual.in)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Ship200_Onebyone_Adminhtml_Ship200Controller extends Mage_Adminhtml_Controller_Action
23
+ {
24
+ /**
25
+ * Return some checking result
26
+ *
27
+ * @return void
28
+ */
29
+ public function getmappAction()
30
+ {
31
+ $this->loadLayout();
32
+ $this->renderLayout();
33
+ }
34
+
35
+ public function savemappAction()
36
+ {
37
+ if ($data = $this->getRequest()->getPost()) {
38
+ /*$ProductAttDb=serialize($data['gui_data']['map']['product']['db']);
39
+ $ProductAttFile=serialize($data['gui_data']['map']['product']['file']);*/
40
+
41
+ $ProductAttDb=$data['gui_data']['map']['product']['db'];
42
+ $ProductAttFile=$data['gui_data']['map']['product']['file'];
43
+
44
+ $margeArray=array();
45
+ for($i=0;$i<count($ProductAttDb);$i++){
46
+
47
+ $margeArray[$ProductAttDb[$i]]=$ProductAttFile[$i];
48
+ }
49
+
50
+ /*Zend_Debug::dump($ProductAttDb);
51
+ Zend_Debug::dump($ProductAttFile);*/
52
+ //Zend_Debug::dump($margeArray);
53
+ $margeArray=serialize($margeArray);
54
+ //exit;
55
+
56
+ $ConfigSwitch = new Mage_Core_Model_Config();
57
+ $ConfigSwitch->saveConfig('onebyone/info/shippingmapping', $margeArray, 'default', $margeArray);
58
+
59
+ Mage::getConfig()->saveConfig('onebyone/info/shippingmapping',$margeArray);
60
+
61
+ // Refresh the config.
62
+ Mage::app()->getStore()->resetConfig();
63
+
64
+
65
+ }
66
+
67
+ }
68
+ }
app/code/local/Ship200/Onebyone/controllers/IndexController.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+
5
+ class Ship200_Onebyone_IndexController extends Mage_Core_Controller_Front_Action
6
+
7
+ {
8
+
9
+
10
+
11
+ public function postbackAction(){
12
+
13
+
14
+
15
+ $secret_key = Mage::getStoreConfig('onebyone/info/appkey');
16
+ $order_status_tracking = Mage::getStoreConfig('onebyone/info/order_status_tracking');
17
+ // $notify_customer_setting = Mage::getStoreConfig('onebyone/info/notify_customer');
18
+ $notify_customer_setting = 1;
19
+
20
+
21
+
22
+ if($notify_customer_setting == "1"){
23
+ $notifycustomer="true";
24
+ }else{
25
+ $notifycustomer="false";
26
+ }
27
+
28
+ if($secret_key == ""){ echo "The Secret Key was never setup. Please refer to read_me file"; exit;}
29
+
30
+ if($order_status_tracking == ""){ echo "Please Select The Order Status From Admin For Update With Tracking"; exit;}
31
+
32
+ #Extra security
33
+ // Check that request is coming from Ship200 Server
34
+ $allowed_servers = file_get_contents('http://www.ship200.com/instructions/allowed_servers.txt');
35
+ $servers_array = explode(",",$allowed_servers);
36
+
37
+ $server = 0;
38
+ foreach($servers_array as $ip){
39
+ if($_SERVER['REMOTE_ADDR'] == $ip){$server = 1;}
40
+ }
41
+ if($server == 0){ echo "Incorrect Server"; exit;}
42
+ // Check that request is coming from Ship200 Server
43
+
44
+
45
+ if($_POST['update_tracking'] != "" && $_GET['id'] == $secret_key){
46
+ $order=Mage::getModel("sales/order")->loadByIncrementId($_POST['keyForUpdate']);
47
+
48
+
49
+
50
+ $order->setData('state', $order_status_tracking);
51
+ $order->setStatus($order_status_tracking);
52
+ $comment = addslashes($_POST['carrier'])." tracking#: ".addslashes($_POST['tracking']);
53
+ $history = $order->addStatusHistoryComment($comment, false);
54
+ $history->setIsCustomerNotified($notifycustomer);
55
+ $order->save();
56
+
57
+ echo "Tracking Number: Inserted";
58
+
59
+ }else{
60
+ echo "Failed to Update Tracking";
61
+ }
62
+ }
63
+
64
+
65
+
66
+ }
67
+
68
+
69
+
70
+ ?>
app/code/local/Ship200/Onebyone/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <onebyone>
12
+ <title>onebyone options</title>
13
+ </onebyone>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </config>
app/code/local/Ship200/Onebyone/etc/config.xml ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+
5
+ <modules>
6
+
7
+ <Ship200_Onebyone>
8
+
9
+ <version>0.1.0</version>
10
+
11
+ </Ship200_Onebyone>
12
+
13
+ </modules>
14
+
15
+ <global>
16
+
17
+ <blocks>
18
+
19
+ <onebyone>
20
+
21
+ <class>Ship200_Onebyone_Block</class>
22
+
23
+ </onebyone>
24
+
25
+ <adminhtml>
26
+
27
+ <rewrite>
28
+
29
+ <sales_order_view>Ship200_Onebyone_Block_Adminhtml_Sales_Order_View</sales_order_view>
30
+
31
+ </rewrite>
32
+
33
+ </adminhtml>
34
+
35
+ </blocks>
36
+
37
+ <helpers>
38
+
39
+ <onebyone>
40
+
41
+ <class>Ship200_Onebyone_Helper</class>
42
+
43
+ </onebyone>
44
+
45
+ </helpers>
46
+
47
+ <models>
48
+
49
+ <onebyone>
50
+
51
+ <class>Ship200_Onebyone_Model</class>
52
+
53
+ </onebyone>
54
+
55
+ </models>
56
+
57
+ </global>
58
+ <admin>
59
+
60
+ <routers>
61
+ <onebyone>
62
+ <use>admin</use>
63
+ <args>
64
+ <module>Ship200_Onebyone</module>
65
+ <frontName>onebyone</frontName>
66
+ </args>
67
+ </onebyone>
68
+ </routers>
69
+
70
+ </admin>
71
+ <adminhtml>
72
+
73
+ <layout>
74
+
75
+ <updates>
76
+
77
+ <Ship200_onebyone>
78
+
79
+ <file>Ship200_onebyone.xml</file>
80
+
81
+ </Ship200_onebyone>
82
+
83
+ </updates>
84
+
85
+ </layout>
86
+
87
+ </adminhtml>
88
+
89
+ <frontend>
90
+
91
+ <routers>
92
+
93
+ <onebyone>
94
+
95
+ <use>standard</use>
96
+
97
+ <args>
98
+
99
+ <module>Ship200_Onebyone</module>
100
+
101
+ <frontName>onebyone</frontName>
102
+
103
+ </args>
104
+
105
+ </onebyone>
106
+
107
+ </routers>
108
+
109
+ </frontend>
110
+
111
+
112
+
113
+ </config>
app/code/local/Ship200/Onebyone/etc/system.xml ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+
5
+ <tabs>
6
+
7
+ <!--Here is the tabs definition-->
8
+
9
+ <onebyonesetting translate="label" module="onebyone">
10
+
11
+ <label>Ship200 OneByOne Addon</label>
12
+
13
+ <sort_order>10</sort_order>
14
+
15
+ <sort_order>700</sort_order>
16
+
17
+ <show_in_default>1</show_in_default>
18
+
19
+ <show_in_website>1</show_in_website>
20
+
21
+ <show_in_store>1</show_in_store>
22
+
23
+ </onebyonesetting>
24
+
25
+ </tabs>
26
+
27
+ <sections>
28
+
29
+ <!--Here are the sections definition-->
30
+
31
+ <onebyone translate="label" module="onebyone">
32
+
33
+ <class>separator-top</class>
34
+
35
+ <label>OneByOne Settings</label>
36
+
37
+ <tab>onebyonesetting</tab>
38
+
39
+ <sort_order>700</sort_order>
40
+
41
+ <show_in_default>1</show_in_default>
42
+
43
+ <show_in_website>1</show_in_website>
44
+
45
+ <show_in_store>1</show_in_store>
46
+
47
+ <groups>
48
+
49
+ <!--Here are the groups definitions-->
50
+
51
+ <info translate="label">
52
+
53
+ <label>OneByOne General information</label>
54
+
55
+ <frontend_type>text</frontend_type>
56
+
57
+ <sort_order>1</sort_order>
58
+
59
+ <show_in_default>1</show_in_default>
60
+
61
+ <show_in_website>1</show_in_website>
62
+
63
+ <show_in_store>1</show_in_store>
64
+
65
+ <fields>
66
+
67
+ <!--Here are the fields definition-->
68
+
69
+ <enable translate="label">
70
+
71
+ <label>Enable</label>
72
+
73
+ <frontend_type>select</frontend_type>
74
+
75
+ <source_model>adminhtml/system_config_source_yesno</source_model>
76
+
77
+ <sort_order>0</sort_order>
78
+
79
+ <show_in_default>1</show_in_default>
80
+
81
+ <show_in_website>1</show_in_website>
82
+
83
+ <show_in_store>1</show_in_store>
84
+
85
+ </enable>
86
+
87
+ <!--<shippingmapping translate="label comment">
88
+ <label>Shipping Mapping </label>
89
+ <frontend_type>textarea</frontend_type>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ <sort_order>80</sort_order>
94
+ </shippingmapping>-->
95
+
96
+
97
+ <appkey translate="label">
98
+
99
+ <label>Ship200 Key</label>
100
+
101
+ <frontend_type>text</frontend_type>
102
+
103
+ <sort_order>1</sort_order>
104
+
105
+ <show_in_default>1</show_in_default>
106
+
107
+ <show_in_website>1</show_in_website>
108
+
109
+ <show_in_store>1</show_in_store>
110
+
111
+ <comment>
112
+ <![CDATA[1. Login in into your Ship200.com account. </br> 2. On top menu go to "Bulk Processing" -> "Generate Key" </br>3. Click "Generate Key", then replace "XXXXXXXXXX-XXX" with your generated key in the next step]]>
113
+ </comment>
114
+
115
+
116
+ </appkey>
117
+
118
+
119
+
120
+ <carrier translate="label">
121
+
122
+ <label>Default Carrier Service</label>
123
+
124
+ <frontend_type>select</frontend_type>
125
+
126
+ <source_model>onebyone/source_carrier</source_model>
127
+
128
+ <sort_order>2</sort_order>
129
+
130
+ <show_in_default>1</show_in_default>
131
+
132
+ <show_in_website>1</show_in_website>
133
+
134
+ <show_in_store>1</show_in_store>
135
+
136
+ <comment><![CDATA[for detailed ship methods mapping edit file "app\design\adminhtml\default\default\template\onebyone\sales\order\view\info.phtml"]]> </comment>
137
+
138
+
139
+ </carrier>
140
+
141
+ <order_status_tracking translate="label">
142
+
143
+ <label>Order Status For Update With Tracking</label>
144
+
145
+ <frontend_type>select</frontend_type>
146
+
147
+ <source_model>adminhtml/system_config_source_order_status</source_model>
148
+
149
+ <sort_order>3</sort_order>
150
+
151
+ <show_in_default>1</show_in_default>
152
+
153
+ <show_in_website>1</show_in_website>
154
+
155
+ <show_in_store>1</show_in_store>
156
+
157
+ </order_status_tracking>
158
+
159
+ <!--<notify_customer translate="label">
160
+
161
+ <label>Notify Customer</label>
162
+
163
+ <frontend_type>select</frontend_type>
164
+
165
+ <source_model>adminhtml/system_config_source_yesno</source_model>
166
+
167
+ <sort_order>4</sort_order>
168
+
169
+ <show_in_default>1</show_in_default>
170
+
171
+ <show_in_website>1</show_in_website>
172
+
173
+ <show_in_store>1</show_in_store>
174
+
175
+ </notify_customer>
176
+ -->
177
+ <!--<mapp translate="label comment">
178
+ <label>Generate Mapping</label>
179
+ <comment>Save the Config then Generate Mapping</comment>
180
+ <frontend_type>button</frontend_type>
181
+ <frontend_model>onebyone/adminhtml_system_config_form_button</frontend_model>
182
+ <show_in_default>1</show_in_default>
183
+ <show_in_website>1</show_in_website>
184
+ <show_in_store>1</show_in_store>
185
+ <sort_order>100</sort_order>
186
+ </mapp>-->
187
+
188
+ </fields>
189
+
190
+ </info>
191
+
192
+ </groups>
193
+
194
+ </onebyone>
195
+
196
+ </sections>
197
+
198
+ </config>
app/design/adminhtml/default/default/layout/Ship200_onebyone.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_sales_order_view>
4
+ <reference name="order_info">
5
+ <action method="setTemplate">
6
+ <template>onebyone/sales/order/view/info.phtml</template>
7
+ </action>
8
+ <!--<block type="adminhtml/sales_order_view_tab_info" name="order_tab_info" template="onebyone/sales/order/view/tab/info.phtml">
9
+ </block>-->
10
+ </reference>
11
+ </adminhtml_sales_order_view>
12
+
13
+ <onebyone_adminhtml_ship200_getmapp>
14
+ <reference name="content">
15
+ <block type="onebyone/adminhtml_ship200" name="ship200" />
16
+ </reference>
17
+ </onebyone_adminhtml_ship200_getmapp>
18
+
19
+ </layout>
app/design/adminhtml/default/default/template/onebyone/sales/order/view/info.phtml ADDED
@@ -0,0 +1,511 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+
5
+ * Magento
6
+
7
+ *
8
+
9
+ * NOTICE OF LICENSE
10
+
11
+ *
12
+
13
+ * This source file is subject to the Academic Free License (AFL 3.0)
14
+
15
+ * that is bundled with this package in the file LICENSE_AFL.txt.
16
+
17
+ * It is also available through the world-wide-web at this URL:
18
+
19
+ * http://opensource.org/licenses/afl-3.0.php
20
+
21
+ * If you did not receive a copy of the license and are unable to
22
+
23
+ * obtain it through the world-wide-web, please send an email
24
+
25
+ * to license@magentocommerce.com so we can send you a copy immediately.
26
+
27
+ *
28
+
29
+ * DISCLAIMER
30
+
31
+ *
32
+
33
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
34
+
35
+ * versions in the future. If you wish to customize Magento for your
36
+
37
+ * needs please refer to http://www.magentocommerce.com for more information.
38
+
39
+ *
40
+
41
+ * @category design
42
+
43
+ * @package default_default
44
+
45
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
46
+
47
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
48
+
49
+ */
50
+
51
+ ?>
52
+
53
+ <style>
54
+
55
+ .btn.return {
56
+
57
+ padding-left: 10px !important;
58
+
59
+ }
60
+
61
+ .btn.return span {
62
+
63
+ padding-left: 25px;
64
+
65
+ }
66
+
67
+ .btn.ship {
68
+
69
+ padding-left: 15px !important;
70
+
71
+ }
72
+
73
+ .btn.ship span {
74
+
75
+ padding-left: 35px;
76
+
77
+ }
78
+
79
+ </style>
80
+
81
+ <?php $_order = $this->getOrder();
82
+
83
+ $shipping_address = $_order->getShippingAddress();
84
+
85
+ //Zend_Debug::dump($_order->getData());
86
+
87
+ ?>
88
+
89
+
90
+
91
+
92
+
93
+ <?php
94
+
95
+
96
+
97
+ //// Ship200 Integration Code Start ///
98
+
99
+
100
+
101
+ $shipService = Mage::getStoreConfig('onebyone/info/carrier'); // !Full list of codes: http://www.ship200.com/carrier_service_codes.html
102
+ //$Mappingsetting = unserialize(Mage::getStoreConfig('onebyone/info/shippingmapping'));
103
+
104
+ #$shipService=$Mappingsetting[$_order->getShippingMethod()];
105
+
106
+ //Zend_Debug::dump($shipService);
107
+
108
+ $appkey = Mage::getStoreConfig('onebyone/info/appkey');
109
+
110
+ $postbackUrl=Mage::getUrl('onebyone/index/postback');
111
+
112
+ $postbackUrl.="?id=".$appkey;
113
+
114
+
115
+ // Set you custom Carrier service selection, like examples below
116
+
117
+ //if($_order->getShippingMethod() == "flatrate_flatrate"){$shipService = "Fedex-01";}
118
+ //if($_order->getShippingMethod() == "freeshipping_freeshipping"){$shipService = "Fedex-05";}
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ ?>
129
+
130
+ <script src="https://secure.ship200.com/html/js/b_ship200.js"></script>
131
+
132
+
133
+
134
+ <script>
135
+
136
+ var ship200Address = [
137
+
138
+
139
+
140
+ '<?php echo addslashes($shipping_address->getFirstname()) ?> &nbsp; <?php echo addslashes($shipping_address->getLastname()) ?>', //0 Name
141
+
142
+ '<?php echo addslashes($shipping_address->getCompany()) ?>', //1 Company Name
143
+
144
+ '<?php echo addslashes($shipping_address->getStreet(1)) ?>', //2 Address Line 1
145
+
146
+ '<?php echo addslashes($shipping_address->getStreet(2)) ?>', //3 Address Line 2
147
+
148
+ '<?php echo addslashes($shipping_address->getCity()) ?>', //4 City
149
+
150
+ '<?php echo addslashes($shipping_address->getRegion()) ?>', //5 State
151
+
152
+ '<?php echo addslashes($shipping_address->getPostcode()) ?>', //6 Zip
153
+
154
+ '<?php echo addslashes($shipping_address->getCountryId()) ?>', //7 Country
155
+
156
+ '<?php echo addslashes($shipping_address->getTelephone()) ?>', //8 Phone
157
+
158
+
159
+
160
+ 'order number: <?php echo $_order->getIncrementId() ?>', //9 Refference (will be printed on the label)
161
+
162
+ '<?php echo addslashes($_order->getGrandTotal()) ?>', //10 Declared Value
163
+
164
+ '', //11 Weight
165
+
166
+ '', //12 Weight Units (lb or oz): valid values are 'lb' or 'oz'
167
+
168
+ '', //13 Dimensions Length
169
+
170
+ '', //14 Dimensions Width
171
+
172
+ '', //15 Dimensions Height
173
+
174
+
175
+
176
+ '<?php echo $shipService ?>', //16 Default Carrier Service, example 'USPS-01', 'Fedex-01', 'UPS-03-S', etc. !Full list of codes: http://secure.ship200.com/html/images/help/service_codes
177
+
178
+
179
+
180
+ '<?php echo $_order->getIncrementId() ?>', //17 Key (usually order number) for sending tracking number back, if set the url below is required, example '349001'
181
+
182
+ '<?php echo $postbackUrl;?>' //18 URL for sending tracking back, example 'http://www.yourdomain.com/admin-folder/ship200_postback.php?id=yourKey123'
183
+
184
+ ];
185
+
186
+ var ship200URL='';
187
+
188
+ for (var i in ship200Address) {
189
+
190
+ if(i != 18)
191
+
192
+ ship200Address[i]=ship200Address[i].replace(/[^a-z0-9., '-]/gi,'');
193
+
194
+ ship200URL += ship200Address[i]+'}{';
195
+
196
+ }
197
+
198
+ function open_ship200(){ myWindow=window.open('https://secure.ship200.com/shipping.php?action=new_label&shipto='+ship200URL,'ship200','width='+ship200Width+',height='+ship200Height+',scrollbars=yes'); myWindow.focus();}
199
+
200
+ function open_ship200_return(){ myWindow=window.open('https://secure.ship200.com/shipping.php?action=new_label&print_return=1&shipto='+ship200URL,'ship200','width='+ship200Width+',height='+ship200Height+',scrollbars=yes'); myWindow.focus();}
201
+
202
+ </script>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <?php
211
+
212
+ $orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
213
+
214
+ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
215
+
216
+ ?>
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+ <div class="box-left">
225
+
226
+ <!--Order Information-->
227
+
228
+ <div class="entry-edit">
229
+
230
+ <?php if ($_order->getEmailSent()):
231
+
232
+ $_email = Mage::helper('sales')->__('the order confirmation email was sent');
233
+
234
+ else:
235
+
236
+ $_email = Mage::helper('sales')->__('the order confirmation email is not sent');
237
+
238
+ endif; ?>
239
+
240
+ <div class="entry-edit-head">
241
+
242
+ <?php if ($this->getNoUseOrderLink()): ?>
243
+
244
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?> (<?php echo $_email ?>)</h4>
245
+
246
+ <?php else: ?>
247
+
248
+ <a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></a>
249
+
250
+ <strong>(<?php echo $_email ?>)</strong>
251
+
252
+ <?php endif; ?>
253
+
254
+ </div>
255
+
256
+ <div class="fieldset">
257
+
258
+ <table cellspacing="0" class="form-list">
259
+
260
+ <tr>
261
+
262
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date') ?></label></td>
263
+
264
+ <td class="value"><strong><?php echo $orderAdminDate ?></strong></td>
265
+
266
+ </tr>
267
+
268
+ <?php if ($orderAdminDate != $orderStoreDate):?>
269
+
270
+ <tr>
271
+
272
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date (%s)', $_order->getCreatedAtStoreDate()->getTimezone()) ?></label></td>
273
+
274
+ <td class="value"><strong><?php echo $orderStoreDate ?></strong></td>
275
+
276
+ </tr>
277
+
278
+ <?php endif;?>
279
+
280
+ <tr>
281
+
282
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Status') ?></label></td>
283
+
284
+ <td class="value"><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
285
+
286
+ </tr>
287
+
288
+ <tr>
289
+
290
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Purchased From') ?></label></td>
291
+
292
+ <td class="value"><strong><?php echo $this->getOrderStoreName() ?></strong></td>
293
+
294
+ </tr>
295
+
296
+ <?php if($_order->getRelationChildId()): ?>
297
+
298
+ <tr>
299
+
300
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the New Order') ?></label></td>
301
+
302
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationChildId()) ?>">
303
+
304
+ <?php echo $_order->getRelationChildRealId() ?>
305
+
306
+ </a></td>
307
+
308
+ </tr>
309
+
310
+ <?php endif; ?>
311
+
312
+ <?php if($_order->getRelationParentId()): ?>
313
+
314
+ <tr>
315
+
316
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the Previous Order') ?></label></td>
317
+
318
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationParentId()) ?>">
319
+
320
+ <?php echo $_order->getRelationParentRealId() ?>
321
+
322
+ </a></td>
323
+
324
+ </tr>
325
+
326
+ <?php endif; ?>
327
+
328
+ <?php if($_order->getRemoteIp() && $this->shouldDisplayCustomerIp()): ?>
329
+
330
+ <tr>
331
+
332
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Placed from IP') ?></label></td>
333
+
334
+ <td class="value"><strong><?php echo $_order->getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $this->escapeHtml($_order->getXForwardedFor()) . ')':''; ?></strong></td>
335
+
336
+ </tr>
337
+
338
+ <?php endif; ?>
339
+
340
+ <?php if($_order->getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?>
341
+
342
+ <tr>
343
+
344
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getGlobalCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
345
+
346
+ <td class="value"><strong><?php echo $_order->getBaseToGlobalRate() ?></strong></td>
347
+
348
+ </tr>
349
+
350
+ <?php endif; ?>
351
+
352
+ <?php if($_order->getBaseCurrencyCode() != $_order->getOrderCurrencyCode()): ?>
353
+
354
+ <tr>
355
+
356
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getOrderCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
357
+
358
+ <td class="value"><strong><?php echo $_order->getBaseToOrderRate() ?></strong></td>
359
+
360
+ </tr>
361
+
362
+ <?php endif; ?>
363
+
364
+ </table>
365
+
366
+ </div>
367
+
368
+ </div>
369
+
370
+ </div>
371
+
372
+ <div class="box-right">
373
+
374
+ <!--Account Information-->
375
+
376
+ <div class="entry-edit">
377
+
378
+ <div class="entry-edit-head">
379
+
380
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Account Information') ?></h4>
381
+
382
+ <div class="tools"><?php echo $this->getAccountEditLink()?></div>
383
+
384
+ </div>
385
+
386
+ <div class="fieldset">
387
+
388
+ <div class="hor-scroll">
389
+
390
+ <table cellspacing="0" class="form-list">
391
+
392
+ <tr>
393
+
394
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
395
+
396
+ <td class="value">
397
+
398
+ <?php if ($_customerUrl=$this->getCustomerViewUrl()) : ?>
399
+
400
+ <a href="<?php echo $_customerUrl ?>" target="_blank"><strong><?php echo $this->escapeHtml($_order->getCustomerName()) ?></strong></a>
401
+
402
+ <?php else: ?>
403
+
404
+ <strong><?php echo $this->escapeHtml($_order->getCustomerName()) ?></strong>
405
+
406
+ <?php endif; ?>
407
+
408
+ </td>
409
+
410
+ </tr>
411
+
412
+ <tr>
413
+
414
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Email') ?></label></td>
415
+
416
+ <td class="value"><a href="mailto:<?php echo $_order->getCustomerEmail() ?>"><strong><?php echo $_order->getCustomerEmail() ?></strong></a></td>
417
+
418
+ </tr>
419
+
420
+ <?php if ($_groupName = $this->getCustomerGroupName()) : ?>
421
+
422
+ <tr>
423
+
424
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Group') ?></label></td>
425
+
426
+ <td class="value"><strong><?php echo $_groupName ?></strong></td>
427
+
428
+ </tr>
429
+
430
+ <?php endif; ?>
431
+
432
+ <?php foreach ($this->getCustomerAccountData() as $data):?>
433
+
434
+ <tr>
435
+
436
+ <td class="label"><label><?php echo $data['label'] ?></label></td>
437
+
438
+ <td class="value"><strong><?php echo $data['value'] ?></strong></td>
439
+
440
+ </tr>
441
+
442
+ <?php endforeach;?>
443
+
444
+ </table>
445
+
446
+ </div>
447
+
448
+ </div>
449
+
450
+ </div>
451
+
452
+ </div>
453
+
454
+ <div class="clear"></div>
455
+
456
+
457
+
458
+ <div class="box-left">
459
+
460
+ <!--Billing Address-->
461
+
462
+ <div class="entry-edit">
463
+
464
+ <div class="entry-edit-head">
465
+
466
+ <h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Billing Address') ?></h4>
467
+
468
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getBillingAddress())?></div>
469
+
470
+ </div>
471
+
472
+ <fieldset>
473
+
474
+ <address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address>
475
+
476
+ </fieldset>
477
+
478
+ </div>
479
+
480
+ </div>
481
+
482
+ <?php if (!$this->getOrder()->getIsVirtual()): ?>
483
+
484
+ <div class="box-right">
485
+
486
+ <!--Shipping Address-->
487
+
488
+ <div class="entry-edit">
489
+
490
+ <div class="entry-edit-head">
491
+
492
+ <h4 class="icon-head head-shipping-address"><?php echo Mage::helper('sales')->__('Shipping Address') ?></h4>
493
+
494
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getShippingAddress())?></div>
495
+
496
+ </div>
497
+
498
+ <fieldset>
499
+
500
+ <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
501
+
502
+ </fieldset>
503
+
504
+ </div>
505
+
506
+ </div>
507
+
508
+ <div class="clear"></div>
509
+
510
+ <?php endif; ?>
511
+
app/design/adminhtml/default/default/template/onebyone/ship200.phtml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form action="<?php echo Mage::helper("adminhtml")->getUrl("onebyone/adminhtml_ship200/savemapp")?>" method="post" id="mapping_form">
2
+ <div id="profile-generator" class="entry-edit profile-generator">
3
+ <div id="__fieldmapping">
4
+ <div class="entry-edit-head">
5
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__("Field Mapping") ?></h4>
6
+ </div>
7
+ <fieldset>
8
+ <input type="hidden" id="profile_entity_type" name="entity_type" value="product" />
9
+ <legend><?php echo $this->__("Field Mapping") ?></legend>
10
+ <?php foreach (array('product') as $_entityType): ?>
11
+ <div class="profile_entity_type_<?php echo $_entityType ?>">
12
+ <div id="map_template_<?php echo $_entityType ?>" style="display:none">
13
+ <span class="field-row">
14
+ <?php echo $this->__("In Magento:") ?> <select name="gui_data[map][<?php echo $_entityType ?>][db][]">
15
+ <?php
16
+ $fieldMappingInDatabase = $this->getAttributes($_entityType);
17
+ asort($fieldMappingInDatabase);
18
+ foreach ($fieldMappingInDatabase as $_value=>$_label): ?>
19
+ <option value="<?php echo $_value ?>"><?php echo $_label ?></option>
20
+ <?php endforeach ?>
21
+ </select>
22
+ &lt;--&gt;
23
+ <?php echo $this->__("In Ship200:") ?>
24
+
25
+ <select name="gui_data[map][<?php echo $_entityType ?>][file][]">
26
+ <?php
27
+ $fieldMappingInDatabase = $this->getFileData();
28
+ asort($fieldMappingInDatabase);
29
+ foreach ($fieldMappingInDatabase as $key=>$value): ?>
30
+ <option value="<?php echo $key ?>"><?php echo $value ?></option>
31
+ <?php endforeach ?>
32
+ </select>
33
+
34
+
35
+ <?php echo $this->getRemoveMapButtonHtml() ?>
36
+ </span>
37
+ </div>
38
+ <div id="map_container_<?php echo $_entityType ?>">
39
+ <?php foreach ($this->getMappings($_entityType) as $_i=>$_dbField): ?>
40
+ <span class="field-row">
41
+ <?php echo $this->__("In Database:") ?> <select name="gui_data[map][<?php echo $_entityType ?>][db][]">
42
+ <?php foreach ($this->getAttributes($_entityType) as $_value=>$_label): ?>
43
+ <option value="<?php echo $_value ?>" <?php echo $this->getSelected('gui_data/map/'.$_entityType.'/db/'.$_i, $_value) ?>><?php echo $_label ?></option>
44
+ <?php endforeach ?>
45
+ </select>
46
+ &lt;--&gt;
47
+ <?php echo $this->__("In File:") ?> <input class="input-text" name="gui_data[map][<?php echo $_entityType ?>][file][]" value="<?php echo $this->getValue('gui_data/map/'.$_entityType.'/file/'.$_i) ?>"/>
48
+ <?php echo $this->getRemoveMapButtonHtml() ?>
49
+ </span>
50
+ <?php endforeach ?>
51
+ </div>
52
+
53
+ </div>
54
+ <?php endforeach ?>
55
+ <?php echo $this->getAddMapButtonHtml() ?>
56
+
57
+ <button onclick="mapp('<?php echo Mage::helper("adminhtml")->getUrl("onebyone/adminhtml_ship200/savemapp")?>')" class="scalable save" type="button" title="Save Mapping" ><span><span><span>Save Mapping</span></span></span></button>
58
+ </fieldset>
59
+
60
+ </div>
61
+
62
+ </div>
63
+ </form>
app/design/adminhtml/default/default/template/onebyone/system/config/button.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Atwix
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+
15
+ * @category Atwix Mod
16
+ * @package Atwix_Tweaks
17
+ * @author Atwix Core Team
18
+ * @copyright Copyright (c) 2012 Atwix (http://www.atwix.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ * @var $this Atwix_Tweaks_Block_Adminhtml_System_Config_Form_Button
21
+ */
22
+ ?>
23
+ <style>
24
+ #row_onebyone_info_shippingmapping{
25
+ display:none;
26
+ }
27
+
28
+ </style>
29
+ <script type="text/javascript">
30
+ //<![CDATA[
31
+ function check() {
32
+ new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
33
+ method: 'get',
34
+ onSuccess: function(transport){
35
+ if (transport.responseText){
36
+ ft = transport.responseText;
37
+ var bagEle = new Element('div');
38
+ bagEle.update(ft);
39
+ var Content = bagEle.select('div#anchor-content')[0];
40
+ var parentGuest = document.getElementById("config_edit_form");
41
+ var childGuest = document.createElement("div");
42
+ childGuest.id="collector";
43
+ if (parentGuest.nextSibling) {
44
+ parentGuest.parentNode.insertBefore(childGuest, parentGuest.nextSibling);
45
+ }
46
+ else {
47
+ parentGuest.parentNode.appendChild(childGuest);
48
+ }
49
+
50
+ $$('#collector')[0].innerHTML=Content.innerHTML;
51
+
52
+ }
53
+ }
54
+ });
55
+ }
56
+
57
+ function mapp() {
58
+ formaction=document.getElementById("mapping_form").action;
59
+ new Ajax.Request(formaction, {
60
+ method: 'post',
61
+ parameters: Form.serialize("mapping_form"),
62
+ onSuccess: function(transport){
63
+ window.location.reload();
64
+ if (transport.responseText){
65
+
66
+ window.location.reload();
67
+ //document.getElementById("messages")[1].innerHTML="Mapping Data is Saved";
68
+ }
69
+ }
70
+ });
71
+ }
72
+
73
+ function addFieldMapping()
74
+ {
75
+ var entityType = $('profile_entity_type').value;
76
+ Element.insert($('map_container_'+entityType), {bottom: $('map_template_'+entityType).innerHTML});
77
+ }
78
+ function removeFieldMapping(button)
79
+ {
80
+ Element.remove(button.parentNode);
81
+ }
82
+ function setMapFileField(select)
83
+ {
84
+ select.parentNode.getElementsByTagName('input')[0].value = select.value;
85
+ }
86
+ //]]>
87
+ </script>
88
+
89
+ <?php echo $this->getButtonHtml() ?>
app/etc/modules/Ship200_Onebyone.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+
5
+ <modules>
6
+
7
+ <Ship200_Onebyone>
8
+
9
+ <active>true</active>
10
+
11
+ <codePool>local</codePool>
12
+
13
+ </Ship200_Onebyone>
14
+
15
+ </modules>
16
+
17
+ </config>
18
+
package.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>ship200_onebyone</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Ship200 is Multi Carrier (Fedex, UPS, USPS) Shipping Software</summary>
10
+ <description>Ship200 is Multi Carrier (Fedex, UPS, USPS) Shipping Software which allows you to print shipping labels in bulk or individually and integrate process of creating labels directly into you Magento.&#xD;
11
+ &lt;br /&gt;&lt;br /&gt;&#xD;
12
+ This Plugin connects your Magento store to Ship200, and adds the ability to download new orders to Ship200 for creating shipping labels in bulk.&#xD;
13
+ &lt;br /&gt;&lt;br /&gt;&#xD;
14
+ Demo:&#xD;
15
+ &lt;a href="https://www.youtube.com/watch?v=rZdC1f1WIxU"&gt;https://www.youtube.com/watch?v=rZdC1f1WIxU&lt;/a&gt;&#xD;
16
+ &lt;br /&gt;&lt;br /&gt;&#xD;
17
+ Visit Us at &lt;a href="http://www.Ship200.com"&gt;www.Ship200.com&lt;/a&gt;</description>
18
+ <notes>nothing</notes>
19
+ <authors><author><name>Ship200</name><user>Ship200</user><email>bell@ship200.com</email></author></authors>
20
+ <date>2014-07-21</date>
21
+ <time>13:18:45</time>
22
+ <contents><target name="magelocal"><dir name="Ship200"><dir name="Onebyone"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="View.php" hash="9e493ba3a3351061af3c655d9b09bab2"/></dir></dir><file name="Ship200.php" hash="c43d15e9f75a7fdfc163c8314e9646a6"/><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="1f325984c1daa1704e1e8529f6af8fd5"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="684696810527e63cab3f4dd0b0e0f042"/></dir><dir name="Model"><dir name="Source"><file name="Carrier.php" hash="cee4a17e17bdfa176ebcf090b0645e51"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="Ship200Controller.php" hash="c0570021dacf790f74514a55a82fc960"/></dir><file name="IndexController.php" hash="ffd395045f492d1d89bb913273d042b4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f3ca9a4f15afc39ce63aa4478c88bfcf"/><file name="config.xml" hash="6376c4f5758f645a7175f8e1a30beda9"/><file name="system.xml" hash="b09f4850717c6ba6337459ac9b238c4f"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="Ship200_onebyone.xml" hash="958bafb8d90b63cf2d8c783a0eadc7d5"/></dir><dir name="template"><dir name="onebyone"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="f50ef6fde79f7288ca7e645bb22c6fe6"/></dir></dir></dir><file name="ship200.phtml" hash="0a12ec3e50b74ebe1fbacfc452a698df"/><dir name="system"><dir name="config"><file name="button.phtml" hash="de35b412e052ce2c082212dde277e79c"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ship200_Onebyone.xml" hash="c66ea49dc8acfcc0ed30a3348c7c29f7"/></dir></target></contents>
23
+ <compatible/>
24
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
25
+ </package>