Version Notes
Version destinée à Magento 1.6.X et supérieures
------------
Support du multi-shipping.
Correction sur le filtrage des commandes pour l'export.
Correction du nom de point relais manquant dans les exports.
Modification de libellé en admin pour explication du Quickcost.
Download this release
Release Info
Developer | Benjamin GOSSELET |
Extension | Chronopost |
Version | 0.2.0 |
Comparing to | |
See all releases |
Code changes from version 0.1.7.1 to 0.2.0
- app/code/community/Chronopost/Chronorelais/Block/Checkout/Multishipping/Shipping/Method/Chronorelais.php +52 -0
- app/code/community/Chronopost/Chronorelais/Block/Export/Orders/Grid.php +254 -236
- app/code/community/Chronopost/Chronorelais/Block/Sales/Shipment/Copy of Grid.php +0 -139
- app/code/community/Chronopost/Chronorelais/Block/Sales/Shipment/Grid-bkp-03-02-11.php +0 -143
- app/code/community/Chronopost/Chronorelais/Block/Sales/Shipment/Grid.php +203 -185
- app/code/community/Chronopost/Chronorelais/controllers/Checkout/MultishippingController.php +114 -0
- app/code/community/Chronopost/Chronorelais/controllers/Checkout/OnepageController.php +284 -656
- app/code/community/Chronopost/Chronorelais/controllers/ExportController.php +444 -445
- app/code/community/Chronopost/Chronorelais/controllers/ImportController.php +248 -248
- app/code/community/Chronopost/Chronorelais/controllers/Sales/ImpressionController.php +566 -555
- app/code/community/Chronopost/Chronorelais/controllers/Sales/Order/ShipmentController.php +274 -268
- app/code/community/Chronopost/Chronorelais/etc/config.xml +344 -339
- app/code/community/Chronopost/Chronorelais/etc/system.xml +964 -964
- app/design/frontend/default/default/layout/chronorelais.xml +59 -43
- app/design/frontend/default/default/template/chronorelais/checkout/multishipping/shipping.phtml +152 -0
- app/design/frontend/default/default/template/chronorelais/checkout/multishipping/shipping_method/chronorelais.phtml +30 -0
- app/design/frontend/default/default/template/chronorelais/checkout/onepage/shipping_method/chronorelais.phtml +29 -28
- app/locale/en_US/Chronopost_Chronorelais.csv +1 -0
- app/locale/fr_FR/Chronopost_Chronorelais.csv +1 -0
- package.xml +32 -26
- skin/frontend/default/default/chronorelais/chronorelais.css +46 -46
- skin/frontend/default/default/chronorelais/chronorelais.png +0 -0
- skin/frontend/default/default/chronorelais/chronorelaismap.js +569 -463
app/code/community/Chronopost/Chronorelais/Block/Checkout/Multishipping/Shipping/Method/Chronorelais.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Checkout
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* One page checkout status
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @category Mage
|
32 |
+
* @package Mage_Checkout
|
33 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
34 |
+
*/
|
35 |
+
class Chronopost_Chronorelais_Block_Checkout_Multishipping_Shipping_Method_Chronorelais extends Mage_Checkout_Block_Onepage_Abstract
|
36 |
+
{
|
37 |
+
protected $_chronorelais;
|
38 |
+
|
39 |
+
public function getChronorelais()
|
40 |
+
{
|
41 |
+
if (empty($this->_chronorelais)) {
|
42 |
+
$postcode = Mage::getSingleton('core/session')->getMultiPostcode();
|
43 |
+
|
44 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl",array('trace'=> 0,'connection_timeout'=>10));
|
45 |
+
$webservbt = $client->__call("rechercheBtParCodeproduitEtCodepostalEtDate",array(0,$postcode,0));
|
46 |
+
$this->_chronorelais = $webservbt;
|
47 |
+
}
|
48 |
+
|
49 |
+
return $this->_chronorelais;
|
50 |
+
}
|
51 |
+
|
52 |
+
}
|
app/code/community/Chronopost/Chronorelais/Block/Export/Orders/Grid.php
CHANGED
@@ -1,236 +1,254 @@
|
|
1 |
-
<?php
|
2 |
-
class Chronopost_Chronorelais_Block_Export_Orders_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
-
{
|
4 |
-
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('chronorelais_export_order_grid');
|
9 |
-
$this->
|
10 |
-
$this->
|
11 |
-
$this->
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
*
|
17 |
-
*
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
$
|
28 |
-
|
29 |
-
if($
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
$collection->join('
|
34 |
-
|
35 |
-
$collection->getSelect()->
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
$this->
|
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 |
-
'index' => '
|
104 |
-
'
|
105 |
-
|
106 |
-
|
107 |
-
));
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
'filter' => false,
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
'
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
return
|
175 |
-
}
|
176 |
-
|
177 |
-
protected function
|
178 |
-
|
179 |
-
$this->setMassactionIdField('entity_id');
|
180 |
-
$this->getMassactionBlock()->setFormFieldName('order_ids');
|
181 |
-
$this->getMassactionBlock()->setUseSelectAll(false);
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Chronopost_Chronorelais_Block_Export_Orders_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('chronorelais_export_order_grid');
|
9 |
+
$this->setUseAjax(false);
|
10 |
+
$this->setDefaultSort('created_at');
|
11 |
+
$this->setDefaultDir('DESC');
|
12 |
+
$this->setSaveParametersInSession(true);
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Retrieve collection class
|
17 |
+
*
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
protected function _getCollectionClass()
|
21 |
+
{
|
22 |
+
return 'sales/order_grid_collection';
|
23 |
+
}
|
24 |
+
|
25 |
+
protected function _prepareCollection()
|
26 |
+
{
|
27 |
+
$_chronopost_deliver_saturday = Mage::helper('chronorelais')->getConfigData('carriers/chronopost/deliver_on_saturday');
|
28 |
+
$_chronorelais_deliver_saturday = Mage::helper('chronorelais')->getConfigData('carriers/chronorelais/deliver_on_saturday');
|
29 |
+
if($_chronopost_deliver_saturday==1) { $_chronopost_deliver_saturday = 'Yes'; } else { $_chronopost_deliver_saturday = 'No';}
|
30 |
+
if($_chronorelais_deliver_saturday==1) { $_chronorelais_deliver_saturday = 'Yes'; } else { $_chronorelais_deliver_saturday = 'No'; }
|
31 |
+
|
32 |
+
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
33 |
+
$collection->join('order', 'main_table.entity_id = order.entity_id', 'shipping_description');
|
34 |
+
$collection->join('order_payment', 'main_table.entity_id = order_payment.parent_id', 'method');
|
35 |
+
$collection->getSelect()->joinLeft(array('oes' => Mage::getSingleton('core/resource')->getTableName('sales_chronopost_order_export_status')), 'main_table.entity_id = oes.order_id', array("if(isNull(oes.livraison_le_samedi), CASE LOWER(SUBSTRING_INDEX(order.shipping_method,'_','1')) WHEN 'chronopost' THEN '$_chronopost_deliver_saturday' WHEN 'chronorelais' THEN '$_chronorelais_deliver_saturday' WHEN 'chronoexpress' THEN '--' ELSE 'No' END, oes.livraison_le_samedi) as livraison_le_samedi"));
|
36 |
+
$collection->getSelect()->where('order.shipping_method LIKE "chronorelais%" OR order.shipping_method LIKE "chronopost%" OR order.shipping_method LIKE "chronoexpress%"');
|
37 |
+
|
38 |
+
$this->setCollection($collection);
|
39 |
+
return parent::_prepareCollection();
|
40 |
+
}
|
41 |
+
|
42 |
+
protected function _addColumnFilterToCollection($column)
|
43 |
+
{
|
44 |
+
if ($this->getCollection()) {
|
45 |
+
$field = ( $column->getFilterIndex() ) ? $column->getFilterIndex() : $column->getIndex();
|
46 |
+
if ($column->getFilterConditionCallback()) {
|
47 |
+
call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
|
48 |
+
} else {
|
49 |
+
$cond = $column->getFilter()->getCondition();
|
50 |
+
if ($field && isset($cond)) {
|
51 |
+
// Le champ status est ambigu, il faut donc sp�cifier sa table lors de l'ajout pour filtrage
|
52 |
+
$this->getCollection()->addFieldToFilter($field == "status" ? "main_table.status" : $field, $cond);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
return $this;
|
57 |
+
}
|
58 |
+
|
59 |
+
protected function _prepareColumns()
|
60 |
+
{
|
61 |
+
|
62 |
+
$this->addColumn('real_order_id', array(
|
63 |
+
'header'=> Mage::helper('sales')->__('Order #'),
|
64 |
+
'width' => '80px',
|
65 |
+
'type' => 'text',
|
66 |
+
'index' => 'increment_id',
|
67 |
+
'filter' => false,
|
68 |
+
));
|
69 |
+
|
70 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
71 |
+
$this->addColumn('store_id', array(
|
72 |
+
'header' => Mage::helper('sales')->__('Purchased From (Store)'),
|
73 |
+
'index' => 'store_id',
|
74 |
+
'type' => 'store',
|
75 |
+
'store_view'=> true,
|
76 |
+
'display_deleted' => true,
|
77 |
+
'filter' => false,
|
78 |
+
));
|
79 |
+
}
|
80 |
+
|
81 |
+
$this->addColumn('created_at', array(
|
82 |
+
'header' => Mage::helper('sales')->__('Purchased On'),
|
83 |
+
'index' => 'created_at',
|
84 |
+
'type' => 'datetime',
|
85 |
+
'width' => '100px',
|
86 |
+
'filter' => false,
|
87 |
+
));
|
88 |
+
|
89 |
+
$this->addColumn('billing_name', array(
|
90 |
+
'header' => Mage::helper('sales')->__('Bill to Name'),
|
91 |
+
'index' => 'billing_name',
|
92 |
+
'filter' => false,
|
93 |
+
));
|
94 |
+
|
95 |
+
$this->addColumn('shipping_name', array(
|
96 |
+
'header' => Mage::helper('sales')->__('Ship to Name'),
|
97 |
+
'index' => 'shipping_name',
|
98 |
+
'filter' => false,
|
99 |
+
));
|
100 |
+
|
101 |
+
$this->addColumn('base_grand_total', array(
|
102 |
+
'header' => Mage::helper('sales')->__('G.T. (Base)'),
|
103 |
+
'index' => 'base_grand_total',
|
104 |
+
'type' => 'currency',
|
105 |
+
'currency' => 'base_currency_code',
|
106 |
+
'filter' => false,
|
107 |
+
));
|
108 |
+
|
109 |
+
$this->addColumn('grand_total', array(
|
110 |
+
'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
|
111 |
+
'index' => 'grand_total',
|
112 |
+
'type' => 'currency',
|
113 |
+
'currency' => 'order_currency_code',
|
114 |
+
'filter' => false,
|
115 |
+
));
|
116 |
+
|
117 |
+
$this->addColumn('shipping_description', array(
|
118 |
+
'header'=> Mage::helper('sales')->__('Shipping Method'),
|
119 |
+
'width' => '80px',
|
120 |
+
'type' => 'text',
|
121 |
+
'index' => 'shipping_description',
|
122 |
+
'filter' => false,
|
123 |
+
'truncate' => 30,
|
124 |
+
'escape' => true,
|
125 |
+
));
|
126 |
+
|
127 |
+
$this->addColumn('payment', array(
|
128 |
+
'header' => Mage::helper('sales')->__('Mode de Paiement'),
|
129 |
+
'index' => 'method',
|
130 |
+
'width' => '100px',
|
131 |
+
'type' => 'text',
|
132 |
+
'filter' => false,
|
133 |
+
));
|
134 |
+
|
135 |
+
if($is_sending_day = Mage::helper('chronorelais')->isSendingDay()) {
|
136 |
+
$this->addColumn('livraison_le_samedi', array(
|
137 |
+
'header' => Mage::helper('sales')->__('Livraison le Samedi'),
|
138 |
+
'index' => 'livraison_le_samedi',
|
139 |
+
'width' => '100px',
|
140 |
+
'class' => 'a-center',
|
141 |
+
'filter' => false,
|
142 |
+
));
|
143 |
+
}
|
144 |
+
|
145 |
+
$this->addColumn('status', array(
|
146 |
+
'header' => Mage::helper('sales')->__('Status'),
|
147 |
+
'index' => 'status',
|
148 |
+
'type' => 'options',
|
149 |
+
'width' => '70px',
|
150 |
+
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
|
151 |
+
));
|
152 |
+
|
153 |
+
if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
|
154 |
+
$this->addColumn('action',
|
155 |
+
array(
|
156 |
+
'header' => Mage::helper('sales')->__('Action'),
|
157 |
+
'width' => '50px',
|
158 |
+
'type' => 'action',
|
159 |
+
'getter' => 'getId',
|
160 |
+
'actions' => array(
|
161 |
+
array(
|
162 |
+
'caption' => Mage::helper('sales')->__('View'),
|
163 |
+
'url' => array('base'=>'adminhtml/sales_order/view'),
|
164 |
+
'field' => 'order_id'
|
165 |
+
)
|
166 |
+
),
|
167 |
+
'filter' => false,
|
168 |
+
'sortable' => false,
|
169 |
+
'index' => 'stores',
|
170 |
+
'is_system' => true,
|
171 |
+
));
|
172 |
+
}
|
173 |
+
|
174 |
+
return parent::_prepareColumns();
|
175 |
+
}
|
176 |
+
|
177 |
+
protected function _prepareMassaction111()
|
178 |
+
{
|
179 |
+
$this->setMassactionIdField('entity_id');
|
180 |
+
$this->getMassactionBlock()->setFormFieldName('order_ids');
|
181 |
+
$this->getMassactionBlock()->setUseSelectAll(false);
|
182 |
+
|
183 |
+
$this->getMassactionBlock()->addItem('export_css', array(
|
184 |
+
'label'=> Mage::helper('chronorelais')->__('Export CSS'),
|
185 |
+
'url' => $this->getUrl('*/*/exportcss'),
|
186 |
+
));
|
187 |
+
$this->getMassactionBlock()->addItem('export_cso', array(
|
188 |
+
'label'=> Mage::helper('chronorelais')->__('Export CSO'),
|
189 |
+
'url' => $this->getUrl('*/*/exportcso'),
|
190 |
+
));
|
191 |
+
|
192 |
+
return $this;
|
193 |
+
}
|
194 |
+
|
195 |
+
protected function _prepareMassaction()
|
196 |
+
{
|
197 |
+
$this->setMassactionIdField('entity_id');
|
198 |
+
$this->getMassactionBlock()->setFormFieldName('order_ids');
|
199 |
+
$this->getMassactionBlock()->setUseSelectAll(false);
|
200 |
+
|
201 |
+
if($is_sending_day = Mage::helper('chronorelais')->isSendingDay()) {
|
202 |
+
$shipping = array(
|
203 |
+
'Yes' => Mage::helper('chronorelais')->__('Yes'),
|
204 |
+
'No' => Mage::helper('chronorelais')->__('No'));
|
205 |
+
$this->getMassactionBlock()->addItem('shipping', array(
|
206 |
+
'label' => Mage::helper('chronorelais')->__('Livraison le Samedi'),
|
207 |
+
'url' => $this->getUrl('*/*/massLivraisonSamediStatus', array('_current'=>true)),
|
208 |
+
'additional' => array(
|
209 |
+
'visibility' => array(
|
210 |
+
'name' => 'status',
|
211 |
+
'type' => 'select',
|
212 |
+
'class' => 'required-entry',
|
213 |
+
'style' => 'width:80px',
|
214 |
+
'label' => Mage::helper('chronorelais')->__('Status'),
|
215 |
+
'values' => $shipping
|
216 |
+
)
|
217 |
+
)
|
218 |
+
));
|
219 |
+
}
|
220 |
+
|
221 |
+
$export = array(
|
222 |
+
'css' => Mage::helper('chronorelais')->__('CSS Format'),
|
223 |
+
'cso' => Mage::helper('chronorelais')->__('CSO Format'));
|
224 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
225 |
+
$this->getMassactionBlock()->addItem('export', array(
|
226 |
+
'label'=> Mage::helper('chronorelais')->__('Export'),
|
227 |
+
'url' => $this->getUrl('*/*/massExport', array('_current'=>true)),
|
228 |
+
'additional' => array(
|
229 |
+
'visibility' => array(
|
230 |
+
'name' => 'format',
|
231 |
+
'type' => 'select',
|
232 |
+
'class' => 'required-entry',
|
233 |
+
'label' => Mage::helper('chronorelais')->__('Format'),
|
234 |
+
'values' => $export
|
235 |
+
)
|
236 |
+
)
|
237 |
+
));
|
238 |
+
return $this;
|
239 |
+
}
|
240 |
+
|
241 |
+
public function getRowUrl($row)
|
242 |
+
{
|
243 |
+
if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
|
244 |
+
return $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getId()));
|
245 |
+
}
|
246 |
+
return false;
|
247 |
+
}
|
248 |
+
|
249 |
+
public function getGridUrl()
|
250 |
+
{
|
251 |
+
return $this->getUrl('*/*/*', array('_current'=>true));
|
252 |
+
}
|
253 |
+
|
254 |
+
}
|
app/code/community/Chronopost/Chronorelais/Block/Sales/Shipment/Copy of Grid.php
DELETED
@@ -1,139 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Chronopost_Chronorelais_Block_Sales_Shipment_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
-
{
|
4 |
-
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('sales_shipment_grid');
|
9 |
-
$this->setDefaultSort('order_created_at');
|
10 |
-
$this->setDefaultDir('DESC');
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Retrieve collection class
|
15 |
-
*
|
16 |
-
* @return string
|
17 |
-
*/
|
18 |
-
protected function _getCollectionClass()
|
19 |
-
{
|
20 |
-
return 'sales/order_shipment_grid_collection';
|
21 |
-
}
|
22 |
-
|
23 |
-
protected function _prepareCollection()
|
24 |
-
{
|
25 |
-
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
26 |
-
$collection->getSelect()->columns(array('shipment_created_at' => 'main_table.created_at'));
|
27 |
-
$collection->getSelect()->columns(array('shipment_increment_id' => 'main_table.increment_id'));
|
28 |
-
|
29 |
-
$collection->getSelect()->joinLeft(array('ot' => $collection->getTable('sales/order')), 'main_table.order_id = ot.entity_id');
|
30 |
-
$collection->getSelect()->joinLeft(array('ost' => $collection->getTable('sales/shipment_track')), 'ot.entity_id = ost.order_id');
|
31 |
-
|
32 |
-
$collection->getSelect()->where('ot.shipping_method LIKE "chronorelais%" OR ot.shipping_method LIKE "chronopost%"');
|
33 |
-
$this->setCollection($collection);
|
34 |
-
return parent::_prepareCollection();
|
35 |
-
}
|
36 |
-
|
37 |
-
protected function _prepareColumns()
|
38 |
-
{
|
39 |
-
$this->addColumn('increment_id', array(
|
40 |
-
'header' => Mage::helper('sales')->__('Shipment #'),
|
41 |
-
'index' => 'shipment_increment_id',
|
42 |
-
'type' => 'text',
|
43 |
-
));
|
44 |
-
|
45 |
-
$this->addColumn('shipment_created_at', array(
|
46 |
-
'header' => Mage::helper('sales')->__('Date Shipped'),
|
47 |
-
'index' => 'shipment_created_at',
|
48 |
-
'type' => 'datetime',
|
49 |
-
));
|
50 |
-
|
51 |
-
$this->addColumn('order_increment_id', array(
|
52 |
-
'header' => Mage::helper('sales')->__('Order #'),
|
53 |
-
'index' => 'order_increment_id',
|
54 |
-
'type' => 'number',
|
55 |
-
));
|
56 |
-
|
57 |
-
$this->addColumn('order_created_at', array(
|
58 |
-
'header' => Mage::helper('sales')->__('Order Date'),
|
59 |
-
'index' => 'order_created_at',
|
60 |
-
'type' => 'datetime',
|
61 |
-
));
|
62 |
-
|
63 |
-
$this->addColumn('shipping_name', array(
|
64 |
-
'header' => Mage::helper('sales')->__('Ship to Name'),
|
65 |
-
'index' => 'shipping_name',
|
66 |
-
));
|
67 |
-
|
68 |
-
$this->addColumn('total_qty', array(
|
69 |
-
'header' => Mage::helper('sales')->__('Total Qty'),
|
70 |
-
'index' => 'total_qty',
|
71 |
-
'type' => 'number',
|
72 |
-
));
|
73 |
-
|
74 |
-
$this->addColumn('number', array(
|
75 |
-
'header' => Mage::helper('sales')->__('Tracking'),
|
76 |
-
'index' => 'number',
|
77 |
-
));
|
78 |
-
|
79 |
-
$this->addColumn('title', array(
|
80 |
-
'header' => Mage::helper('sales')->__('Mode de transport'),
|
81 |
-
'index' => 'title',
|
82 |
-
'type' => 'text',
|
83 |
-
));
|
84 |
-
|
85 |
-
$this->addColumn('download', array(
|
86 |
-
'header' => Mage::helper('chronorelais')->__('Etiquettes'),
|
87 |
-
'type' => 'action',
|
88 |
-
'getter' => 'getParentId',
|
89 |
-
'actions' => array(
|
90 |
-
array(
|
91 |
-
'caption' => Mage::helper('chronorelais')->__('Imprimer'),
|
92 |
-
'url' => array(
|
93 |
-
'base'=>'chronorelais/sales_impression/print'
|
94 |
-
),
|
95 |
-
'field' => 'shipment_id'
|
96 |
-
)
|
97 |
-
),
|
98 |
-
'filter' => false,
|
99 |
-
'sortable' => false,
|
100 |
-
'index' => 'stores'
|
101 |
-
));
|
102 |
-
|
103 |
-
return parent::_prepareColumns();
|
104 |
-
}
|
105 |
-
|
106 |
-
public function getRowUrl($row)
|
107 |
-
{
|
108 |
-
if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/shipment')) {
|
109 |
-
return false;
|
110 |
-
}
|
111 |
-
|
112 |
-
return $this->getUrl('adminhtml/sales_shipment/view',
|
113 |
-
array(
|
114 |
-
'shipment_id'=> $row->getParentId(),
|
115 |
-
)
|
116 |
-
);
|
117 |
-
}
|
118 |
-
|
119 |
-
protected function _prepareMassaction()
|
120 |
-
{
|
121 |
-
$this->setMassactionIdField('entity_id');
|
122 |
-
$this->getMassactionBlock()->setFormFieldName('shipment_ids');
|
123 |
-
$this->getMassactionBlock()->setUseSelectAll(false);
|
124 |
-
|
125 |
-
// Impression des étiquettes
|
126 |
-
/*$this->getMassactionBlock()->addItem('pdfshipments_order', array(
|
127 |
-
'label'=> Mage::helper('sales')->__('Imprimer les étiquettes'),
|
128 |
-
'url' => $this->getUrl('chronorelais/sales_impression/printMass'),
|
129 |
-
));*/
|
130 |
-
|
131 |
-
return $this;
|
132 |
-
}
|
133 |
-
|
134 |
-
public function getGridUrl()
|
135 |
-
{
|
136 |
-
return $this->getUrl('*/*/*', array('_current' => true));
|
137 |
-
}
|
138 |
-
|
139 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Chronopost/Chronorelais/Block/Sales/Shipment/Grid-bkp-03-02-11.php
DELETED
@@ -1,143 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Chronopost_Chronorelais_Block_Sales_Shipment_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
-
{
|
4 |
-
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('sales_shipment_grid');
|
9 |
-
$this->setDefaultSort('shipment_created_at');
|
10 |
-
$this->setDefaultDir('DESC');
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Retrieve collection class
|
15 |
-
*
|
16 |
-
* @return string
|
17 |
-
*/
|
18 |
-
protected function _getCollectionClass()
|
19 |
-
{
|
20 |
-
return 'sales/order_collection';
|
21 |
-
}
|
22 |
-
|
23 |
-
protected function _prepareCollection()
|
24 |
-
{
|
25 |
-
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
26 |
-
$collection->getSelect()->columns(array('shipment_created_at' => 'osg.created_at'));
|
27 |
-
$collection->getSelect()->columns(array('shipment_increment_id' => 'osg.increment_id'));
|
28 |
-
$collection->getSelect()->columns(array('shipping_method' => 'main_table.shipping_method'));
|
29 |
-
|
30 |
-
$collection->getSelect()->joinLeft(array('ost' => $collection->getTable('sales/shipment_track')), 'main_table.entity_id = ost.order_id', array('if(isNull(ost.number) , "--" , ost.number) as number', 'if(isNull(ost.title) , "--" , ost.title) as title'));
|
31 |
-
$collection->getSelect()->joinRight(array('osg' => $collection->getTable('sales/shipment_grid')), 'osg.order_id = main_table.entity_id');
|
32 |
-
$collection->getSelect()->where('shipping_method LIKE "chronorelais%" OR shipping_method LIKE "chronopost%"');
|
33 |
-
$collection->getSelect()->group('osg.entity_id');
|
34 |
-
|
35 |
-
|
36 |
-
$this->setCollection($collection);
|
37 |
-
|
38 |
-
return parent::_prepareCollection();
|
39 |
-
}
|
40 |
-
|
41 |
-
protected function _prepareColumns()
|
42 |
-
{
|
43 |
-
$this->addColumn('increment_id', array(
|
44 |
-
'header' => Mage::helper('sales')->__('Shipment #'),
|
45 |
-
'index' => 'shipment_increment_id',
|
46 |
-
'type' => 'text',
|
47 |
-
));
|
48 |
-
|
49 |
-
$this->addColumn('shipment_created_at', array(
|
50 |
-
'header' => Mage::helper('sales')->__('Date Shipped'),
|
51 |
-
'index' => 'shipment_created_at',
|
52 |
-
'type' => 'datetime',
|
53 |
-
));
|
54 |
-
|
55 |
-
$this->addColumn('order_increment_id', array(
|
56 |
-
'header' => Mage::helper('sales')->__('Order #'),
|
57 |
-
'index' => 'order_increment_id',
|
58 |
-
'type' => 'number',
|
59 |
-
));
|
60 |
-
|
61 |
-
$this->addColumn('order_created_at', array(
|
62 |
-
'header' => Mage::helper('sales')->__('Order Date'),
|
63 |
-
'index' => 'order_created_at',
|
64 |
-
'type' => 'datetime',
|
65 |
-
));
|
66 |
-
|
67 |
-
$this->addColumn('shipping_name', array(
|
68 |
-
'header' => Mage::helper('sales')->__('Ship to Name'),
|
69 |
-
'index' => 'shipping_name',
|
70 |
-
));
|
71 |
-
|
72 |
-
$this->addColumn('total_qty', array(
|
73 |
-
'header' => Mage::helper('sales')->__('Total Qty'),
|
74 |
-
'index' => 'total_qty',
|
75 |
-
'type' => 'number',
|
76 |
-
));
|
77 |
-
|
78 |
-
$this->addColumn('number', array(
|
79 |
-
'header' => Mage::helper('sales')->__('Tracking'),
|
80 |
-
'index' => 'number',
|
81 |
-
));
|
82 |
-
|
83 |
-
$this->addColumn('title', array(
|
84 |
-
'header' => Mage::helper('sales')->__('Mode de transport'),
|
85 |
-
'index' => 'title',
|
86 |
-
'type' => 'text',
|
87 |
-
));
|
88 |
-
|
89 |
-
$this->addColumn('download', array(
|
90 |
-
'header' => Mage::helper('chronorelais')->__('Etiquettes'),
|
91 |
-
'type' => 'action',
|
92 |
-
'getter' => 'getId',
|
93 |
-
'actions' => array(
|
94 |
-
array(
|
95 |
-
'caption' => Mage::helper('chronorelais')->__('Imprimer'),
|
96 |
-
'url' => array(
|
97 |
-
'base'=>'chronorelais/sales_impression/print'
|
98 |
-
),
|
99 |
-
'field' => 'shipment_id'
|
100 |
-
)
|
101 |
-
),
|
102 |
-
'filter' => false,
|
103 |
-
'sortable' => false,
|
104 |
-
'index' => 'stores'
|
105 |
-
));
|
106 |
-
|
107 |
-
return parent::_prepareColumns();
|
108 |
-
}
|
109 |
-
|
110 |
-
public function getRowUrl($row)
|
111 |
-
{
|
112 |
-
if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/shipment')) {
|
113 |
-
return false;
|
114 |
-
}
|
115 |
-
|
116 |
-
return $this->getUrl('adminhtml/sales_shipment/view',
|
117 |
-
array(
|
118 |
-
'shipment_id'=> $row->getId(),
|
119 |
-
)
|
120 |
-
);
|
121 |
-
}
|
122 |
-
|
123 |
-
protected function _prepareMassaction()
|
124 |
-
{
|
125 |
-
$this->setMassactionIdField('entity_id');
|
126 |
-
$this->getMassactionBlock()->setFormFieldName('shipment_ids');
|
127 |
-
$this->getMassactionBlock()->setUseSelectAll(false);
|
128 |
-
|
129 |
-
// Impression des étiquettes
|
130 |
-
/*$this->getMassactionBlock()->addItem('pdfshipments_order', array(
|
131 |
-
'label'=> Mage::helper('sales')->__('Imprimer les étiquettes'),
|
132 |
-
'url' => $this->getUrl('chronorelais/sales_impression/printMass'),
|
133 |
-
));*/
|
134 |
-
|
135 |
-
return $this;
|
136 |
-
}
|
137 |
-
|
138 |
-
public function getGridUrl()
|
139 |
-
{
|
140 |
-
return $this->getUrl('*/*/*', array('_current' => true));
|
141 |
-
}
|
142 |
-
|
143 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Chronopost/Chronorelais/Block/Sales/Shipment/Grid.php
CHANGED
@@ -1,185 +1,203 @@
|
|
1 |
-
<?php
|
2 |
-
class Chronopost_Chronorelais_Block_Sales_Shipment_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
-
{
|
4 |
-
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('sales_order_grid');
|
9 |
-
$this->setDefaultSort('created_at');
|
10 |
-
$this->setDefaultDir('DESC');
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Retrieve collection class
|
15 |
-
*
|
16 |
-
* @return string
|
17 |
-
*/
|
18 |
-
protected function _getCollectionClass()
|
19 |
-
{
|
20 |
-
return 'sales/order_grid_collection';
|
21 |
-
}
|
22 |
-
|
23 |
-
protected function _prepareCollection()
|
24 |
-
{
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
protected function _prepareColumns()
|
48 |
-
{
|
49 |
-
|
50 |
-
$this->addColumn('real_order_id', array(
|
51 |
-
'header'=> Mage::helper('sales')->__('Order #'),
|
52 |
-
'width' => '100px',
|
53 |
-
'type' => 'text',
|
54 |
-
'index' => 'increment_id',
|
55 |
-
'filter' => false,
|
56 |
-
));
|
57 |
-
|
58 |
-
$this->addColumn('created_at', array(
|
59 |
-
'header' => Mage::helper('sales')->__('Order Date'),
|
60 |
-
'index' => 'created_at',
|
61 |
-
'type' => 'datetime',
|
62 |
-
'filter' => false,
|
63 |
-
));
|
64 |
-
|
65 |
-
$this->addColumn('shipment_increment_id', array(
|
66 |
-
'header' => Mage::helper('sales')->__('Shipment #'),
|
67 |
-
'index' => 'shipment_increment_id',
|
68 |
-
'type' => 'text',
|
69 |
-
'width' => '100px',
|
70 |
-
'filter' => false,
|
71 |
-
));
|
72 |
-
|
73 |
-
$this->addColumn('shipment_created_at', array(
|
74 |
-
'header' => Mage::helper('sales')->__('Date Shipped'),
|
75 |
-
'index' => 'shipment_created_at',
|
76 |
-
'type' => 'datetime',
|
77 |
-
'filter' => false,
|
78 |
-
));
|
79 |
-
|
80 |
-
$this->addColumn('shipping_name', array(
|
81 |
-
'header' => Mage::helper('sales')->__('Ship to Name'),
|
82 |
-
'index' => 'shipping_name',
|
83 |
-
'filter' => false,
|
84 |
-
));
|
85 |
-
|
86 |
-
$this->addColumn('total_qty_ordered', array(
|
87 |
-
'header' => Mage::helper('sales')->__('Total Qty'),
|
88 |
-
'index' => 'total_qty_ordered',
|
89 |
-
'type' => 'number',
|
90 |
-
'filter' => false,
|
91 |
-
));
|
92 |
-
|
93 |
-
$this->addColumn('
|
94 |
-
'header' => Mage::helper('sales')->__('Tracking'),
|
95 |
-
'index' => '
|
96 |
-
'filter' => false,
|
97 |
-
));
|
98 |
-
|
99 |
-
$this->addColumn('shipping_method', array(
|
100 |
-
'header' => Mage::helper('sales')->__('Mode de transport'),
|
101 |
-
'index' => 'shipping_method',
|
102 |
-
'type' => 'text',
|
103 |
-
'filter' => false,
|
104 |
-
));
|
105 |
-
|
106 |
-
if($is_sending_day = Mage::helper('chronorelais')->isSendingDay()) {
|
107 |
-
$this->addColumn('livraison_le_samedi', array(
|
108 |
-
'header' => Mage::helper('sales')->__('Livraison le Samedi'),
|
109 |
-
'index' => 'livraison_le_samedi',
|
110 |
-
'width' => '100px',
|
111 |
-
'class' => 'a-center',
|
112 |
-
'filter' => false,
|
113 |
-
));
|
114 |
-
}
|
115 |
-
|
116 |
-
$this->addColumn('download', array(
|
117 |
-
'header' => Mage::helper('chronorelais')->__('Etiquettes'),
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
));
|
134 |
-
|
135 |
-
return parent::_prepareColumns();
|
136 |
-
}
|
137 |
-
|
138 |
-
public function getRowUrl($row)
|
139 |
-
{
|
140 |
-
if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/shipment')) {
|
141 |
-
return false;
|
142 |
-
}
|
143 |
-
|
144 |
-
return $this->getUrl('adminhtml/sales_order/view',
|
145 |
-
array(
|
146 |
-
'order_id'=> $row->getId(),
|
147 |
-
)
|
148 |
-
);
|
149 |
-
}
|
150 |
-
|
151 |
-
protected function _prepareMassaction()
|
152 |
-
{
|
153 |
-
if($is_sending_day = Mage::helper('chronorelais')->isSendingDay()) {
|
154 |
-
$this->setMassactionIdField('entity_id');
|
155 |
-
$this->getMassactionBlock()->setFormFieldName('order_ids');
|
156 |
-
$this->getMassactionBlock()->setUseSelectAll(false);
|
157 |
-
|
158 |
-
$shipping = array(
|
159 |
-
'Yes' => Mage::helper('chronorelais')->__('Yes'),
|
160 |
-
'No' => Mage::helper('chronorelais')->__('No'));
|
161 |
-
$this->getMassactionBlock()->addItem('shipping', array(
|
162 |
-
'label' => Mage::helper('chronorelais')->__('Livraison le Samedi'),
|
163 |
-
'url' => $this->getUrl('*/*/massLivraisonSamediStatus', array('_current'=>true)),
|
164 |
-
'additional' => array(
|
165 |
-
'visibility' => array(
|
166 |
-
'name' => 'status',
|
167 |
-
'type' => 'select',
|
168 |
-
'class' => 'required-entry',
|
169 |
-
'style' => 'width:80px',
|
170 |
-
'label' => Mage::helper('chronorelais')->__('Status'),
|
171 |
-
'values' => $shipping
|
172 |
-
)
|
173 |
-
)
|
174 |
-
));
|
175 |
-
|
176 |
-
return $this;
|
177 |
-
}
|
178 |
-
}
|
179 |
-
|
180 |
-
public function getGridUrl()
|
181 |
-
{
|
182 |
-
return $this->getUrl('*/*/*', array('_current' => true));
|
183 |
-
}
|
184 |
-
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Chronopost_Chronorelais_Block_Sales_Shipment_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('sales_order_grid');
|
9 |
+
$this->setDefaultSort('created_at');
|
10 |
+
$this->setDefaultDir('DESC');
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Retrieve collection class
|
15 |
+
*
|
16 |
+
* @return string
|
17 |
+
*/
|
18 |
+
protected function _getCollectionClass()
|
19 |
+
{
|
20 |
+
return 'sales/order_grid_collection';
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function _prepareCollection()
|
24 |
+
{
|
25 |
+
$_chronopost_deliver_saturday = Mage::helper('chronorelais')->getConfigData('carriers/chronopost/deliver_on_saturday');
|
26 |
+
$_chronorelais_deliver_saturday = Mage::helper('chronorelais')->getConfigData('carriers/chronorelais/deliver_on_saturday');
|
27 |
+
if($_chronopost_deliver_saturday==1) { $_chronopost_deliver_saturday = 'Yes'; } else { $_chronopost_deliver_saturday = 'No';}
|
28 |
+
if($_chronorelais_deliver_saturday==1) { $_chronorelais_deliver_saturday = 'Yes'; } else { $_chronorelais_deliver_saturday = 'No'; }
|
29 |
+
|
30 |
+
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
31 |
+
$collection->getSelect()->joinLeft(array('og' => $collection->getTable('sales/order')), 'main_table.entity_id = og.entity_id', array('CASE LOWER(SUBSTRING_INDEX(og.shipping_method,"_","1")) WHEN "chronoexpress" THEN "Chrono Express" WHEN "chronorelais" THEN "Chrono Relais" ELSE CONCAT(UCASE(SUBSTRING(SUBSTRING_INDEX(og.shipping_method,"_","1"),1,1)),LOWER(SUBSTRING(SUBSTRING_INDEX(og.shipping_method,"_","1"), 2))) END as shipping_method', 'og.total_qty_ordered'));
|
32 |
+
$collection->getSelect()->joinLeft(array('osg' => $collection->getTable('sales/shipment_grid')), 'main_table.entity_id = osg.order_id', array('if(isNull(osg.increment_id) , "--" , GROUP_CONCAT(DISTINCT osg.increment_id SEPARATOR \', \')) as shipment_increment_id', 'GROUP_CONCAT(DISTINCT osg.created_at SEPARATOR \', \') as shipment_created_at'));
|
33 |
+
$collection->getSelect()->joinLeft(array('ost' => $collection->getTable('sales/shipment_track')), 'main_table.entity_id = ost.order_id', array('if(isNull(ost.track_number) , "--" , GROUP_CONCAT(DISTINCT ost.track_number SEPARATOR \', \')) as track_number', 'if(isNull(ost.title) , "--" , GROUP_CONCAT(DISTINCT ost.title SEPARATOR \', \')) as title'));
|
34 |
+
$collection->getSelect()->joinLeft(array('oes' => Mage::getSingleton('core/resource')->getTableName('sales_chronopost_order_export_status')), 'main_table.entity_id = oes.order_id', array("if(isNull(oes.livraison_le_samedi), CASE LOWER(SUBSTRING_INDEX(og.shipping_method,'_','1')) WHEN 'chronopost' THEN '$_chronopost_deliver_saturday' WHEN 'chronorelais' THEN '$_chronorelais_deliver_saturday' WHEN 'chronoexpress' THEN '--' ELSE 'No' END, oes.livraison_le_samedi) as livraison_le_samedi"));
|
35 |
+
$collection->getSelect()->where('og.shipping_method LIKE "chronorelais%" OR og.shipping_method LIKE "chronopost%" OR og.shipping_method LIKE "chronoexpress%"');
|
36 |
+
$collection->getSelect()->group('main_table.entity_id');
|
37 |
+
$sql = $collection->getSelectSql(true);
|
38 |
+
$collection->getSelect()->reset()->from(
|
39 |
+
array('e' =>new Zend_Db_Expr("({$sql})")),
|
40 |
+
array('e' => "*")
|
41 |
+
);
|
42 |
+
|
43 |
+
$this->setCollection($collection);
|
44 |
+
return parent::_prepareCollection();
|
45 |
+
}
|
46 |
+
|
47 |
+
protected function _prepareColumns()
|
48 |
+
{
|
49 |
+
|
50 |
+
$this->addColumn('real_order_id', array(
|
51 |
+
'header'=> Mage::helper('sales')->__('Order #'),
|
52 |
+
'width' => '100px',
|
53 |
+
'type' => 'text',
|
54 |
+
'index' => 'increment_id',
|
55 |
+
'filter' => false,
|
56 |
+
));
|
57 |
+
|
58 |
+
$this->addColumn('created_at', array(
|
59 |
+
'header' => Mage::helper('sales')->__('Order Date'),
|
60 |
+
'index' => 'created_at',
|
61 |
+
'type' => 'datetime',
|
62 |
+
'filter' => false,
|
63 |
+
));
|
64 |
+
|
65 |
+
$this->addColumn('shipment_increment_id', array(
|
66 |
+
'header' => Mage::helper('sales')->__('Shipment #'),
|
67 |
+
'index' => 'shipment_increment_id',
|
68 |
+
'type' => 'text',
|
69 |
+
'width' => '100px',
|
70 |
+
'filter' => false,
|
71 |
+
));
|
72 |
+
|
73 |
+
$this->addColumn('shipment_created_at', array(
|
74 |
+
'header' => Mage::helper('sales')->__('Date Shipped'),
|
75 |
+
'index' => 'shipment_created_at',
|
76 |
+
'type' => 'datetime',
|
77 |
+
'filter' => false,
|
78 |
+
));
|
79 |
+
|
80 |
+
$this->addColumn('shipping_name', array(
|
81 |
+
'header' => Mage::helper('sales')->__('Ship to Name'),
|
82 |
+
'index' => 'shipping_name',
|
83 |
+
'filter' => false,
|
84 |
+
));
|
85 |
+
|
86 |
+
$this->addColumn('total_qty_ordered', array(
|
87 |
+
'header' => Mage::helper('sales')->__('Total Qty'),
|
88 |
+
'index' => 'total_qty_ordered',
|
89 |
+
'type' => 'number',
|
90 |
+
'filter' => false,
|
91 |
+
));
|
92 |
+
|
93 |
+
$this->addColumn('track_number', array(
|
94 |
+
'header' => Mage::helper('sales')->__('Tracking'),
|
95 |
+
'index' => 'track_number',
|
96 |
+
'filter' => false,
|
97 |
+
));
|
98 |
+
|
99 |
+
$this->addColumn('shipping_method', array(
|
100 |
+
'header' => Mage::helper('sales')->__('Mode de transport'),
|
101 |
+
'index' => 'shipping_method',
|
102 |
+
'type' => 'text',
|
103 |
+
'filter' => false,
|
104 |
+
));
|
105 |
+
|
106 |
+
if($is_sending_day = Mage::helper('chronorelais')->isSendingDay()) {
|
107 |
+
$this->addColumn('livraison_le_samedi', array(
|
108 |
+
'header' => Mage::helper('sales')->__('Livraison le Samedi'),
|
109 |
+
'index' => 'livraison_le_samedi',
|
110 |
+
'width' => '100px',
|
111 |
+
'class' => 'a-center',
|
112 |
+
'filter' => false,
|
113 |
+
));
|
114 |
+
}
|
115 |
+
|
116 |
+
$this->addColumn('download', array(
|
117 |
+
'header' => Mage::helper('chronorelais')->__('Etiquettes'),
|
118 |
+
'type' => 'action',
|
119 |
+
'getter' => 'getId',
|
120 |
+
'actions' => array(
|
121 |
+
array(
|
122 |
+
'caption' => Mage::helper('chronorelais')->__('Imprimer'),
|
123 |
+
'url' => array(
|
124 |
+
'base'=>'chronorelais/sales_impression/print'
|
125 |
+
),
|
126 |
+
'target' => '_blank',
|
127 |
+
'field' => 'order_id'
|
128 |
+
)
|
129 |
+
),
|
130 |
+
'filter' => false,
|
131 |
+
'sortable' => false,
|
132 |
+
'index' => 'stores'
|
133 |
+
));
|
134 |
+
|
135 |
+
return parent::_prepareColumns();
|
136 |
+
}
|
137 |
+
|
138 |
+
public function getRowUrl($row)
|
139 |
+
{
|
140 |
+
if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/shipment')) {
|
141 |
+
return false;
|
142 |
+
}
|
143 |
+
|
144 |
+
return $this->getUrl('adminhtml/sales_order/view',
|
145 |
+
array(
|
146 |
+
'order_id'=> $row->getId(),
|
147 |
+
)
|
148 |
+
);
|
149 |
+
}
|
150 |
+
|
151 |
+
protected function _prepareMassaction()
|
152 |
+
{
|
153 |
+
if($is_sending_day = Mage::helper('chronorelais')->isSendingDay()) {
|
154 |
+
$this->setMassactionIdField('entity_id');
|
155 |
+
$this->getMassactionBlock()->setFormFieldName('order_ids');
|
156 |
+
$this->getMassactionBlock()->setUseSelectAll(false);
|
157 |
+
|
158 |
+
$shipping = array(
|
159 |
+
'Yes' => Mage::helper('chronorelais')->__('Yes'),
|
160 |
+
'No' => Mage::helper('chronorelais')->__('No'));
|
161 |
+
$this->getMassactionBlock()->addItem('shipping', array(
|
162 |
+
'label' => Mage::helper('chronorelais')->__('Livraison le Samedi'),
|
163 |
+
'url' => $this->getUrl('*/*/massLivraisonSamediStatus', array('_current'=>true)),
|
164 |
+
'additional' => array(
|
165 |
+
'visibility' => array(
|
166 |
+
'name' => 'status',
|
167 |
+
'type' => 'select',
|
168 |
+
'class' => 'required-entry',
|
169 |
+
'style' => 'width:80px',
|
170 |
+
'label' => Mage::helper('chronorelais')->__('Status'),
|
171 |
+
'values' => $shipping
|
172 |
+
)
|
173 |
+
)
|
174 |
+
));
|
175 |
+
|
176 |
+
return $this;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
public function getGridUrl()
|
181 |
+
{
|
182 |
+
return $this->getUrl('*/*/*', array('_current' => true));
|
183 |
+
}
|
184 |
+
|
185 |
+
public function getAdditionalJavaScript()
|
186 |
+
{
|
187 |
+
echo "$$('#sales_order_grid_table tr td:nth-child(3)').each(function(item) {
|
188 |
+
var chaine = item.innerHTML.replace(/^\s+/g,'').replace(/\s+$/g,'');
|
189 |
+
if (chaine.split(', ').length > 1) {
|
190 |
+
var content = '';
|
191 |
+
var numbers = chaine.split(', ');
|
192 |
+
var lien = $(item).next('.last').down('a');
|
193 |
+
for (var i=0; i<numbers.length; i++) {
|
194 |
+
content += '<a href=\"' + lien.href.replace(/\/order_id\/\d+\//, '/shipment_increment_id/' + numbers[i] + '/') + '\" target=\"_blank\">Expédition ' + numbers[i] + '</a><br />';
|
195 |
+
}
|
196 |
+
content += '';
|
197 |
+
lien.up().innerHTML = content;
|
198 |
+
//lien.writeAttribute('onclick', \"$(this).up().down('div').show(); return false;\");
|
199 |
+
}
|
200 |
+
});";
|
201 |
+
}
|
202 |
+
|
203 |
+
}
|
app/code/community/Chronopost/Chronorelais/controllers/Checkout/MultishippingController.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once 'Mage/Checkout/controllers/MultishippingController.php';
|
4 |
+
class Chronopost_Chronorelais_Checkout_MultishippingController extends Mage_Checkout_MultishippingController
|
5 |
+
{
|
6 |
+
/**
|
7 |
+
* Get payment method step html
|
8 |
+
*
|
9 |
+
* @return string
|
10 |
+
*/
|
11 |
+
protected function _getChronoRelaisHtml()
|
12 |
+
{
|
13 |
+
return $this->getLayout()->getBlock('root')->toHtml();
|
14 |
+
}
|
15 |
+
|
16 |
+
public function shippingPostAction()
|
17 |
+
{
|
18 |
+
$shippingMethods = $this->getRequest()->getPost('shipping_method');
|
19 |
+
try {
|
20 |
+
Mage::dispatchEvent(
|
21 |
+
'checkout_controller_multishipping_shipping_post',
|
22 |
+
array('request'=>$this->getRequest(), 'quote'=>$this->_getCheckout()->getQuote())
|
23 |
+
);
|
24 |
+
$this->_getCheckout()->setShippingMethods($shippingMethods);
|
25 |
+
|
26 |
+
//WEC chronorelais
|
27 |
+
$addresses = $this->_getCheckout()->getQuote()->getAllShippingAddresses();
|
28 |
+
$relays = $this->getRequest()->getParam('shipping_method_chronorelais');
|
29 |
+
foreach ($addresses as $address) {
|
30 |
+
if (isset($shippingMethods[$address->getId()])) {
|
31 |
+
if( substr($shippingMethods[$address->getId()],0,12) == "chronorelais" ){
|
32 |
+
|
33 |
+
$relaisId = $relays[$address->getId()];
|
34 |
+
if($relaisId!=""){
|
35 |
+
|
36 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl");
|
37 |
+
$webservbt = $client->__call("rechercheBtParIdChronopostA2Pas",array($relaisId));
|
38 |
+
$relais = $webservbt[0] ;
|
39 |
+
|
40 |
+
if($relais) {
|
41 |
+
$address->setCity($relais->localite)
|
42 |
+
->setPostcode($relais->codePostal)
|
43 |
+
->setStreet ( trim( $relais->adresse1." ".$relais->adresse2." ".$relais->adresse3 ) )
|
44 |
+
->setCompany ( $relais->nomEnseigne )
|
45 |
+
->setWRelayPointCode( $relais->identifiantChronopostPointA2PAS )
|
46 |
+
->save()
|
47 |
+
->setCollectShippingRates(true);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
//ENDWEC chronorelais
|
54 |
+
|
55 |
+
$this->_getState()->setActiveStep(
|
56 |
+
Mage_Checkout_Model_Type_Multishipping_State::STEP_BILLING
|
57 |
+
);
|
58 |
+
$this->_getState()->setCompleteStep(
|
59 |
+
Mage_Checkout_Model_Type_Multishipping_State::STEP_SHIPPING
|
60 |
+
);
|
61 |
+
$this->_redirect('*/*/billing');
|
62 |
+
}
|
63 |
+
catch (Exception $e){
|
64 |
+
$this->_getCheckoutSession()->addError($e->getMessage());
|
65 |
+
$this->_redirect('*/*/shipping');
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Get relais
|
71 |
+
*/
|
72 |
+
public function getMultiRelaisAction()
|
73 |
+
{
|
74 |
+
$result = array();
|
75 |
+
$postcode = $this->getRequest()->get('zip', '');
|
76 |
+
|
77 |
+
if (extension_loaded('soap')) {
|
78 |
+
$addresses = $this->_getCheckout()->getQuote()->getAllShippingAddresses();
|
79 |
+
foreach ($addresses as $address) {
|
80 |
+
if ($address->getId() == $this->getRequest()->get('index')) {
|
81 |
+
/*$address->setPostcode($postcode)
|
82 |
+
->save()
|
83 |
+
->setCollectShippingRates(true);*/
|
84 |
+
|
85 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl",array('trace'=> 0,'connection_timeout'=>10));
|
86 |
+
$webservbt = $client->__call("rechercheBtParCodeproduitEtCodepostalEtDate",array(0,$postcode,0));
|
87 |
+
|
88 |
+
if ($webservbt) {
|
89 |
+
Mage::getSingleton('core/session')->setMultiPostcode($postcode);
|
90 |
+
$this->loadLayout('checkout_multishipping_shippingchronorelais');
|
91 |
+
$result['update_section'] = array(
|
92 |
+
'name' => 'checkout-shipping-method-chronorelais-load_'.$this->getRequest()->get('index'),
|
93 |
+
'html' => str_replace("%%id%%", $this->getRequest()->get('index'), $this->_getChronoRelaisHtml())
|
94 |
+
);
|
95 |
+
$result['relaypoints'] = $webservbt;
|
96 |
+
} else {
|
97 |
+
$result['error'] = true;
|
98 |
+
$result['message'] = $this->__('No point relay is associated with this postcode');
|
99 |
+
}
|
100 |
+
|
101 |
+
break;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
if (count($result) == 0) {
|
105 |
+
$result['error'] = true;
|
106 |
+
$result['message'] = $this->__('Issue with addresses');
|
107 |
+
}
|
108 |
+
} else {
|
109 |
+
$result['error'] = true;
|
110 |
+
$result['message'] = $this->__('Sorry for inconvenience, The SOAP extension is not installed in the server. Please contact the site administrator.');
|
111 |
+
}
|
112 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
113 |
+
}
|
114 |
+
}
|
app/code/community/Chronopost/Chronorelais/controllers/Checkout/OnepageController.php
CHANGED
@@ -1,657 +1,285 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
require_once 'Mage/Checkout/controllers/OnepageController.php';
|
4 |
-
class Chronopost_Chronorelais_Checkout_OnepageController extends Mage_Checkout_OnepageController
|
5 |
-
{
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
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 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
}
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
$this->loadLayout();
|
232 |
-
$
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
if ($this->getRequest()->isPost()) {
|
286 |
-
$postData = $this->getRequest()->getPost('billing', array());
|
287 |
-
$data = $this->_filterPostData($postData);
|
288 |
-
$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
|
289 |
-
|
290 |
-
if (isset($data['email'])) {
|
291 |
-
$data['email'] = trim($data['email']);
|
292 |
-
}
|
293 |
-
$result = $this->getOnepage()->saveBilling($data, $customerAddressId);
|
294 |
-
|
295 |
-
if (!isset($result['error'])) {
|
296 |
-
/* check quote for virtual */
|
297 |
-
if ($this->getOnepage()->getQuote()->isVirtual()) {
|
298 |
-
$result['goto_section'] = 'payment';
|
299 |
-
$result['update_section'] = array(
|
300 |
-
'name' => 'payment-method',
|
301 |
-
'html' => $this->_getPaymentMethodsHtml()
|
302 |
-
);
|
303 |
-
} elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) {
|
304 |
-
$result['goto_section'] = 'shipping_method';
|
305 |
-
$result['update_section'] = array(
|
306 |
-
'name' => 'shipping-method',
|
307 |
-
'html' => $this->_getShippingMethodsHtml()
|
308 |
-
);
|
309 |
-
|
310 |
-
$result['allow_sections'] = array('shipping');
|
311 |
-
$result['duplicateBillingInfo'] = 'true';
|
312 |
-
|
313 |
-
//WEC chronorelais
|
314 |
-
if( isset( $_SESSION["customer_shipping_address_reference"] ) ){
|
315 |
-
unset( $_SESSION["customer_shipping_address_reference"] );
|
316 |
-
}
|
317 |
-
|
318 |
-
if(!array_key_exists("compagny",$data)){ $data["compagny"]=""; }
|
319 |
-
|
320 |
-
$_SESSION["customer_shipping_address_reference"]["data"] = $data;
|
321 |
-
$_SESSION["customer_shipping_address_reference"]["customerAddressId"] = $customerAddressId;
|
322 |
-
$_SESSION["customer_shipping_address_reference"]["available"] = false;
|
323 |
-
//ENDWEC
|
324 |
-
|
325 |
-
} else {
|
326 |
-
$result['goto_section'] = 'shipping';
|
327 |
-
}
|
328 |
-
}
|
329 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
330 |
-
}
|
331 |
-
}
|
332 |
-
|
333 |
-
/**
|
334 |
-
* Shipping address save action
|
335 |
-
*/
|
336 |
-
public function saveShippingAction()
|
337 |
-
{
|
338 |
-
if ($this->_expireAjax()) {
|
339 |
-
return;
|
340 |
-
}
|
341 |
-
if ($this->getRequest()->isPost()) {
|
342 |
-
$data = $this->getRequest()->getPost('shipping', array());
|
343 |
-
$customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
$result = $this->getOnepage()->saveShipping($data, $customerAddressId);
|
348 |
-
|
349 |
-
if (!isset($result['error'])) {
|
350 |
-
$result['goto_section'] = 'shipping_method';
|
351 |
-
$result['update_section'] = array(
|
352 |
-
'name' => 'shipping-method',
|
353 |
-
'html' => $this->_getShippingMethodsHtml()
|
354 |
-
);
|
355 |
-
}
|
356 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
357 |
-
}
|
358 |
-
|
359 |
-
//WEC chronorelais
|
360 |
-
if( isset( $_SESSION["customer_shipping_address_reference"] ) ){
|
361 |
-
unset( $_SESSION["customer_shipping_address_reference"] );
|
362 |
-
}
|
363 |
-
if(!array_key_exists("compagny",$data)){ $data["compagny"]=""; }
|
364 |
-
$_SESSION["customer_shipping_address_reference"]["data"] = $data;
|
365 |
-
$_SESSION["customer_shipping_address_reference"]["customerAddressId"] = $customerAddressId;
|
366 |
-
$_SESSION["customer_shipping_address_reference"]["available"] = false;
|
367 |
-
|
368 |
-
//ENDWEC
|
369 |
-
}
|
370 |
-
|
371 |
-
/**
|
372 |
-
* Shipping method save action
|
373 |
-
*/
|
374 |
-
public function saveShippingMethodAction()
|
375 |
-
{
|
376 |
-
if ($this->_expireAjax()) {
|
377 |
-
return;
|
378 |
-
}
|
379 |
-
|
380 |
-
if ($this->getRequest()->isPost()) {
|
381 |
-
|
382 |
-
//WEC chronorelais
|
383 |
-
if( $_SESSION["customer_shipping_address_reference"]["available"] ){
|
384 |
-
$data = $_SESSION["customer_shipping_address_reference"]["data"];
|
385 |
-
$customerAddressId = $_SESSION["customer_shipping_address_reference"]["customerAddressId"];
|
386 |
-
$_SESSION["customer_shipping_address_reference"]["available"] = false;
|
387 |
-
|
388 |
-
$result = $this->getOnepage()->saveShipping($data, $customerAddressId);
|
389 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
390 |
-
}
|
391 |
-
|
392 |
-
$method = $this->getRequest()->getParam('shipping_method');
|
393 |
-
$quote = Mage::getSingleton('checkout/cart')->init()->getQuote();
|
394 |
-
$address = $quote->getShippingAddress();
|
395 |
-
|
396 |
-
//if( substr($this->getRequest()->getParam('shipping_method'),0,25) == "chronorelais_chronorelais" ){
|
397 |
-
if( substr($this->getRequest()->getParam('shipping_method'),0,12) == "chronorelais" ){
|
398 |
-
|
399 |
-
$relaisId = $this->getRequest()->getParam('shipping_method_chronorelais');
|
400 |
-
if($relaisId!=""){
|
401 |
-
|
402 |
-
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl");
|
403 |
-
$webservbt = $client->__call("rechercheBtParIdChronopostA2Pas",array($relaisId));
|
404 |
-
$relais = $webservbt[0] ;
|
405 |
-
|
406 |
-
if($relais) {
|
407 |
-
$address->setCity($relais->localite)
|
408 |
-
->setPostcode($relais->codePostal)
|
409 |
-
->setStreet ( trim( $relais->adresse1." ".$relais->adresse2." ".$relais->adresse3 ) )
|
410 |
-
->setCompany ( $relais->nomEnseigne )
|
411 |
-
->setWRelayPointCode( $relais->identifiantChronopostPointA2PAS )
|
412 |
-
->save()
|
413 |
-
->setCollectShippingRates(true);
|
414 |
-
|
415 |
-
$_SESSION["customer_shipping_address_reference"]["available"] = true;
|
416 |
-
}
|
417 |
-
}
|
418 |
-
}
|
419 |
-
|
420 |
-
$methodTitle = "";
|
421 |
-
if(isset($relais->localite)) {
|
422 |
-
$methodTitle = ' - '.$relais->nomEnseigne.' - '.trim( $relais->adresse1." ".$relais->adresse2." ".$relais->adresse3 ).' - '.$relais->codePostal.' - '.$relais->localite;
|
423 |
-
}
|
424 |
-
if ($method) {
|
425 |
-
foreach ($address->getAllShippingRates() as $rate) {
|
426 |
-
if ($rate->getCode()==$method) {
|
427 |
-
$address->setShippingDescription($rate->getCarrierTitle().' - '.$rate->getMethodTitle().$methodTitle);
|
428 |
-
break;
|
429 |
-
}
|
430 |
-
}
|
431 |
-
}
|
432 |
-
|
433 |
-
//ENDWEC chronorelais
|
434 |
-
|
435 |
-
$data = $this->getRequest()->getPost('shipping_method', '');
|
436 |
-
|
437 |
-
$result = $this->getOnepage()->saveShippingMethod($data);
|
438 |
-
|
439 |
-
/*
|
440 |
-
$result will have erro data if shipping method is empty
|
441 |
-
*/
|
442 |
-
if(!$result) {
|
443 |
-
Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getRequest(), 'quote'=>$this->getOnepage()->getQuote()));
|
444 |
-
// $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
445 |
-
|
446 |
-
$result['goto_section'] = 'payment';
|
447 |
-
$result['update_section'] = array(
|
448 |
-
'name' => 'payment-method',
|
449 |
-
'html' => $this->_getPaymentMethodsHtml()
|
450 |
-
);
|
451 |
-
}
|
452 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
453 |
-
}
|
454 |
-
}
|
455 |
-
|
456 |
-
/**
|
457 |
-
* Save payment ajax action
|
458 |
-
*
|
459 |
-
* Sets either redirect or a JSON response
|
460 |
-
*/
|
461 |
-
public function savePaymentAction()
|
462 |
-
{
|
463 |
-
if ($this->_expireAjax()) {
|
464 |
-
return;
|
465 |
-
}
|
466 |
-
try {
|
467 |
-
if (!$this->getRequest()->isPost()) {
|
468 |
-
$this->_ajaxRedirectResponse();
|
469 |
-
return;
|
470 |
-
}
|
471 |
-
|
472 |
-
// set payment to quote
|
473 |
-
$result = array();
|
474 |
-
$data = $this->getRequest()->getPost('payment', array());
|
475 |
-
$result = $this->getOnepage()->savePayment($data);
|
476 |
-
|
477 |
-
// get section and redirect data
|
478 |
-
$redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
|
479 |
-
if (empty($result['error']) && !$redirectUrl) {
|
480 |
-
$this->loadLayout('checkout_onepage_review');
|
481 |
-
$result['goto_section'] = 'review';
|
482 |
-
$result['update_section'] = array(
|
483 |
-
'name' => 'review',
|
484 |
-
'html' => $this->_getReviewHtml()
|
485 |
-
);
|
486 |
-
}
|
487 |
-
if ($redirectUrl) {
|
488 |
-
$result['redirect'] = $redirectUrl;
|
489 |
-
}
|
490 |
-
} catch (Mage_Payment_Exception $e) {
|
491 |
-
if ($e->getFields()) {
|
492 |
-
$result['fields'] = $e->getFields();
|
493 |
-
}
|
494 |
-
$result['error'] = $e->getMessage();
|
495 |
-
} catch (Mage_Core_Exception $e) {
|
496 |
-
$result['error'] = $e->getMessage();
|
497 |
-
} catch (Exception $e) {
|
498 |
-
Mage::logException($e);
|
499 |
-
$result['error'] = $this->__('Unable to set Payment Method.');
|
500 |
-
}
|
501 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
502 |
-
}
|
503 |
-
|
504 |
-
/**
|
505 |
-
* Create order action
|
506 |
-
*/
|
507 |
-
public function saveOrderAction()
|
508 |
-
{
|
509 |
-
if ($this->_expireAjax()) {
|
510 |
-
return;
|
511 |
-
}
|
512 |
-
|
513 |
-
$result = array();
|
514 |
-
try {
|
515 |
-
if ($requiredAgreements = Mage::helper('checkout')->getRequiredAgreementIds()) {
|
516 |
-
$postedAgreements = array_keys($this->getRequest()->getPost('agreement', array()));
|
517 |
-
if ($diff = array_diff($requiredAgreements, $postedAgreements)) {
|
518 |
-
$result['success'] = false;
|
519 |
-
$result['error'] = true;
|
520 |
-
$result['error_messages'] = $this->__('Please agree to all the terms and conditions before placing the order.');
|
521 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
522 |
-
return;
|
523 |
-
}
|
524 |
-
}
|
525 |
-
if ($data = $this->getRequest()->getPost('payment', false)) {
|
526 |
-
$this->getOnepage()->getQuote()->getPayment()->importData($data);
|
527 |
-
}
|
528 |
-
$this->getOnepage()->saveOrder();
|
529 |
-
$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();
|
530 |
-
$result['success'] = true;
|
531 |
-
$result['error'] = false;
|
532 |
-
} catch (Mage_Core_Exception $e) {
|
533 |
-
Mage::logException($e);
|
534 |
-
Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
|
535 |
-
$result['success'] = false;
|
536 |
-
$result['error'] = true;
|
537 |
-
$result['error_messages'] = $e->getMessage();
|
538 |
-
|
539 |
-
if ($gotoSection = $this->getOnepage()->getCheckout()->getGotoSection()) {
|
540 |
-
$result['goto_section'] = $gotoSection;
|
541 |
-
$this->getOnepage()->getCheckout()->setGotoSection(null);
|
542 |
-
}
|
543 |
-
|
544 |
-
if ($updateSection = $this->getOnepage()->getCheckout()->getUpdateSection()) {
|
545 |
-
if (isset($this->_sectionUpdateFunctions[$updateSection])) {
|
546 |
-
$updateSectionFunction = $this->_sectionUpdateFunctions[$updateSection];
|
547 |
-
$result['update_section'] = array(
|
548 |
-
'name' => $updateSection,
|
549 |
-
'html' => $this->$updateSectionFunction()
|
550 |
-
);
|
551 |
-
}
|
552 |
-
$this->getOnepage()->getCheckout()->setUpdateSection(null);
|
553 |
-
}
|
554 |
-
} catch (Exception $e) {
|
555 |
-
Mage::logException($e);
|
556 |
-
Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
|
557 |
-
$result['success'] = false;
|
558 |
-
$result['error'] = true;
|
559 |
-
$result['error_messages'] = $this->__('There was an error processing your order. Please contact us or try again later.');
|
560 |
-
}
|
561 |
-
$this->getOnepage()->getQuote()->save();
|
562 |
-
/**
|
563 |
-
* when there is redirect to third party, we don't want to save order yet.
|
564 |
-
* we will save the order in return action.
|
565 |
-
*/
|
566 |
-
if (isset($redirectUrl)) {
|
567 |
-
$result['redirect'] = $redirectUrl;
|
568 |
-
}
|
569 |
-
|
570 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
571 |
-
}
|
572 |
-
|
573 |
-
/**
|
574 |
-
* Filtering posted data. Converting localized data if needed
|
575 |
-
*
|
576 |
-
* @param array
|
577 |
-
* @return array
|
578 |
-
*/
|
579 |
-
protected function _filterPostData($data)
|
580 |
-
{
|
581 |
-
$data = $this->_filterDates($data, array('dob'));
|
582 |
-
return $data;
|
583 |
-
}
|
584 |
-
|
585 |
-
/**
|
586 |
-
* Get relais
|
587 |
-
*/
|
588 |
-
public function getRelaisAction()
|
589 |
-
{
|
590 |
-
if ($this->_expireAjax()) {
|
591 |
-
return;
|
592 |
-
}
|
593 |
-
$result = array();
|
594 |
-
$quote = Mage::getSingleton('checkout/cart')->init()->getQuote();
|
595 |
-
$address = $quote->getShippingAddress();
|
596 |
-
$postcode = $address->getPostcode();
|
597 |
-
|
598 |
-
if (extension_loaded('soap')) {
|
599 |
-
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl",array('trace'=> 0,'connection_timeout'=>10));
|
600 |
-
$webservbt = $client->__call("rechercheBtParCodeproduitEtCodepostalEtDate",array(0,$postcode,0));
|
601 |
-
|
602 |
-
if ($webservbt) {
|
603 |
-
$this->loadLayout('checkout_onepage_shippingchronorelais');
|
604 |
-
$result['goto_section'] = 'shipping-method';
|
605 |
-
$result['update_section'] = array(
|
606 |
-
'name' => 'shipping-method-chronorelais',
|
607 |
-
'html' => $this->_getChronoRelaisHtml()
|
608 |
-
);
|
609 |
-
$result['relaypoints'] = $webservbt;
|
610 |
-
} else {
|
611 |
-
$result['error'] = true;
|
612 |
-
$result['message'] = $this->__('No point relay is associated with this postcode');
|
613 |
-
}
|
614 |
-
} else {
|
615 |
-
$result['error'] = true;
|
616 |
-
$result['message'] = $this->__('Sorry for inconvenience, The SOAP extension is not installed in the server. Please contact the site administrator.');
|
617 |
-
}
|
618 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
619 |
-
}
|
620 |
-
|
621 |
-
/**
|
622 |
-
* Change shipping postal code
|
623 |
-
*/
|
624 |
-
public function changePostalCodeAction()
|
625 |
-
{
|
626 |
-
if ($this->_expireAjax()) {
|
627 |
-
return;
|
628 |
-
}
|
629 |
-
$result = array();
|
630 |
-
$webservbt = array();
|
631 |
-
$postcode = $this->getRequest()->getPost('mappostalcode');
|
632 |
-
if($postcode) {
|
633 |
-
$quote = Mage::getSingleton('checkout/cart')->init()->getQuote();
|
634 |
-
$address = $quote->getShippingAddress();
|
635 |
-
$address->setPostcode($postcode)
|
636 |
-
->save()
|
637 |
-
->setCollectShippingRates(true);
|
638 |
-
|
639 |
-
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl",array('trace'=> 0,'connection_timeout'=>10));
|
640 |
-
$webservbt = $client->__call("rechercheBtParCodeproduitEtCodepostalEtDate",array(0,$postcode,0));
|
641 |
-
}
|
642 |
-
if ($webservbt) {
|
643 |
-
$this->loadLayout('checkout_onepage_shippingchronorelais');
|
644 |
-
$result['goto_section'] = 'shipping-method';
|
645 |
-
$result['update_section'] = array(
|
646 |
-
'name' => 'shipping-method-chronorelais',
|
647 |
-
'html' => $this->_getChronoRelaisHtml()
|
648 |
-
);
|
649 |
-
$result['relaypoints'] = $webservbt;
|
650 |
-
} else {
|
651 |
-
$result['error'] = true;
|
652 |
-
$result['message'] = $this->__('No point relay is associated with this postcode');
|
653 |
-
}
|
654 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
655 |
-
}
|
656 |
-
|
657 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once 'Mage/Checkout/controllers/OnepageController.php';
|
4 |
+
class Chronopost_Chronorelais_Checkout_OnepageController extends Mage_Checkout_OnepageController
|
5 |
+
{
|
6 |
+
protected $_sectionUpdateFunctions = array(
|
7 |
+
'payment-method' => '_getPaymentMethodsHtml',
|
8 |
+
'shipping-method' => '_getShippingMethodsHtml',
|
9 |
+
'review' => '_getReviewHtml',
|
10 |
+
'shipping-method-chronorelais' => '_getReviewHtml',
|
11 |
+
);
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Get payment method step html
|
15 |
+
*
|
16 |
+
* @return string
|
17 |
+
*/
|
18 |
+
protected function _getChronoRelaisHtml()
|
19 |
+
{
|
20 |
+
return $this->getLayout()->getBlock('root')->toHtml();
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Checkout page
|
25 |
+
*/
|
26 |
+
public function indexAction()
|
27 |
+
{
|
28 |
+
if (!extension_loaded('soap')) {
|
29 |
+
if(Mage::helper('chronorelais')->getConfigData('carriers/chronopost/active') || Mage::helper('chronorelais')->getConfigData('carriers/chronorelais/active') || Mage::helper('chronorelais')->getConfigData('carriers/chronoexpress/active')) {
|
30 |
+
Mage::getSingleton('checkout/session')->addError($this->__('The SOAP extension is not installed in the server. Please contact the site administrator. Sorry for inconvenience.'));
|
31 |
+
$this->_redirect('checkout/cart');
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
parent::indexAction();
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* save checkout billing address
|
40 |
+
*/
|
41 |
+
public function saveBillingAction()
|
42 |
+
{
|
43 |
+
if ($this->_expireAjax()) {
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
if ($this->getRequest()->isPost()) {
|
47 |
+
// $postData = $this->getRequest()->getPost('billing', array());
|
48 |
+
// $data = $this->_filterPostData($postData);
|
49 |
+
$data = $this->getRequest()->getPost('billing', array());
|
50 |
+
$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
|
51 |
+
|
52 |
+
if (isset($data['email'])) {
|
53 |
+
$data['email'] = trim($data['email']);
|
54 |
+
}
|
55 |
+
$result = $this->getOnepage()->saveBilling($data, $customerAddressId);
|
56 |
+
|
57 |
+
if (!isset($result['error'])) {
|
58 |
+
/* check quote for virtual */
|
59 |
+
if ($this->getOnepage()->getQuote()->isVirtual()) {
|
60 |
+
$result['goto_section'] = 'payment';
|
61 |
+
$result['update_section'] = array(
|
62 |
+
'name' => 'payment-method',
|
63 |
+
'html' => $this->_getPaymentMethodsHtml()
|
64 |
+
);
|
65 |
+
} elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) {
|
66 |
+
$result['goto_section'] = 'shipping_method';
|
67 |
+
$result['update_section'] = array(
|
68 |
+
'name' => 'shipping-method',
|
69 |
+
'html' => $this->_getShippingMethodsHtml()
|
70 |
+
);
|
71 |
+
|
72 |
+
$result['allow_sections'] = array('shipping');
|
73 |
+
$result['duplicateBillingInfo'] = 'true';
|
74 |
+
|
75 |
+
//WEC chronorelais
|
76 |
+
if( isset( $_SESSION["customer_shipping_address_reference"] ) ){
|
77 |
+
unset( $_SESSION["customer_shipping_address_reference"] );
|
78 |
+
}
|
79 |
+
|
80 |
+
if(!array_key_exists("company",$data)){ $data["company"]=""; }
|
81 |
+
|
82 |
+
$_SESSION["customer_shipping_address_reference"]["data"] = $data;
|
83 |
+
$_SESSION["customer_shipping_address_reference"]["customerAddressId"] = $customerAddressId;
|
84 |
+
$_SESSION["customer_shipping_address_reference"]["available"] = false;
|
85 |
+
//ENDWEC
|
86 |
+
|
87 |
+
} else {
|
88 |
+
$result['goto_section'] = 'shipping';
|
89 |
+
}
|
90 |
+
}
|
91 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Shipping address save action
|
97 |
+
*/
|
98 |
+
public function saveShippingAction()
|
99 |
+
{
|
100 |
+
if ($this->_expireAjax()) {
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
if ($this->getRequest()->isPost()) {
|
104 |
+
$data = $this->getRequest()->getPost('shipping', array());
|
105 |
+
$customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
|
106 |
+
$result = $this->getOnepage()->saveShipping($data, $customerAddressId);
|
107 |
+
|
108 |
+
if (!isset($result['error'])) {
|
109 |
+
$result['goto_section'] = 'shipping_method';
|
110 |
+
$result['update_section'] = array(
|
111 |
+
'name' => 'shipping-method',
|
112 |
+
'html' => $this->_getShippingMethodsHtml()
|
113 |
+
);
|
114 |
+
}
|
115 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
116 |
+
}
|
117 |
+
|
118 |
+
//WEC chronorelais
|
119 |
+
if( isset( $_SESSION["customer_shipping_address_reference"] ) ){
|
120 |
+
unset( $_SESSION["customer_shipping_address_reference"] );
|
121 |
+
}
|
122 |
+
if(!array_key_exists("company",$data)){ $data["company"]=""; }
|
123 |
+
$_SESSION["customer_shipping_address_reference"]["data"] = $data;
|
124 |
+
$_SESSION["customer_shipping_address_reference"]["customerAddressId"] = $customerAddressId;
|
125 |
+
$_SESSION["customer_shipping_address_reference"]["available"] = false;
|
126 |
+
|
127 |
+
//ENDWEC
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Shipping method save action
|
132 |
+
*/
|
133 |
+
public function saveShippingMethodAction()
|
134 |
+
{
|
135 |
+
if ($this->_expireAjax()) {
|
136 |
+
return;
|
137 |
+
}
|
138 |
+
if ($this->getRequest()->isPost()) {
|
139 |
+
|
140 |
+
//WEC chronorelais
|
141 |
+
if( $_SESSION["customer_shipping_address_reference"]["available"] ){
|
142 |
+
$data = $_SESSION["customer_shipping_address_reference"]["data"];
|
143 |
+
$customerAddressId = $_SESSION["customer_shipping_address_reference"]["customerAddressId"];
|
144 |
+
$_SESSION["customer_shipping_address_reference"]["available"] = false;
|
145 |
+
|
146 |
+
$result = $this->getOnepage()->saveShipping($data, $customerAddressId);
|
147 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
148 |
+
}
|
149 |
+
|
150 |
+
$method = $this->getRequest()->getParam('shipping_method');
|
151 |
+
$quote = Mage::getSingleton('checkout/cart')->init()->getQuote();
|
152 |
+
$address = $quote->getShippingAddress();
|
153 |
+
|
154 |
+
if( substr($this->getRequest()->getParam('shipping_method'),0,12) == "chronorelais" ){
|
155 |
+
$relaisId = $this->getRequest()->getParam('shipping_method_chronorelais');
|
156 |
+
if($relaisId!=""){
|
157 |
+
|
158 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl");
|
159 |
+
$webservbt = $client->__call("rechercheBtParIdChronopostA2Pas",array($relaisId));
|
160 |
+
$relais = $webservbt[0] ;
|
161 |
+
|
162 |
+
if($relais) {
|
163 |
+
$address->setCity($relais->localite)
|
164 |
+
->setPostcode($relais->codePostal)
|
165 |
+
->setStreet ( trim( $relais->adresse1." ".$relais->adresse2." ".$relais->adresse3 ) )
|
166 |
+
->setCompany ( $relais->nomEnseigne )
|
167 |
+
->setWRelayPointCode( $relais->identifiantChronopostPointA2PAS )
|
168 |
+
->save()
|
169 |
+
->setCollectShippingRates(true);
|
170 |
+
|
171 |
+
$_SESSION["customer_shipping_address_reference"]["available"] = true;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
$methodTitle = "";
|
177 |
+
if(isset($relais->localite)) {
|
178 |
+
$methodTitle = ' - '.$relais->nomEnseigne.' - '.trim( $relais->adresse1." ".$relais->adresse2." ".$relais->adresse3 ).' - '.$relais->codePostal.' - '.$relais->localite;
|
179 |
+
}
|
180 |
+
if ($method) {
|
181 |
+
foreach ($address->getAllShippingRates() as $rate) {
|
182 |
+
if ($rate->getCode()==$method) {
|
183 |
+
$address->setShippingDescription($rate->getCarrierTitle().' - '.$rate->getMethodTitle().$methodTitle);
|
184 |
+
break;
|
185 |
+
}
|
186 |
+
}
|
187 |
+
}
|
188 |
+
//ENDWEC chronorelais
|
189 |
+
|
190 |
+
$data = $this->getRequest()->getPost('shipping_method', '');
|
191 |
+
$result = $this->getOnepage()->saveShippingMethod($data);
|
192 |
+
/*
|
193 |
+
$result will have erro data if shipping method is empty
|
194 |
+
*/
|
195 |
+
if(!$result) {
|
196 |
+
Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method',
|
197 |
+
array('request'=>$this->getRequest(),
|
198 |
+
'quote'=>$this->getOnepage()->getQuote()));
|
199 |
+
$this->getOnepage()->getQuote()->collectTotals();
|
200 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
201 |
+
|
202 |
+
$result['goto_section'] = 'payment';
|
203 |
+
$result['update_section'] = array(
|
204 |
+
'name' => 'payment-method',
|
205 |
+
'html' => $this->_getPaymentMethodsHtml()
|
206 |
+
);
|
207 |
+
}
|
208 |
+
$this->getOnepage()->getQuote()->collectTotals()->save();
|
209 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Get relais
|
215 |
+
*/
|
216 |
+
public function getRelaisAction()
|
217 |
+
{
|
218 |
+
if ($this->_expireAjax()) {
|
219 |
+
return;
|
220 |
+
}
|
221 |
+
$result = array();
|
222 |
+
$quote = Mage::getSingleton('checkout/cart')->init()->getQuote();
|
223 |
+
$address = $quote->getShippingAddress();
|
224 |
+
$postcode = $address->getPostcode();
|
225 |
+
|
226 |
+
if (extension_loaded('soap')) {
|
227 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl",array('trace'=> 0,'connection_timeout'=>10));
|
228 |
+
$webservbt = $client->__call("rechercheBtParCodeproduitEtCodepostalEtDate",array(0,$postcode,0));
|
229 |
+
|
230 |
+
if ($webservbt) {
|
231 |
+
$this->loadLayout('checkout_onepage_shippingchronorelais');
|
232 |
+
$result['goto_section'] = 'shipping-method';
|
233 |
+
$result['update_section'] = array(
|
234 |
+
'name' => 'shipping-method-chronorelais',
|
235 |
+
'html' => $this->_getChronoRelaisHtml()
|
236 |
+
);
|
237 |
+
$result['relaypoints'] = $webservbt;
|
238 |
+
} else {
|
239 |
+
$result['error'] = true;
|
240 |
+
$result['message'] = $this->__('No point relay is associated with this postcode');
|
241 |
+
}
|
242 |
+
} else {
|
243 |
+
$result['error'] = true;
|
244 |
+
$result['message'] = $this->__('Sorry for inconvenience, The SOAP extension is not installed in the server. Please contact the site administrator.');
|
245 |
+
}
|
246 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Change shipping postal code
|
251 |
+
*/
|
252 |
+
public function changePostalCodeAction()
|
253 |
+
{
|
254 |
+
if ($this->_expireAjax()) {
|
255 |
+
return;
|
256 |
+
}
|
257 |
+
$result = array();
|
258 |
+
$webservbt = array();
|
259 |
+
$postcode = $this->getRequest()->getPost('mappostalcode');
|
260 |
+
if($postcode) {
|
261 |
+
$quote = Mage::getSingleton('checkout/cart')->init()->getQuote();
|
262 |
+
$address = $quote->getShippingAddress();
|
263 |
+
$address->setPostcode($postcode)
|
264 |
+
->save()
|
265 |
+
->setCollectShippingRates(true);
|
266 |
+
|
267 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/soap.point.relais/services/ServiceRechercheBt?wsdl",array('trace'=> 0,'connection_timeout'=>10));
|
268 |
+
$webservbt = $client->__call("rechercheBtParCodeproduitEtCodepostalEtDate",array(0,$postcode,0));
|
269 |
+
}
|
270 |
+
if ($webservbt) {
|
271 |
+
$this->loadLayout('checkout_onepage_shippingchronorelais');
|
272 |
+
$result['goto_section'] = 'shipping-method';
|
273 |
+
$result['update_section'] = array(
|
274 |
+
'name' => 'shipping-method-chronorelais',
|
275 |
+
'html' => $this->_getChronoRelaisHtml()
|
276 |
+
);
|
277 |
+
$result['relaypoints'] = $webservbt;
|
278 |
+
} else {
|
279 |
+
$result['error'] = true;
|
280 |
+
$result['message'] = $this->__('No point relay is associated with this postcode');
|
281 |
+
}
|
282 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
283 |
+
}
|
284 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
}
|
app/code/community/Chronopost/Chronorelais/controllers/ExportController.php
CHANGED
@@ -1,446 +1,445 @@
|
|
1 |
-
<?php
|
2 |
-
class Chronopost_Chronorelais_ExportController extends Mage_Adminhtml_Controller_Action
|
3 |
-
{
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Constructor
|
7 |
-
*/
|
8 |
-
protected function _construct()
|
9 |
-
{
|
10 |
-
$this->setUsedModuleName('Chronopost_Chronorelais');
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Main action : show orders list
|
15 |
-
*/
|
16 |
-
public function indexAction()
|
17 |
-
{
|
18 |
-
$this->loadLayout()
|
19 |
-
->_setActiveMenu('sales/chronorelais/export')
|
20 |
-
->_addContent($this->getLayout()->createBlock('chronorelais/export_orders'))
|
21 |
-
->renderLayout();
|
22 |
-
}
|
23 |
-
|
24 |
-
public function getValue($value)
|
25 |
-
{
|
26 |
-
return ($value!='' ? $value : '');
|
27 |
-
}
|
28 |
-
|
29 |
-
public function removeSpclChars($text)
|
30 |
-
{
|
31 |
-
return ereg_replace("[^0-9a-zA-Z]", "", $text);
|
32 |
-
}
|
33 |
-
|
34 |
-
public function massLivraisonSamediStatusAction()
|
35 |
-
{
|
36 |
-
if($this->getRequest()->getPost('status')) {
|
37 |
-
$this->saveLivraisonSamediStatusAction();
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
public function massExportAction()
|
42 |
-
{
|
43 |
-
if($this->getRequest()->getPost('format')=='css') {
|
44 |
-
$this->exportcssAction();
|
45 |
-
} elseif($this->getRequest()->getPost('format')=='cso') {
|
46 |
-
$this->exportcsoAction();
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Export CSS Action
|
52 |
-
* Generates a CSV file to download (CSS format)
|
53 |
-
*/
|
54 |
-
public function exportcssAction()
|
55 |
-
{
|
56 |
-
/* get the orders */
|
57 |
-
$orderIds = $this->getRequest()->getPost('order_ids');
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Get configuration
|
61 |
-
*/
|
62 |
-
$separator = Mage::helper('chronorelais')->getConfigurationFieldSeparator('css');
|
63 |
-
$delimiter = Mage::helper('chronorelais')->getConfigurationFieldDelimiter('css');
|
64 |
-
|
65 |
-
if ($delimiter == 'simple_quote') {
|
66 |
-
$delimiter = "'";
|
67 |
-
} else if ($delimiter == 'double_quotes') {
|
68 |
-
$delimiter = '"';
|
69 |
-
} else {
|
70 |
-
$delimiter = '';
|
71 |
-
}
|
72 |
-
$lineBreak = Mage::helper('chronorelais')->getConfigurationEndOfLineCharacter('css');
|
73 |
-
if ($lineBreak == 'lf') {
|
74 |
-
$lineBreak = "\n";
|
75 |
-
} else if ($lineBreak == 'cr') {
|
76 |
-
$lineBreak = "\r";
|
77 |
-
} else if ($lineBreak == 'crlf') {
|
78 |
-
$lineBreak = "\r\n";
|
79 |
-
}
|
80 |
-
$fileExtension = Mage::helper('chronorelais')->getConfigurationFileExtension('css');
|
81 |
-
$fileCharset = Mage::helper('chronorelais')->getConfigurationFileCharset('css');
|
82 |
-
|
83 |
-
/* set the filename */
|
84 |
-
$filename = 'orders_exportcss_'.Mage::getSingleton('core/date')->date('Ymd_His').$fileExtension;
|
85 |
-
|
86 |
-
/* initialize the content variable */
|
87 |
-
$content = '';
|
88 |
-
|
89 |
-
if (!empty($orderIds)) {
|
90 |
-
foreach ($orderIds as $orderId) {
|
91 |
-
|
92 |
-
/* get the order */
|
93 |
-
$order = Mage::getModel('sales/order')->load($orderId);
|
94 |
-
$address = $order->getShippingAddress();
|
95 |
-
$billingAddress = $order->getBillingAddress();
|
96 |
-
|
97 |
-
$_shippingMethod = explode('_',$order->getShippingMethod());
|
98 |
-
|
99 |
-
/* customer id */
|
100 |
-
$content = $this->_addFieldToCsv($content, $delimiter, ($order->getCustomerId() ? $order->getCustomerId() : $address->getLastname()));
|
101 |
-
$content .= $separator;
|
102 |
-
/*
|
103 |
-
//$content = $this->_addFieldToCsv($content, $delimiter, $
|
104 |
-
$content = $this->_addFieldToCsv($content, $delimiter,
|
105 |
-
$content .= $separator;
|
106 |
-
/* customer name */
|
107 |
-
|
108 |
-
$content
|
109 |
-
|
110 |
-
|
111 |
-
$content
|
112 |
-
$content
|
113 |
-
$content
|
114 |
-
|
115 |
-
|
116 |
-
$content
|
117 |
-
|
118 |
-
|
119 |
-
$content
|
120 |
-
|
121 |
-
|
122 |
-
$content
|
123 |
-
|
124 |
-
|
125 |
-
$telephone =
|
126 |
-
|
127 |
-
$content
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
$content
|
132 |
-
|
133 |
-
|
134 |
-
$content
|
135 |
-
|
136 |
-
|
137 |
-
$content
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
$productCode =
|
147 |
-
|
148 |
-
$content
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
$
|
153 |
-
$
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
$
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
$content
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
$content
|
176 |
-
$content
|
177 |
-
$content
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
*
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
$
|
219 |
-
$delimiter
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
$lineBreak
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
$
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
$
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
$content
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
$content
|
258 |
-
|
259 |
-
|
260 |
-
$content
|
261 |
-
|
262 |
-
|
263 |
-
$content
|
264 |
-
$content
|
265 |
-
$content
|
266 |
-
|
267 |
-
|
268 |
-
$content
|
269 |
-
|
270 |
-
|
271 |
-
$content
|
272 |
-
|
273 |
-
|
274 |
-
$content
|
275 |
-
|
276 |
-
|
277 |
-
$content
|
278 |
-
|
279 |
-
|
280 |
-
$content
|
281 |
-
|
282 |
-
|
283 |
-
$content
|
284 |
-
|
285 |
-
|
286 |
-
$telephone =
|
287 |
-
|
288 |
-
$content
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
$content
|
293 |
-
|
294 |
-
|
295 |
-
$content
|
296 |
-
|
297 |
-
|
298 |
-
$
|
299 |
-
$_shippingMethod
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
$content
|
308 |
-
|
309 |
-
|
310 |
-
$content
|
311 |
-
|
312 |
-
|
313 |
-
$order_weight =
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
$content
|
319 |
-
|
320 |
-
|
321 |
-
$content
|
322 |
-
|
323 |
-
|
324 |
-
$content
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
$content
|
329 |
-
|
330 |
-
|
331 |
-
$content
|
332 |
-
|
333 |
-
|
334 |
-
$content
|
335 |
-
|
336 |
-
|
337 |
-
$content
|
338 |
-
|
339 |
-
|
340 |
-
$content
|
341 |
-
|
342 |
-
|
343 |
-
$
|
344 |
-
$
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
$
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
$content
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
$
|
397 |
-
$
|
398 |
-
$
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
$
|
403 |
-
$
|
404 |
-
$
|
405 |
-
|
406 |
-
$shipping_method
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
);
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
'
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
*
|
437 |
-
* @param
|
438 |
-
* @param
|
439 |
-
* @
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
}
|
1 |
+
<?php
|
2 |
+
class Chronopost_Chronorelais_ExportController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Constructor
|
7 |
+
*/
|
8 |
+
protected function _construct()
|
9 |
+
{
|
10 |
+
$this->setUsedModuleName('Chronopost_Chronorelais');
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Main action : show orders list
|
15 |
+
*/
|
16 |
+
public function indexAction()
|
17 |
+
{
|
18 |
+
$this->loadLayout()
|
19 |
+
->_setActiveMenu('sales/chronorelais/export')
|
20 |
+
->_addContent($this->getLayout()->createBlock('chronorelais/export_orders'))
|
21 |
+
->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getValue($value)
|
25 |
+
{
|
26 |
+
return ($value!='' ? $value : '');
|
27 |
+
}
|
28 |
+
|
29 |
+
public function removeSpclChars($text)
|
30 |
+
{
|
31 |
+
return ereg_replace("[^0-9a-zA-Z]", "", $text);
|
32 |
+
}
|
33 |
+
|
34 |
+
public function massLivraisonSamediStatusAction()
|
35 |
+
{
|
36 |
+
if($this->getRequest()->getPost('status')) {
|
37 |
+
$this->saveLivraisonSamediStatusAction();
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
public function massExportAction()
|
42 |
+
{
|
43 |
+
if($this->getRequest()->getPost('format')=='css') {
|
44 |
+
$this->exportcssAction();
|
45 |
+
} elseif($this->getRequest()->getPost('format')=='cso') {
|
46 |
+
$this->exportcsoAction();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Export CSS Action
|
52 |
+
* Generates a CSV file to download (CSS format)
|
53 |
+
*/
|
54 |
+
public function exportcssAction()
|
55 |
+
{
|
56 |
+
/* get the orders */
|
57 |
+
$orderIds = $this->getRequest()->getPost('order_ids');
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Get configuration
|
61 |
+
*/
|
62 |
+
$separator = Mage::helper('chronorelais')->getConfigurationFieldSeparator('css');
|
63 |
+
$delimiter = Mage::helper('chronorelais')->getConfigurationFieldDelimiter('css');
|
64 |
+
|
65 |
+
if ($delimiter == 'simple_quote') {
|
66 |
+
$delimiter = "'";
|
67 |
+
} else if ($delimiter == 'double_quotes') {
|
68 |
+
$delimiter = '"';
|
69 |
+
} else {
|
70 |
+
$delimiter = '';
|
71 |
+
}
|
72 |
+
$lineBreak = Mage::helper('chronorelais')->getConfigurationEndOfLineCharacter('css');
|
73 |
+
if ($lineBreak == 'lf') {
|
74 |
+
$lineBreak = "\n";
|
75 |
+
} else if ($lineBreak == 'cr') {
|
76 |
+
$lineBreak = "\r";
|
77 |
+
} else if ($lineBreak == 'crlf') {
|
78 |
+
$lineBreak = "\r\n";
|
79 |
+
}
|
80 |
+
$fileExtension = Mage::helper('chronorelais')->getConfigurationFileExtension('css');
|
81 |
+
$fileCharset = Mage::helper('chronorelais')->getConfigurationFileCharset('css');
|
82 |
+
|
83 |
+
/* set the filename */
|
84 |
+
$filename = 'orders_exportcss_'.Mage::getSingleton('core/date')->date('Ymd_His').$fileExtension;
|
85 |
+
|
86 |
+
/* initialize the content variable */
|
87 |
+
$content = '';
|
88 |
+
|
89 |
+
if (!empty($orderIds)) {
|
90 |
+
foreach ($orderIds as $orderId) {
|
91 |
+
|
92 |
+
/* get the order */
|
93 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
94 |
+
$address = $order->getShippingAddress();
|
95 |
+
$billingAddress = $order->getBillingAddress();
|
96 |
+
|
97 |
+
$_shippingMethod = explode('_',$order->getShippingMethod());
|
98 |
+
|
99 |
+
/* customer id */
|
100 |
+
$content = $this->_addFieldToCsv($content, $delimiter, ($order->getCustomerId() ? $order->getCustomerId() : $address->getLastname()));
|
101 |
+
$content .= $separator;
|
102 |
+
/* Nom du point relais OU soci�t� si livraison � domicile */
|
103 |
+
//$content = $this->_addFieldToCsv($content, $delimiter, $_shippingMethod[0] == "chronorelais" ? $address->getCompany() : "");
|
104 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $address->getCompany());
|
105 |
+
$content .= $separator;
|
106 |
+
/* customer name */
|
107 |
+
$content = $this->_addFieldToCsv($content, $delimiter, ($address->getName() ? $address->getName() : $billingAddress->getName()));
|
108 |
+
$content .= $separator;
|
109 |
+
/* street address */
|
110 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getStreet(1)));
|
111 |
+
$content .= $separator;
|
112 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getStreet(2)));
|
113 |
+
$content .= $separator;
|
114 |
+
/* postal code */
|
115 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getPostcode()));
|
116 |
+
$content .= $separator;
|
117 |
+
/* city */
|
118 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getCity()));
|
119 |
+
$content .= $separator;
|
120 |
+
/* country code */
|
121 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getCountry()));
|
122 |
+
$content .= $separator;
|
123 |
+
/* telephone */
|
124 |
+
$telephone = trim(ereg_replace("[^0-9.-]", " ", $address->getTelephone()));
|
125 |
+
$telephone = (strlen($telephone)>=10 ? $telephone : '');
|
126 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $telephone);
|
127 |
+
$content .= $separator;
|
128 |
+
/* email */
|
129 |
+
$customer_email = ($address->getEmail()) ? $address->getEmail() : ($billingAddress->getEmail() ? $billingAddress->getEmail() : $order->getCustomerEmail());
|
130 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($customer_email));
|
131 |
+
$content .= $separator;
|
132 |
+
/* chronorelay point */
|
133 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getWRelayPointCode()));
|
134 |
+
$content .= $separator;
|
135 |
+
/* real order id */
|
136 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($order->getRealOrderId()));
|
137 |
+
$content .= $separator;
|
138 |
+
/* total weight */
|
139 |
+
$order_weight = number_format($order->getWeight(), 2 , '.' , '');
|
140 |
+
//$order_weight = $order_weight * 1000;
|
141 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $order_weight);
|
142 |
+
$content .= $separator;
|
143 |
+
|
144 |
+
/* productCode*/
|
145 |
+
$productCode = ''; //Default code for chronorelais
|
146 |
+
$productCode = Mage::helper('chronorelais')->getChronoProductCodeString($_shippingMethod[0]);
|
147 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $productCode);
|
148 |
+
$content .= $separator;
|
149 |
+
|
150 |
+
/* Livraison Samedi*/
|
151 |
+
$SaturdayShipping = 'L'; //default value for the saturday shipping
|
152 |
+
$send_day = strtolower(date('l'));
|
153 |
+
if($_shippingMethod[0] == "chronopost" || $_shippingMethod[0] == "chronorelais") {
|
154 |
+
if(!$_deliver_on_saturday = Mage::helper('chronorelais')->getLivraisonSamediStatus($orderId)) {
|
155 |
+
$_deliver_on_saturday = Mage::helper('chronorelais')->getConfigData('carriers/'.$_shippingMethod[0].'/deliver_on_saturday');
|
156 |
+
} else {
|
157 |
+
if($_deliver_on_saturday=='Yes') {
|
158 |
+
$_deliver_on_saturday = 1;
|
159 |
+
} else {
|
160 |
+
$_deliver_on_saturday = 0;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
$is_sending_day = Mage::helper('chronorelais')->isSendingDay();
|
164 |
+
if($_deliver_on_saturday && $is_sending_day==true) {
|
165 |
+
$SaturdayShipping = 'S';
|
166 |
+
} elseif(!$_deliver_on_saturday && $is_sending_day==true) {
|
167 |
+
$SaturdayShipping = 'L';
|
168 |
+
}
|
169 |
+
}
|
170 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $SaturdayShipping);
|
171 |
+
$content .= $separator;
|
172 |
+
|
173 |
+
/* empty fields */
|
174 |
+
$content = $this->_addFieldToCsv($content, $delimiter, 0);
|
175 |
+
$content .= $separator;
|
176 |
+
$content = $this->_addFieldToCsv($content, $delimiter, 0);
|
177 |
+
$content .= $lineBreak;
|
178 |
+
}
|
179 |
+
|
180 |
+
/* decode the content, depending on the charset */
|
181 |
+
if ($fileCharset == 'ISO-8859-1') {
|
182 |
+
$content = utf8_decode($content);
|
183 |
+
}
|
184 |
+
|
185 |
+
/* pick file mime type, depending on the extension */
|
186 |
+
if ($fileExtension == '.txt') {
|
187 |
+
$fileMimeType = 'text/plain';
|
188 |
+
} else if ($fileExtension == '.csv') {
|
189 |
+
$fileMimeType = 'application/csv';
|
190 |
+
} else if ($fileExtension == '.chr') {
|
191 |
+
$fileMimeType = 'application/chr';
|
192 |
+
} else {
|
193 |
+
// default
|
194 |
+
$fileMimeType = 'text/plain';
|
195 |
+
}
|
196 |
+
|
197 |
+
/* download the file */
|
198 |
+
return $this->_prepareDownloadResponse($filename, $content, $fileMimeType .'; charset="'. $fileCharset .'"');
|
199 |
+
}
|
200 |
+
else {
|
201 |
+
$this->_getSession()->addError($this->__('No Order has been selected'));
|
202 |
+
}
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Export CSO Action
|
207 |
+
* Generates a CSV file to download (CSO format)
|
208 |
+
*/
|
209 |
+
public function exportcsoAction()
|
210 |
+
{
|
211 |
+
/* get the orders */
|
212 |
+
$orderIds = $this->getRequest()->getPost('order_ids');
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Get configuration
|
216 |
+
*/
|
217 |
+
$separator = Mage::helper('chronorelais')->getConfigurationFieldSeparator('cso');
|
218 |
+
$delimiter = Mage::helper('chronorelais')->getConfigurationFieldDelimiter('cso');
|
219 |
+
if ($delimiter == 'simple_quote') {
|
220 |
+
$delimiter = "'";
|
221 |
+
} else if ($delimiter == 'double_quotes') {
|
222 |
+
$delimiter = '"';
|
223 |
+
} else {
|
224 |
+
$delimiter = '';
|
225 |
+
}
|
226 |
+
$lineBreak = Mage::helper('chronorelais')->getConfigurationEndOfLineCharacter('cso');
|
227 |
+
if ($lineBreak == 'lf') {
|
228 |
+
$lineBreak = "\n";
|
229 |
+
} else if ($lineBreak == 'cr') {
|
230 |
+
$lineBreak = "\r";
|
231 |
+
} else if ($lineBreak == 'crlf') {
|
232 |
+
$lineBreak = "\r\n";
|
233 |
+
}
|
234 |
+
$fileExtension = Mage::helper('chronorelais')->getConfigurationFileExtension('cso');
|
235 |
+
$fileCharset = Mage::helper('chronorelais')->getConfigurationFileCharset('cso');
|
236 |
+
|
237 |
+
/* set the filename */
|
238 |
+
$filename = 'orders_exportcso_'.Mage::getSingleton('core/date')->date('Ymd_His').$fileExtension;
|
239 |
+
|
240 |
+
/* initialize the content variable */
|
241 |
+
$content = '';
|
242 |
+
|
243 |
+
if (!empty($orderIds)) {
|
244 |
+
foreach ($orderIds as $orderId) {
|
245 |
+
|
246 |
+
/* get the order */
|
247 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
248 |
+
$address = $order->getShippingAddress();
|
249 |
+
$billingAddress = $order->getBillingAddress();
|
250 |
+
|
251 |
+
/* customer id */
|
252 |
+
$content = $this->_addFieldToCsv($content, $delimiter, ($order->getCustomerId() ? $order->getCustomerId() : $address->getLastname()));
|
253 |
+
$content .= $separator;
|
254 |
+
/* Nom du point relais OU soci�t� si livraison � domicile */
|
255 |
+
//$content = $this->_addFieldToCsv($content, $delimiter, $_shippingMethod[0] == "chronorelais" ? $address->getCompany() : "");
|
256 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $address->getCompany());
|
257 |
+
$content .= $separator;
|
258 |
+
/* empty */
|
259 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue(""));
|
260 |
+
$content .= $separator;
|
261 |
+
/* street address */
|
262 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getStreet(1)));
|
263 |
+
$content .= $separator;
|
264 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getStreet(2)));
|
265 |
+
$content .= $separator;
|
266 |
+
/* Code Porte */
|
267 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue(""));
|
268 |
+
$content .= $separator;
|
269 |
+
/* country code */
|
270 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getCountry()));
|
271 |
+
$content .= $separator;
|
272 |
+
/* postal code */
|
273 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->removeSpclChars($this->getValue($address->getPostcode())));
|
274 |
+
$content .= $separator;
|
275 |
+
/* city */
|
276 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue(strtoupper($address->getCity())));
|
277 |
+
$content .= $separator;
|
278 |
+
/* lastname */
|
279 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getLastname()));
|
280 |
+
$content .= $separator;
|
281 |
+
/* firstname */
|
282 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($address->getFirstname()));
|
283 |
+
$content .= $separator;
|
284 |
+
/* telephone */
|
285 |
+
$telephone = trim(ereg_replace("[^0-9.-]", " ", $address->getTelephone()));
|
286 |
+
$telephone = (strlen($telephone)>=10 ? $telephone : '');
|
287 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $telephone);
|
288 |
+
$content .= $separator;
|
289 |
+
/* email */
|
290 |
+
$customer_email = ($address->getEmail()) ? $address->getEmail() : ($billingAddress->getEmail() ? $billingAddress->getEmail() : $order->getCustomerEmail());
|
291 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($customer_email));
|
292 |
+
$content .= $separator;
|
293 |
+
/* VAT number*/
|
294 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue(""));
|
295 |
+
$content .= $separator;
|
296 |
+
/* productCode*/
|
297 |
+
$productCode = ''; //Default code for chronorelais
|
298 |
+
$_shippingMethod = explode('_',$order->getShippingMethod());
|
299 |
+
if($_shippingMethod[0] == "chronopost") { // Conditions for chronorelais code
|
300 |
+
$productCode = 1;
|
301 |
+
} elseif($_shippingMethod[0] == "chronorelais") {
|
302 |
+
//$productCode = 6; //for chronorelais
|
303 |
+
} else {
|
304 |
+
$productCode = 4; //for chronoexpress
|
305 |
+
}
|
306 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $productCode);
|
307 |
+
$content .= $separator;
|
308 |
+
/* real order id */
|
309 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue($order->getRealOrderId()));
|
310 |
+
$content .= $separator;
|
311 |
+
/* total weight */
|
312 |
+
$order_weight = number_format($order->getWeight(), 2 , '.' , '');
|
313 |
+
$order_weight = $order_weight * 1000;
|
314 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $order_weight);
|
315 |
+
$content .= $separator;
|
316 |
+
/* Valeur Assur�e field*/
|
317 |
+
$content = $this->_addFieldToCsv($content, $delimiter, 0);
|
318 |
+
$content .= $separator;
|
319 |
+
/* Inform the recipient by e-mail field*/
|
320 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue("N"));
|
321 |
+
$content .= $separator;
|
322 |
+
/* Print Waybill field*/
|
323 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue("O"));
|
324 |
+
$content .= $separator;
|
325 |
+
/* sub-account field*/
|
326 |
+
$sub_account = Mage::helper('chronorelais')->getConfigurationSubAccountNumber();
|
327 |
+
$content = $this->_addFieldToCsv($content, $delimiter, (strlen($sub_account)==3 ? $sub_account : ""));
|
328 |
+
$content .= $separator;
|
329 |
+
/* Nature of item field*/
|
330 |
+
$content = $this->_addFieldToCsv($content, $delimiter, 2);
|
331 |
+
$content .= $separator;
|
332 |
+
/* Description of Consignment field*/
|
333 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue(""));
|
334 |
+
$content .= $separator;
|
335 |
+
/* Print pro-forma (customs) field*/
|
336 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $this->getValue("N"));
|
337 |
+
$content .= $separator;
|
338 |
+
/* Declared value (customs) field*/
|
339 |
+
$content = $this->_addFieldToCsv($content, $delimiter, 0);
|
340 |
+
$content .= $separator;
|
341 |
+
/* Livraison Samedi (Delivery Saturday) field*/
|
342 |
+
$SaturdayShipping = 0; //default value for the saturday shipping
|
343 |
+
$send_day = strtolower(date('l'));
|
344 |
+
if($_shippingMethod[0] == "chronopost" || $_shippingMethod[0] == "chronorelais") {
|
345 |
+
if(!$_deliver_on_saturday = Mage::helper('chronorelais')->getLivraisonSamediStatus($orderId)) {
|
346 |
+
$_deliver_on_saturday = Mage::helper('chronorelais')->getConfigData('carriers/'.$_shippingMethod[0].'/deliver_on_saturday');
|
347 |
+
} else {
|
348 |
+
if($_deliver_on_saturday=='Yes') {
|
349 |
+
$_deliver_on_saturday = 1;
|
350 |
+
} else {
|
351 |
+
$_deliver_on_saturday = 0;
|
352 |
+
}
|
353 |
+
}
|
354 |
+
$is_sending_day = Mage::helper('chronorelais')->isSendingDay();
|
355 |
+
if($_deliver_on_saturday && $is_sending_day) {
|
356 |
+
$SaturdayShipping = 1;
|
357 |
+
} elseif(!$_deliver_on_saturday && $is_sending_day) {
|
358 |
+
$SaturdayShipping = 2;
|
359 |
+
}
|
360 |
+
}
|
361 |
+
$content = $this->_addFieldToCsv($content, $delimiter, $SaturdayShipping);
|
362 |
+
$content .= $lineBreak;
|
363 |
+
}
|
364 |
+
|
365 |
+
/* decode the content, depending on the charset */
|
366 |
+
if ($fileCharset == 'ISO-8859-1') {
|
367 |
+
$content = utf8_decode($content);
|
368 |
+
}
|
369 |
+
|
370 |
+
/* pick file mime type, depending on the extension */
|
371 |
+
if ($fileExtension == '.txt') {
|
372 |
+
$fileMimeType = 'text/plain';
|
373 |
+
} else if ($fileExtension == '.csv') {
|
374 |
+
$fileMimeType = 'application/csv';
|
375 |
+
} else if ($fileExtension == '.chr') {
|
376 |
+
$fileMimeType = 'application/chr';
|
377 |
+
} else {
|
378 |
+
// default
|
379 |
+
$fileMimeType = 'text/plain';
|
380 |
+
}
|
381 |
+
|
382 |
+
/* download the file */
|
383 |
+
return $this->_prepareDownloadResponse($filename, $content, $fileMimeType .'; charset="'. $fileCharset .'"');
|
384 |
+
}
|
385 |
+
else {
|
386 |
+
$this->_getSession()->addError($this->__('No Order has been selected'));
|
387 |
+
}
|
388 |
+
}
|
389 |
+
|
390 |
+
/* Save the Livraison le Samedi status to orders */
|
391 |
+
public function saveLivraisonSamediStatusAction()
|
392 |
+
{
|
393 |
+
/* get the orders */
|
394 |
+
$orderIds = $this->getRequest()->getPost('order_ids');
|
395 |
+
$status = $this->getRequest()->getPost('status');
|
396 |
+
$_connection = Mage::getSingleton('core/resource')->getConnection('core_write');
|
397 |
+
$_table = Mage::getSingleton('core/resource')->getTableName('sales_chronopost_order_export_status');
|
398 |
+
$exceptions = array();
|
399 |
+
|
400 |
+
foreach($orderIds as $orderId) {
|
401 |
+
$order_details = Mage::getModel('sales/order')->load($orderId);
|
402 |
+
$shipping_method = '';
|
403 |
+
$livraison_le_samedi = $status;
|
404 |
+
if($shipping_method = $order_details->getShippingMethod()) {
|
405 |
+
$shipping_method = explode('_',$shipping_method);
|
406 |
+
if($shipping_method[0]=='chronoexpress') {
|
407 |
+
$livraison_le_samedi = '--';
|
408 |
+
}
|
409 |
+
}
|
410 |
+
$condition = array(
|
411 |
+
$_connection->quoteInto('order_id = ?', $orderId),
|
412 |
+
);
|
413 |
+
$_connection->delete($_table, $condition);
|
414 |
+
|
415 |
+
$dataLine = array(
|
416 |
+
'order_id' => $orderId,
|
417 |
+
'livraison_le_samedi' => $livraison_le_samedi
|
418 |
+
);
|
419 |
+
try {
|
420 |
+
$_connection->insert($_table, $dataLine);
|
421 |
+
}
|
422 |
+
catch (Exception $e) {
|
423 |
+
$exceptions[] = Mage::helper('chronorelais')->__('Order assigning error: ' . $e->getMessage());
|
424 |
+
}
|
425 |
+
}
|
426 |
+
if($exceptions) {
|
427 |
+
$this->_getSession()->addError($exceptions);
|
428 |
+
} else {
|
429 |
+
$this->_getSession()->addSuccess($this->__('Livraison le Samedi statut a été ajouté'));
|
430 |
+
}
|
431 |
+
$this->_redirect('*/*/index');
|
432 |
+
}
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Add a new field to the csv file
|
436 |
+
* @param csvContent : the current csv content
|
437 |
+
* @param fieldDelimiter : the delimiter character
|
438 |
+
* @param fieldContent : the content to add
|
439 |
+
* @return : the concatenation of current content and content to add
|
440 |
+
*/
|
441 |
+
private function _addFieldToCsv($csvContent, $fieldDelimiter, $fieldContent) {
|
442 |
+
return $csvContent . $fieldDelimiter . $fieldContent . $fieldDelimiter;
|
443 |
+
}
|
444 |
+
|
|
|
445 |
}
|
app/code/community/Chronopost/Chronorelais/controllers/ImportController.php
CHANGED
@@ -1,249 +1,249 @@
|
|
1 |
-
<?php
|
2 |
-
class Chronopost_Chronorelais_ImportController extends Mage_Adminhtml_Controller_Action
|
3 |
-
{
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Constructor
|
7 |
-
*/
|
8 |
-
protected function _construct()
|
9 |
-
{
|
10 |
-
$this->setUsedModuleName('Chronopost_Chronorelais');
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Main action : show import form
|
15 |
-
*/
|
16 |
-
public function indexAction()
|
17 |
-
{
|
18 |
-
$this->loadLayout()
|
19 |
-
->_setActiveMenu('sales/chronorelais/import')
|
20 |
-
->_addContent($this->getLayout()->createBlock('chronorelais/import_form'))
|
21 |
-
->renderLayout();
|
22 |
-
}
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Import Action
|
26 |
-
*/
|
27 |
-
public function importAction()
|
28 |
-
{
|
29 |
-
if ($this->getRequest()->isPost() && !empty($_FILES['import_chronorelais_file']['tmp_name'])) {
|
30 |
-
try {
|
31 |
-
$trackingTitle = $_POST['import_chronorelais_tracking_title'];
|
32 |
-
$this->_importChronorelaisFile($_FILES['import_chronorelais_file']['tmp_name'], $trackingTitle);
|
33 |
-
}
|
34 |
-
catch (Mage_Core_Exception $e) {
|
35 |
-
$this->_getSession()->addError($e->getMessage());
|
36 |
-
}
|
37 |
-
catch (Exception $e) {
|
38 |
-
$this->_getSession()->addError($e->getMessage());
|
39 |
-
$this->_getSession()->addError($this->__('Invalid file upload attempt'));
|
40 |
-
}
|
41 |
-
}
|
42 |
-
else {
|
43 |
-
$this->_getSession()->addError($this->__('Invalid file upload attempt'));
|
44 |
-
}
|
45 |
-
$this->_redirect('*/*/index');
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Importation logic
|
50 |
-
* @param string $fileName
|
51 |
-
* @param string $trackingTitle
|
52 |
-
*/
|
53 |
-
protected function _importChronorelaisFile($fileName, $trackingTitle)
|
54 |
-
{
|
55 |
-
/**
|
56 |
-
* File handling
|
57 |
-
**/
|
58 |
-
ini_set('auto_detect_line_endings', true);
|
59 |
-
$csvObject = new Varien_File_Csv();
|
60 |
-
$csvData = $csvObject->getData($fileName);
|
61 |
-
|
62 |
-
/**
|
63 |
-
* File expected fields
|
64 |
-
*/
|
65 |
-
$expectedCsvFields = array(
|
66 |
-
0 => $this->__('Order Id'),
|
67 |
-
1 => $this->__('Tracking Number')
|
68 |
-
);
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Get configuration
|
72 |
-
*/
|
73 |
-
$sendEmail = Mage::helper('chronorelais')->getConfigurationSendEmail();
|
74 |
-
$comment = Mage::helper('chronorelais')->getConfigurationShippingComment();
|
75 |
-
$includeComment = Mage::helper('chronorelais')->getConfigurationIncludeComment();
|
76 |
-
|
77 |
-
/* debug */
|
78 |
-
//$this->_getSession()->addSuccess($this->__('%s - %s - %s - %s', $sendEmail, $comment, $includeComment, $trackingTitle));
|
79 |
-
|
80 |
-
/**
|
81 |
-
* $k is line number
|
82 |
-
* $v is line content array
|
83 |
-
*/
|
84 |
-
foreach ($csvData as $k => $v) {
|
85 |
-
|
86 |
-
/**
|
87 |
-
* End of file has more than one empty lines
|
88 |
-
*/
|
89 |
-
if (count($v) <= 1 && !strlen($v[0])) {
|
90 |
-
continue;
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Check that the number of fields is not lower than expected
|
95 |
-
*/
|
96 |
-
if (count($v) < count($expectedCsvFields)) {
|
97 |
-
$this->_getSession()->addError($this->__('Line %s format is invalid and has been ignored', $k));
|
98 |
-
continue;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Get fields content
|
103 |
-
*/
|
104 |
-
$orderId = $v[0];
|
105 |
-
$trackingNumber = $v[1];
|
106 |
-
|
107 |
-
/* for debug */
|
108 |
-
//$this->_getSession()->addSuccess($this->__('Lecture ligne %s: %s - %s', $k, $orderId, $trackingNumber));
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Try to load the order
|
112 |
-
*/
|
113 |
-
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
114 |
-
if (!$order->getId()) {
|
115 |
-
$this->_getSession()->addError($this->__('Order %s does not exist', $orderId));
|
116 |
-
continue;
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Try to create a shipment
|
121 |
-
*/
|
122 |
-
$shipmentId = $this->_createShipment($order, $trackingNumber, $trackingTitle, $sendEmail, $comment, $includeComment);
|
123 |
-
|
124 |
-
if ($shipmentId != 0) {
|
125 |
-
$this->_getSession()->addSuccess($this->__('Shipment %s created for order %s, with tracking number %s', $shipmentId, $orderId, $trackingNumber));
|
126 |
-
}
|
127 |
-
|
128 |
-
}//foreach
|
129 |
-
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Create new shipment for order
|
134 |
-
* Inspired by Mage_Sales_Model_Order_Shipment_Api methods
|
135 |
-
*
|
136 |
-
* @param Mage_Sales_Model_Order $order (it should exist, no control is done into the method)
|
137 |
-
* @param string $trackingNumber
|
138 |
-
* @param string $trackingTitle
|
139 |
-
* @param booleam $email
|
140 |
-
* @param string $comment
|
141 |
-
* @param boolean $includeComment
|
142 |
-
* @return int : shipment real id if creation was ok, else 0
|
143 |
-
*/
|
144 |
-
public function _createShipment($order, $trackingNumber, $trackingTitle, $email, $comment, $includeComment)
|
145 |
-
{
|
146 |
-
/**
|
147 |
-
* Check shipment creation availability
|
148 |
-
*/
|
149 |
-
if (!$order->canShip()) {
|
150 |
-
$this->_getSession()->addError($this->__('Order %s can not be shipped or has already been shipped', $order->getRealOrderId()));
|
151 |
-
return 0;
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Initialize the Mage_Sales_Model_Order_Shipment object
|
156 |
-
*/
|
157 |
-
$convertor = Mage::getModel('sales/convert_order');
|
158 |
-
$shipment = $convertor->toShipment($order);
|
159 |
-
|
160 |
-
/**
|
161 |
-
* Add the items to send
|
162 |
-
*/
|
163 |
-
foreach ($order->getAllItems() as $orderItem) {
|
164 |
-
if (!$orderItem->getQtyToShip()) {
|
165 |
-
continue;
|
166 |
-
}
|
167 |
-
if ($orderItem->getIsVirtual()) {
|
168 |
-
continue;
|
169 |
-
}
|
170 |
-
|
171 |
-
$item = $convertor->itemToShipmentItem($orderItem);
|
172 |
-
$qty = $orderItem->getQtyToShip();
|
173 |
-
$item->setQty($qty);
|
174 |
-
|
175 |
-
$shipment->addItem($item);
|
176 |
-
}//foreach
|
177 |
-
|
178 |
-
$shipment->register();
|
179 |
-
|
180 |
-
/**
|
181 |
-
* Tracking number instanciation
|
182 |
-
*/
|
183 |
-
|
184 |
-
$_shippingMethod = explode("_",$order->getShippingMethod());
|
185 |
-
switch($_shippingMethod[0]) {
|
186 |
-
case "chronopost":
|
187 |
-
case "chronorelais":
|
188 |
-
case "chronoexpress":
|
189 |
-
$carrier_code = $_shippingMethod[0];
|
190 |
-
$popup = 1;
|
191 |
-
/*$hash = Mage::helper('core')->urlEncode("order_id:{$order->getId()}:{$order->getProtectCode()}");
|
192 |
-
$tracking_url = Mage::getBaseUrl().'chronorelais/relais/tracking/hash/'.$hash.'/';*/
|
193 |
-
$tracking_url = str_replace('{tracking_number}', $trackingNumber, Mage::helper('chronorelais')->getConfigurationTrackingViewUrl());
|
194 |
-
$tracking_title = $this->__('Track Your Order');
|
195 |
-
$tracking_order = '<p><a title="'.$tracking_title.'" href="'.$tracking_url.'"><b>'.$tracking_title.'</b></a></p>';
|
196 |
-
break;
|
197 |
-
default:
|
198 |
-
$carrier_code = 'custom';
|
199 |
-
$popup = 0;
|
200 |
-
$tracking_order = '';
|
201 |
-
break;
|
202 |
-
}
|
203 |
-
|
204 |
-
$track = Mage::getModel('sales/order_shipment_track')
|
205 |
-
->setNumber($trackingNumber)
|
206 |
-
->setCarrierCode($carrier_code)
|
207 |
-
->setTitle($trackingTitle)
|
208 |
-
->setPopup($popup);
|
209 |
-
$shipment->addTrack($track);
|
210 |
-
|
211 |
-
/**
|
212 |
-
* Comment handling
|
213 |
-
*/
|
214 |
-
$shipment->addComment($comment, $email && $includeComment);
|
215 |
-
|
216 |
-
/**
|
217 |
-
* Change order status to Processing
|
218 |
-
*/
|
219 |
-
$shipment->getOrder()->setIsInProcess(true);
|
220 |
-
|
221 |
-
/**
|
222 |
-
* If e-mail, set as sent (must be done before shipment object saving)
|
223 |
-
*/
|
224 |
-
if ($email) {
|
225 |
-
$shipment->setEmailSent(true);
|
226 |
-
}
|
227 |
-
|
228 |
-
try {
|
229 |
-
/**
|
230 |
-
* Save the created shipment and the updated order
|
231 |
-
*/
|
232 |
-
$shipment->save();
|
233 |
-
$shipment->getOrder()->save();
|
234 |
-
|
235 |
-
/**
|
236 |
-
* Email sending
|
237 |
-
*/
|
238 |
-
$shipment->sendEmail($email, ($includeComment ? $tracking_order.$comment : $tracking_order));
|
239 |
-
} catch (Mage_Core_Exception $e) {
|
240 |
-
$this->_getSession()->addError($this->__('Shipment creation error for Order %s : %s', $orderId, $e->getMessage()));
|
241 |
-
return 0;
|
242 |
-
}
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Everything was ok : return Shipment real id
|
246 |
-
*/
|
247 |
-
return $shipment->getIncrementId();
|
248 |
-
}
|
249 |
}
|
1 |
+
<?php
|
2 |
+
class Chronopost_Chronorelais_ImportController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Constructor
|
7 |
+
*/
|
8 |
+
protected function _construct()
|
9 |
+
{
|
10 |
+
$this->setUsedModuleName('Chronopost_Chronorelais');
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Main action : show import form
|
15 |
+
*/
|
16 |
+
public function indexAction()
|
17 |
+
{
|
18 |
+
$this->loadLayout()
|
19 |
+
->_setActiveMenu('sales/chronorelais/import')
|
20 |
+
->_addContent($this->getLayout()->createBlock('chronorelais/import_form'))
|
21 |
+
->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Import Action
|
26 |
+
*/
|
27 |
+
public function importAction()
|
28 |
+
{
|
29 |
+
if ($this->getRequest()->isPost() && !empty($_FILES['import_chronorelais_file']['tmp_name'])) {
|
30 |
+
try {
|
31 |
+
$trackingTitle = $_POST['import_chronorelais_tracking_title'];
|
32 |
+
$this->_importChronorelaisFile($_FILES['import_chronorelais_file']['tmp_name'], $trackingTitle);
|
33 |
+
}
|
34 |
+
catch (Mage_Core_Exception $e) {
|
35 |
+
$this->_getSession()->addError($e->getMessage());
|
36 |
+
}
|
37 |
+
catch (Exception $e) {
|
38 |
+
$this->_getSession()->addError($e->getMessage());
|
39 |
+
$this->_getSession()->addError($this->__('Invalid file upload attempt'));
|
40 |
+
}
|
41 |
+
}
|
42 |
+
else {
|
43 |
+
$this->_getSession()->addError($this->__('Invalid file upload attempt'));
|
44 |
+
}
|
45 |
+
$this->_redirect('*/*/index');
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Importation logic
|
50 |
+
* @param string $fileName
|
51 |
+
* @param string $trackingTitle
|
52 |
+
*/
|
53 |
+
protected function _importChronorelaisFile($fileName, $trackingTitle)
|
54 |
+
{
|
55 |
+
/**
|
56 |
+
* File handling
|
57 |
+
**/
|
58 |
+
ini_set('auto_detect_line_endings', true);
|
59 |
+
$csvObject = new Varien_File_Csv();
|
60 |
+
$csvData = $csvObject->getData($fileName);
|
61 |
+
|
62 |
+
/**
|
63 |
+
* File expected fields
|
64 |
+
*/
|
65 |
+
$expectedCsvFields = array(
|
66 |
+
0 => $this->__('Order Id'),
|
67 |
+
1 => $this->__('Tracking Number')
|
68 |
+
);
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Get configuration
|
72 |
+
*/
|
73 |
+
$sendEmail = Mage::helper('chronorelais')->getConfigurationSendEmail();
|
74 |
+
$comment = Mage::helper('chronorelais')->getConfigurationShippingComment();
|
75 |
+
$includeComment = Mage::helper('chronorelais')->getConfigurationIncludeComment();
|
76 |
+
|
77 |
+
/* debug */
|
78 |
+
//$this->_getSession()->addSuccess($this->__('%s - %s - %s - %s', $sendEmail, $comment, $includeComment, $trackingTitle));
|
79 |
+
|
80 |
+
/**
|
81 |
+
* $k is line number
|
82 |
+
* $v is line content array
|
83 |
+
*/
|
84 |
+
foreach ($csvData as $k => $v) {
|
85 |
+
|
86 |
+
/**
|
87 |
+
* End of file has more than one empty lines
|
88 |
+
*/
|
89 |
+
if (count($v) <= 1 && !strlen($v[0])) {
|
90 |
+
continue;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Check that the number of fields is not lower than expected
|
95 |
+
*/
|
96 |
+
if (count($v) < count($expectedCsvFields)) {
|
97 |
+
$this->_getSession()->addError($this->__('Line %s format is invalid and has been ignored', $k));
|
98 |
+
continue;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Get fields content
|
103 |
+
*/
|
104 |
+
$orderId = $v[0];
|
105 |
+
$trackingNumber = $v[1];
|
106 |
+
|
107 |
+
/* for debug */
|
108 |
+
//$this->_getSession()->addSuccess($this->__('Lecture ligne %s: %s - %s', $k, $orderId, $trackingNumber));
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Try to load the order
|
112 |
+
*/
|
113 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
114 |
+
if (!$order->getId()) {
|
115 |
+
$this->_getSession()->addError($this->__('Order %s does not exist', $orderId));
|
116 |
+
continue;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Try to create a shipment
|
121 |
+
*/
|
122 |
+
$shipmentId = $this->_createShipment($order, $trackingNumber, $trackingTitle, $sendEmail, $comment, $includeComment);
|
123 |
+
|
124 |
+
if ($shipmentId != 0) {
|
125 |
+
$this->_getSession()->addSuccess($this->__('Shipment %s created for order %s, with tracking number %s', $shipmentId, $orderId, $trackingNumber));
|
126 |
+
}
|
127 |
+
|
128 |
+
}//foreach
|
129 |
+
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Create new shipment for order
|
134 |
+
* Inspired by Mage_Sales_Model_Order_Shipment_Api methods
|
135 |
+
*
|
136 |
+
* @param Mage_Sales_Model_Order $order (it should exist, no control is done into the method)
|
137 |
+
* @param string $trackingNumber
|
138 |
+
* @param string $trackingTitle
|
139 |
+
* @param booleam $email
|
140 |
+
* @param string $comment
|
141 |
+
* @param boolean $includeComment
|
142 |
+
* @return int : shipment real id if creation was ok, else 0
|
143 |
+
*/
|
144 |
+
public function _createShipment($order, $trackingNumber, $trackingTitle, $email, $comment, $includeComment)
|
145 |
+
{
|
146 |
+
/**
|
147 |
+
* Check shipment creation availability
|
148 |
+
*/
|
149 |
+
if (!$order->canShip()) {
|
150 |
+
$this->_getSession()->addError($this->__('Order %s can not be shipped or has already been shipped', $order->getRealOrderId()));
|
151 |
+
return 0;
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Initialize the Mage_Sales_Model_Order_Shipment object
|
156 |
+
*/
|
157 |
+
$convertor = Mage::getModel('sales/convert_order');
|
158 |
+
$shipment = $convertor->toShipment($order);
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Add the items to send
|
162 |
+
*/
|
163 |
+
foreach ($order->getAllItems() as $orderItem) {
|
164 |
+
if (!$orderItem->getQtyToShip()) {
|
165 |
+
continue;
|
166 |
+
}
|
167 |
+
if ($orderItem->getIsVirtual()) {
|
168 |
+
continue;
|
169 |
+
}
|
170 |
+
|
171 |
+
$item = $convertor->itemToShipmentItem($orderItem);
|
172 |
+
$qty = $orderItem->getQtyToShip();
|
173 |
+
$item->setQty($qty);
|
174 |
+
|
175 |
+
$shipment->addItem($item);
|
176 |
+
}//foreach
|
177 |
+
|
178 |
+
$shipment->register();
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Tracking number instanciation
|
182 |
+
*/
|
183 |
+
|
184 |
+
$_shippingMethod = explode("_",$order->getShippingMethod());
|
185 |
+
switch($_shippingMethod[0]) {
|
186 |
+
case "chronopost":
|
187 |
+
case "chronorelais":
|
188 |
+
case "chronoexpress":
|
189 |
+
$carrier_code = $_shippingMethod[0];
|
190 |
+
$popup = 1;
|
191 |
+
/*$hash = Mage::helper('core')->urlEncode("order_id:{$order->getId()}:{$order->getProtectCode()}");
|
192 |
+
$tracking_url = Mage::getBaseUrl().'chronorelais/relais/tracking/hash/'.$hash.'/';*/
|
193 |
+
$tracking_url = str_replace('{tracking_number}', $trackingNumber, Mage::helper('chronorelais')->getConfigurationTrackingViewUrl());
|
194 |
+
$tracking_title = $this->__('Track Your Order');
|
195 |
+
$tracking_order = '<p><a title="'.$tracking_title.'" href="'.$tracking_url.'"><b>'.$tracking_title.'</b></a></p>';
|
196 |
+
break;
|
197 |
+
default:
|
198 |
+
$carrier_code = 'custom';
|
199 |
+
$popup = 0;
|
200 |
+
$tracking_order = '';
|
201 |
+
break;
|
202 |
+
}
|
203 |
+
|
204 |
+
$track = Mage::getModel('sales/order_shipment_track')
|
205 |
+
->setNumber($trackingNumber) //setTrackingNumber ?
|
206 |
+
->setCarrierCode($carrier_code)
|
207 |
+
->setTitle($trackingTitle)
|
208 |
+
->setPopup($popup);
|
209 |
+
$shipment->addTrack($track);
|
210 |
+
|
211 |
+
/**
|
212 |
+
* Comment handling
|
213 |
+
*/
|
214 |
+
$shipment->addComment($comment, $email && $includeComment);
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Change order status to Processing
|
218 |
+
*/
|
219 |
+
$shipment->getOrder()->setIsInProcess(true);
|
220 |
+
|
221 |
+
/**
|
222 |
+
* If e-mail, set as sent (must be done before shipment object saving)
|
223 |
+
*/
|
224 |
+
if ($email) {
|
225 |
+
$shipment->setEmailSent(true);
|
226 |
+
}
|
227 |
+
|
228 |
+
try {
|
229 |
+
/**
|
230 |
+
* Save the created shipment and the updated order
|
231 |
+
*/
|
232 |
+
$shipment->save();
|
233 |
+
$shipment->getOrder()->save();
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Email sending
|
237 |
+
*/
|
238 |
+
$shipment->sendEmail($email, ($includeComment ? $tracking_order.$comment : $tracking_order));
|
239 |
+
} catch (Mage_Core_Exception $e) {
|
240 |
+
$this->_getSession()->addError($this->__('Shipment creation error for Order %s : %s', $orderId, $e->getMessage()));
|
241 |
+
return 0;
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Everything was ok : return Shipment real id
|
246 |
+
*/
|
247 |
+
return $shipment->getIncrementId();
|
248 |
+
}
|
249 |
}
|
app/code/community/Chronopost/Chronorelais/controllers/Sales/ImpressionController.php
CHANGED
@@ -1,556 +1,567 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
->_setActiveMenu('sales/chronorelais')
|
27 |
-
->_addContent($this->getLayout()->createBlock('chronorelais/sales_impression'))
|
28 |
-
->renderLayout();
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
->addObject($shipment)
|
40 |
-
->
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
->
|
58 |
-
->setHeader('
|
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 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
}
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
556 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once 'Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php';
|
4 |
+
|
5 |
+
class Chronopost_Chronorelais_Sales_ImpressionController extends Mage_Adminhtml_Sales_Order_ShipmentController {
|
6 |
+
|
7 |
+
protected $_trackingNumbers = '';
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Additional initialization
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
protected function _construct() {
|
14 |
+
$this->setUsedModuleName('Chronopost_Chronorelais');
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Shipping grid
|
19 |
+
*/
|
20 |
+
public function indexAction() {
|
21 |
+
if (!extension_loaded('soap')) {
|
22 |
+
$this->_getSession()->addError($this->__('The SOAP extension is not installed in the server. Please contact the site administrator. Sorry for inconvenience.'));
|
23 |
+
return $this->_redirectReferer();
|
24 |
+
}
|
25 |
+
$this->loadLayout()
|
26 |
+
->_setActiveMenu('sales/chronorelais')
|
27 |
+
->_addContent($this->getLayout()->createBlock('chronorelais/sales_impression'))
|
28 |
+
->renderLayout();
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Save shipment and order in one transaction
|
33 |
+
* @param Mage_Sales_Model_Order_Shipment $shipment
|
34 |
+
*/
|
35 |
+
protected function _saveShipment($shipment) {
|
36 |
+
$shipment->getOrder()->setIsInProcess(true);
|
37 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
38 |
+
->addObject($shipment)
|
39 |
+
->addObject($shipment->getOrder())
|
40 |
+
->save();
|
41 |
+
|
42 |
+
return $this;
|
43 |
+
}
|
44 |
+
|
45 |
+
protected function _processDownload($resource, $resourceType) {
|
46 |
+
$helper = Mage::helper('downloadable/download');
|
47 |
+
/* @var $helper Mage_Downloadable_Helper_Download */
|
48 |
+
|
49 |
+
$helper->setResource($resource, $resourceType);
|
50 |
+
|
51 |
+
$fileName = $helper->getFilename();
|
52 |
+
$contentType = $helper->getContentType();
|
53 |
+
|
54 |
+
$this->getResponse()
|
55 |
+
->setHttpResponseCode(200)
|
56 |
+
->setHeader('Pragma', 'public', true)
|
57 |
+
->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
|
58 |
+
->setHeader('Content-type', $contentType, true);
|
59 |
+
|
60 |
+
if ($fileSize = $helper->getFilesize()) {
|
61 |
+
$this->getResponse()
|
62 |
+
->setHeader('Content-Length', $fileSize);
|
63 |
+
}
|
64 |
+
|
65 |
+
if ($contentDisposition = $helper->getContentDisposition()) {
|
66 |
+
$this->getResponse()
|
67 |
+
->setHeader('Content-Disposition', $contentDisposition . '; filename=' . $fileName);
|
68 |
+
}
|
69 |
+
|
70 |
+
$this->getResponse()
|
71 |
+
->clearBody();
|
72 |
+
$this->getResponse()
|
73 |
+
->sendHeaders();
|
74 |
+
|
75 |
+
$helper->output();
|
76 |
+
}
|
77 |
+
|
78 |
+
protected function getTrackingNumber($shipmentId) {
|
79 |
+
$shipment = Mage::getModel('sales/order_shipment')->load($shipmentId);
|
80 |
+
|
81 |
+
//On récupère le numéro de tracking
|
82 |
+
$tracks = $shipment->getTracksCollection();
|
83 |
+
foreach ($tracks as $track) {
|
84 |
+
if ($track->getParentId() == $shipmentId) {
|
85 |
+
$this->_trackingNumbers .= $track->getnumber();
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
return $this->_trackingNumbers;
|
90 |
+
}
|
91 |
+
|
92 |
+
protected function getFilledValue($value) {
|
93 |
+
if ($value) {
|
94 |
+
return $this->removeaccents(trim($value));
|
95 |
+
} else {
|
96 |
+
return '';
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
protected function checkMobileNumber($value) {
|
101 |
+
if ($reqvalue = trim($value)) {
|
102 |
+
$_number = substr($reqvalue, 0, 2);
|
103 |
+
$fixed_array = array('01', '02', '03', '04', '05', '06', '06');
|
104 |
+
if (in_array($_number, $fixed_array)) {
|
105 |
+
return $reqvalue;
|
106 |
+
} else {
|
107 |
+
return '';
|
108 |
+
}
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
protected function getExpeditionParams($shipment, $_shippingMethod) {
|
113 |
+
$_order = $shipment->getOrder();
|
114 |
+
$_shippingAddress = $shipment->getShippingAddress();
|
115 |
+
$_billingAddress = $shipment->getBillingAddress();
|
116 |
+
$_helper = Mage::helper('chronorelais');
|
117 |
+
|
118 |
+
if ($_shippingMethod[0] == 'chronorelais' || $_shippingMethod[0] == 'chronopost' || $_shippingMethod[0] == 'chronoexpress') {
|
119 |
+
$esdParams = $header = $shipper = $customer = $recipient = $ref = $skybill = $skybillParams = $password = array();
|
120 |
+
|
121 |
+
//esdParams parameters
|
122 |
+
$esdParams = array(
|
123 |
+
'height' => '',
|
124 |
+
'width' => '',
|
125 |
+
'length' => ''
|
126 |
+
);
|
127 |
+
|
128 |
+
//header parameters
|
129 |
+
$header = array(
|
130 |
+
'idEmit' => 'CHRFR',
|
131 |
+
'accountNumber' => $_helper->getConfigurationAccountNumber(),
|
132 |
+
'subAccount' => $_helper->getConfigurationSubAccountNumber()
|
133 |
+
);
|
134 |
+
|
135 |
+
//shipper parameters
|
136 |
+
$shipperMobilePhone = $this->checkMobileNumber($_helper->getConfigurationShipperInfo('mobilephone'));
|
137 |
+
$shipper = array(
|
138 |
+
'shipperAdress1' => $_helper->getConfigurationShipperInfo('address1'),
|
139 |
+
'shipperAdress2' => $_helper->getConfigurationShipperInfo('address2'),
|
140 |
+
'shipperCity' => $_helper->getConfigurationShipperInfo('city'),
|
141 |
+
'shipperCivility' => $_helper->getConfigurationShipperInfo('civility'),
|
142 |
+
'shipperContactName' => $_helper->getConfigurationShipperInfo('contactname'),
|
143 |
+
'shipperCountry' => $_helper->getConfigurationShipperInfo('country'),
|
144 |
+
'shipperEmail' => $_helper->getConfigurationShipperInfo('email'),
|
145 |
+
'shipperMobilePhone' => $shipperMobilePhone,
|
146 |
+
'shipperName' => $_helper->getConfigurationShipperInfo('name'),
|
147 |
+
'shipperName2' => $_helper->getConfigurationShipperInfo('name2'),
|
148 |
+
'shipperPhone' => $_helper->getConfigurationShipperInfo('phone'),
|
149 |
+
'shipperPreAlert' => '',
|
150 |
+
'shipperZipCode' => $_helper->getConfigurationShipperInfo('zipcode')
|
151 |
+
);
|
152 |
+
|
153 |
+
//customer parameters
|
154 |
+
$customerMobilePhone = $this->checkMobileNumber($_helper->getConfigurationCustomerInfo('mobilephone'));
|
155 |
+
$customer = array(
|
156 |
+
'customerAdress1' => $_helper->getConfigurationCustomerInfo('address1'),
|
157 |
+
'customerAdress2' => $_helper->getConfigurationCustomerInfo('address2'),
|
158 |
+
'customerCity' => $_helper->getConfigurationCustomerInfo('city'),
|
159 |
+
'customerCivility' => $_helper->getConfigurationCustomerInfo('civility'),
|
160 |
+
'customerContactName' => $_helper->getConfigurationCustomerInfo('contactname'),
|
161 |
+
'customerCountry' => $_helper->getConfigurationCustomerInfo('country'),
|
162 |
+
'customerEmail' => $_helper->getConfigurationCustomerInfo('email'),
|
163 |
+
'customerMobilePhone' => $customerMobilePhone,
|
164 |
+
'customerName' => $_helper->getConfigurationCustomerInfo('name'),
|
165 |
+
'customerName2' => $_helper->getConfigurationCustomerInfo('name2'),
|
166 |
+
'customerPhone' => $_helper->getConfigurationCustomerInfo('phone'),
|
167 |
+
'customerPreAlert' => '',
|
168 |
+
'customerZipCode' => $_helper->getConfigurationCustomerInfo('zipcode')
|
169 |
+
);
|
170 |
+
|
171 |
+
//recipient parameters
|
172 |
+
$recipient_address = $_shippingAddress->getStreet();
|
173 |
+
if (!isset($recipient_address[1])) {
|
174 |
+
$recipient_address[1] = '';
|
175 |
+
}
|
176 |
+
$customer_email = ($_shippingAddress->getEmail()) ? $_shippingAddress->getEmail() : ($_billingAddress->getEmail() ? $_billingAddress->getEmail() : $_order->getCustomerEmail());
|
177 |
+
$recipientMobilePhone = $this->checkMobileNumber($_shippingAddress->getTelephone());
|
178 |
+
$recipientName = $this->getFilledValue($_shippingAddress->getCompany()); //RelayPoint Name if chronorelais or Companyname if chronopost and
|
179 |
+
$recipientName2 = $this->getFilledValue($_shippingAddress->getFirstname() . ' ' . $_shippingAddress->getLastname());
|
180 |
+
//remove any alphabets in phone number
|
181 |
+
$recipientPhone = trim(ereg_replace("[^0-9.-]", " ", $_shippingAddress->getTelephone()));
|
182 |
+
|
183 |
+
$recipient = array(
|
184 |
+
'recipientAdress1' => substr($this->getFilledValue($recipient_address[0]), 0, 38),
|
185 |
+
'recipientAdress2' => substr($this->getFilledValue($recipient_address[1]), 0, 38),
|
186 |
+
'recipientCity' => $this->getFilledValue($_shippingAddress->getCity()),
|
187 |
+
'recipientContactName' => $recipientName2,
|
188 |
+
'recipientCountry' => $this->getFilledValue($_shippingAddress->getCountryId()),
|
189 |
+
'recipientEmail' => $customer_email,
|
190 |
+
'recipientMobilePhone' => $recipientMobilePhone,
|
191 |
+
'recipientName' => $recipientName,
|
192 |
+
'recipientName2' => $recipientName2,
|
193 |
+
'recipientPhone' => $recipientPhone,
|
194 |
+
'recipientPreAlert' => '',
|
195 |
+
'recipientZipCode' => $this->getFilledValue($_shippingAddress->getPostcode()),
|
196 |
+
);
|
197 |
+
|
198 |
+
//ref parameters
|
199 |
+
$recipientRef = $this->getFilledValue($_shippingAddress->getWRelayPointCode());
|
200 |
+
if (!$recipientRef) {
|
201 |
+
$recipientRef = $_order->getCustomerId();
|
202 |
+
}
|
203 |
+
$shipperRef = $_order->getRealOrderId();
|
204 |
+
|
205 |
+
$ref = array(
|
206 |
+
'recipientRef' => $recipientRef,
|
207 |
+
'shipperRef' => $shipperRef
|
208 |
+
);
|
209 |
+
|
210 |
+
//skybill parameters
|
211 |
+
/* Livraison Samedi (Delivery Saturday) field */
|
212 |
+
$SaturdayShipping = 0; //default value for the saturday shipping
|
213 |
+
$send_day = strtolower(date('l'));
|
214 |
+
if ($_shippingMethod[0] == "chronopost" || $_shippingMethod[0] == "chronorelais") {
|
215 |
+
if (!$_deliver_on_saturday = Mage::helper('chronorelais')->getLivraisonSamediStatus($_order->getEntityId())) {
|
216 |
+
$_deliver_on_saturday = Mage::helper('chronorelais')->getConfigData('carriers/' . $_shippingMethod[0] . '/deliver_on_saturday');
|
217 |
+
} else {
|
218 |
+
if ($_deliver_on_saturday == 'Yes') {
|
219 |
+
$_deliver_on_saturday = 1;
|
220 |
+
} else {
|
221 |
+
$_deliver_on_saturday = 0;
|
222 |
+
}
|
223 |
+
}
|
224 |
+
$is_sending_day = Mage::helper('chronorelais')->isSendingDay();
|
225 |
+
if ($_deliver_on_saturday && $is_sending_day) {
|
226 |
+
$SaturdayShipping = 6;
|
227 |
+
} elseif (!$_deliver_on_saturday && $is_sending_day) {
|
228 |
+
$SaturdayShipping = 1;
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
$weight = 0;
|
233 |
+
foreach ($shipment->getItemsCollection() as $item) {
|
234 |
+
$weight += $item->weight * $item->qty;
|
235 |
+
}
|
236 |
+
|
237 |
+
$skybill = array(
|
238 |
+
'codCurrency' => 'EUR',
|
239 |
+
'codValue' => '',
|
240 |
+
'content1' => '',
|
241 |
+
'content2' => '',
|
242 |
+
'content3' => '',
|
243 |
+
'content4' => '',
|
244 |
+
'content5' => '',
|
245 |
+
'customsCurrency' => 'EUR',
|
246 |
+
'customsValue' => '',
|
247 |
+
'evtCode' => 'DC',
|
248 |
+
'insuredCurrency' => 'EUR',
|
249 |
+
'insuredValue' => '',
|
250 |
+
'objectType' => 'MAR',
|
251 |
+
'productCode' => $_helper->getChronoProductCode($_shippingAddress->getCountryId(), $_shippingMethod[0]),
|
252 |
+
'service' => $SaturdayShipping,
|
253 |
+
'shipDate' => date('c'),
|
254 |
+
'shipHour' => date('H'),
|
255 |
+
'weight' => $weight,
|
256 |
+
'weightUnit' => 'KGM'
|
257 |
+
);
|
258 |
+
|
259 |
+
$skybillParams = array(
|
260 |
+
'mode' => $_helper->getConfigurationSkybillParam()
|
261 |
+
);
|
262 |
+
|
263 |
+
$expeditionArray = array(
|
264 |
+
'esdParams' => $esdParams,
|
265 |
+
'header' => $header,
|
266 |
+
'shipper' => $shipper,
|
267 |
+
'customer' => $customer,
|
268 |
+
'recipient' => $recipient,
|
269 |
+
'ref' => $ref,
|
270 |
+
'skybill' => $skybill,
|
271 |
+
'skybillParams' => $skybillParams,
|
272 |
+
'password' => $_helper->getConfigurationAccountPass(),
|
273 |
+
'option' => '0'
|
274 |
+
);
|
275 |
+
//printArray($expeditionArray); exit;
|
276 |
+
return $expeditionArray;
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
protected function getEtiquetteUrl($shipmentId) {
|
281 |
+
//On récupère les infos d'expédition
|
282 |
+
$reservationNumber = '';
|
283 |
+
$_helper = Mage::helper('chronorelais');
|
284 |
+
|
285 |
+
$shipment = Mage::getModel('sales/order_shipment')->load($shipmentId);
|
286 |
+
if ($_shipTracks = $shipment->getAllTracks()) {
|
287 |
+
foreach ($_shipTracks as $_shipTrack) {
|
288 |
+
if ($_shipTrack->getNumber() && $_shipTrack->getChronoReservationNumber()) {
|
289 |
+
$reservationNumber = $_shipTrack->getChronoReservationNumber();
|
290 |
+
break;
|
291 |
+
}
|
292 |
+
}
|
293 |
+
if ($reservationNumber) {
|
294 |
+
return $reservationNumber;
|
295 |
+
}
|
296 |
+
}
|
297 |
+
|
298 |
+
$_order = $shipment->getOrder();
|
299 |
+
$_shippingMethod = explode("_", $_order->getShippingMethod());
|
300 |
+
|
301 |
+
$expeditionArray = $this->getExpeditionParams($shipment, $_shippingMethod);
|
302 |
+
$tracking_number = '';
|
303 |
+
if ($expeditionArray) {
|
304 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/shipping/services/services/ServiceEProcurement?wsdl", array('trace' => true));
|
305 |
+
try {
|
306 |
+
$webservbt = $client->__call("reservationExpeditionV2", $expeditionArray);
|
307 |
+
if (!$webservbt->errorCode && $webservbt->reservationNumber) {
|
308 |
+
$tracking_number = $webservbt->skybillNumber;
|
309 |
+
// Add tracking number for the shipment if not already exists.
|
310 |
+
if (!$this->_trackingNumbers && $webservbt->skybillNumber) {
|
311 |
+
$track = Mage::getModel('sales/order_shipment_track')
|
312 |
+
->setNumber($webservbt->skybillNumber)
|
313 |
+
->setCarrier(ucwords($_shippingMethod[0]))
|
314 |
+
->setCarrierCode($_shippingMethod[0])
|
315 |
+
->setTitle(ucwords($_shippingMethod[0]))
|
316 |
+
->setChronoReservationNumber($webservbt->reservationNumber)
|
317 |
+
->setPopup(1);
|
318 |
+
$shipment->addTrack($track);
|
319 |
+
|
320 |
+
$tracking_url = str_replace('{tracking_number}', $tracking_number, Mage::helper('chronorelais')->getConfigurationTrackingViewUrl());
|
321 |
+
$tracking_title = $this->__('Track Your Order');
|
322 |
+
$tracking_order = '<p><a title="' . $tracking_title . '" href="' . $tracking_url . '"><b>' . $tracking_title . '</b></a></p>';
|
323 |
+
|
324 |
+
//$shipment->register();
|
325 |
+
$comment = '';
|
326 |
+
$shipment->setEmailSent(true);
|
327 |
+
$this->_saveShipment($shipment);
|
328 |
+
$shipment->sendEmail(1, $tracking_order . $comment);
|
329 |
+
}
|
330 |
+
return $webservbt->reservationNumber;
|
331 |
+
} else {
|
332 |
+
$this->_getSession()->addError($_helper->__($webservbt->errorMessage));
|
333 |
+
}
|
334 |
+
} catch (SoapFault $fault) {
|
335 |
+
$this->_getSession()->addError($_helper->__($fault->faultstring));
|
336 |
+
}
|
337 |
+
}
|
338 |
+
}
|
339 |
+
|
340 |
+
public function getShipmentByOrderId($orderId) {
|
341 |
+
$_shipment = Mage::getResourceModel('sales/order_shipment_grid_collection')
|
342 |
+
->addAttributeToFilter('order_id', $orderId)
|
343 |
+
->getAllIds();
|
344 |
+
return $_shipment;
|
345 |
+
}
|
346 |
+
|
347 |
+
public function getShipmentByIncrementId($incrementId) {
|
348 |
+
$_shipment = Mage::getResourceModel('sales/order_shipment_grid_collection')
|
349 |
+
->addAttributeToFilter('increment_id', $incrementId)
|
350 |
+
->getAllIds();
|
351 |
+
return $_shipment;
|
352 |
+
}
|
353 |
+
|
354 |
+
public function initShipment($orderId) {
|
355 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
356 |
+
|
357 |
+
/**
|
358 |
+
* Check order existing
|
359 |
+
*/
|
360 |
+
if (!$order->getId()) {
|
361 |
+
$this->_getSession()->addError($this->__('The order no longer exists.'));
|
362 |
+
return false;
|
363 |
+
}
|
364 |
+
/**
|
365 |
+
* Check shipment is available to create separate from invoice
|
366 |
+
*/
|
367 |
+
if ($order->getForcedDoShipmentWithInvoice()) {
|
368 |
+
$this->_getSession()->addError($this->__('Cannot do shipment for the order separately from invoice.'));
|
369 |
+
return false;
|
370 |
+
}
|
371 |
+
/**
|
372 |
+
* Check shipment create availability
|
373 |
+
*/
|
374 |
+
/* if (!$order->canShip()) {
|
375 |
+
$this->_getSession()->addError($this->__('Cannot do shipment for the order.'));
|
376 |
+
return false;
|
377 |
+
} */
|
378 |
+
$savedQtys = $this->_getItemQtys();
|
379 |
+
$shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($savedQtys);
|
380 |
+
|
381 |
+
Mage::register('current_shipment', $shipment);
|
382 |
+
return $shipment;
|
383 |
+
}
|
384 |
+
|
385 |
+
public function createNewShipment($orderId) {
|
386 |
+
$_helper = Mage::helper('chronorelais');
|
387 |
+
$reservationNumber = '';
|
388 |
+
try {
|
389 |
+
if ($shipment = $this->initShipment($orderId)) {
|
390 |
+
$shipment->register();
|
391 |
+
|
392 |
+
$_order = $shipment->getOrder();
|
393 |
+
$_shippingMethod = explode("_", $_order->getShippingMethod());
|
394 |
+
|
395 |
+
$expeditionArray = $this->getExpeditionParams($shipment, $_shippingMethod);
|
396 |
+
$tracking_number = '';
|
397 |
+
if ($expeditionArray) {
|
398 |
+
|
399 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/shipping/services/services/ServiceEProcurement?wsdl", array('trace' => true));
|
400 |
+
try {
|
401 |
+
$expedition = $client->__call("reservationExpeditionV2", $expeditionArray);
|
402 |
+
if (!$expedition->errorCode && $expedition->skybillNumber) {
|
403 |
+
$tracking_number = $expedition->skybillNumber;
|
404 |
+
$track = Mage::getModel('sales/order_shipment_track')
|
405 |
+
->setNumber($expedition->skybillNumber)
|
406 |
+
->setCarrier(ucwords($_shippingMethod[0]))
|
407 |
+
->setCarrierCode($_shippingMethod[0])
|
408 |
+
->setTitle(ucwords($_shippingMethod[0]))
|
409 |
+
->setChronoReservationNumber($expedition->reservationNumber)
|
410 |
+
->setPopup(1);
|
411 |
+
$shipment->addTrack($track);
|
412 |
+
$reservationNumber = $expedition->reservationNumber;
|
413 |
+
} else {
|
414 |
+
$this->_getSession()->addError($_helper->__($expedition->errorMessage));
|
415 |
+
return;
|
416 |
+
}
|
417 |
+
} catch (SoapFault $fault) {
|
418 |
+
$this->_getSession()->addError($_helper->__($fault->faultstring));
|
419 |
+
return;
|
420 |
+
}
|
421 |
+
}
|
422 |
+
|
423 |
+
$tracking_url = str_replace('{tracking_number}', $tracking_number, Mage::helper('chronorelais')->getConfigurationTrackingViewUrl());
|
424 |
+
$tracking_title = $this->__('Track Your Order');
|
425 |
+
$tracking_order = '<p><a title="' . $tracking_title . '" href="' . $tracking_url . '"><b>' . $tracking_title . '</b></a></p>';
|
426 |
+
|
427 |
+
$comment = '';
|
428 |
+
$shipment->setEmailSent(true);
|
429 |
+
$this->_saveShipment($shipment);
|
430 |
+
$shipment->sendEmail(1, $tracking_order . $comment);
|
431 |
+
$this->_getSession()->addSuccess($this->__('Shipment was successfully created.'));
|
432 |
+
return $reservationNumber;
|
433 |
+
} else {
|
434 |
+
$this->_forward('noRoute');
|
435 |
+
return;
|
436 |
+
}
|
437 |
+
} catch (Mage_Core_Exception $e) {
|
438 |
+
$this->_getSession()->addError($e->getMessage());
|
439 |
+
return;
|
440 |
+
} catch (Exception $e) {
|
441 |
+
$this->_getSession()->addError($this->__('Can not save shipment: ' . $e->getMessage()));
|
442 |
+
return;
|
443 |
+
}
|
444 |
+
}
|
445 |
+
|
446 |
+
public function printMassAction() {
|
447 |
+
$shipmentsIds = $this->getRequest()->getPost('shipment_ids');
|
448 |
+
try {
|
449 |
+
$trackingNumber = $this->getEtiquetteUrl($shipmentsIds);
|
450 |
+
if ($trackingNumber) {
|
451 |
+
$tracking_url = str_replace('{trackingNumber}', $trackingNumber, Mage::helper('chronorelais')->getConfigurationTrackingUrl());
|
452 |
+
$this->_processDownload($tracking_url, 'url');
|
453 |
+
exit(0);
|
454 |
+
}
|
455 |
+
} catch (Mage_Core_Exception $e) {
|
456 |
+
$this->_getSession()->addError(Mage::helper('chronorelais')->__('Désolé, une erreure est survenu lors de la récupération de l\'étiquetes. Merci de contacter Chronopost ou de réessayer plus tard'));
|
457 |
+
}
|
458 |
+
return $this->_redirectReferer();
|
459 |
+
}
|
460 |
+
|
461 |
+
public function printAction() {
|
462 |
+
// Appel via order_id
|
463 |
+
$orderId = $this->getRequest()->getParam('order_id');
|
464 |
+
if ($orderId) {
|
465 |
+
if ($_shipments = $this->getShipmentByOrderId($orderId)) {
|
466 |
+
if (count($_shipments) == 1) {
|
467 |
+
$shipmentId = $_shipments[0];
|
468 |
+
$trackingNumber = $this->getEtiquetteUrl($shipmentId);
|
469 |
+
} else {
|
470 |
+
$track = "Cette commande contient plusieurs expéditions, cliquez sur chaque lien pour obtenir les étiquettes :<br>";
|
471 |
+
foreach ($_shipments as $_shipment) {
|
472 |
+
$url = str_replace('{trackingNumber}', $this->getEtiquetteUrl($_shipment), Mage::helper('chronorelais')->getConfigurationTrackingUrl());
|
473 |
+
$track .= '<a target="_blank" href="'.$url.'">'.$url.'</a><br />';
|
474 |
+
}
|
475 |
+
echo $track;
|
476 |
+
return;
|
477 |
+
}
|
478 |
+
} else {
|
479 |
+
$trackingNumber = $this->createNewShipment($orderId);
|
480 |
+
}
|
481 |
+
} else {
|
482 |
+
$shipmentId = $this->getRequest()->getParam('shipment_id');
|
483 |
+
if ($shipmentId) {
|
484 |
+
$trackingNumber = $this->getEtiquetteUrl($shipmentId);
|
485 |
+
} else {
|
486 |
+
$shipmentIncrementId = $this->getRequest()->getParam('shipment_increment_id');
|
487 |
+
$shipmentId = $this->getShipmentByIncrementId($shipmentIncrementId);
|
488 |
+
$trackingNumber = $this->getEtiquetteUrl($shipmentId[0]);
|
489 |
+
}
|
490 |
+
}
|
491 |
+
|
492 |
+
|
493 |
+
if ($trackingNumber) {
|
494 |
+
try {
|
495 |
+
$tracking_url = str_replace('{trackingNumber}', $trackingNumber, Mage::helper('chronorelais')->getConfigurationTrackingUrl());
|
496 |
+
$this->_processDownload($tracking_url, 'url');
|
497 |
+
exit(0);
|
498 |
+
} catch (Mage_Core_Exception $e) {
|
499 |
+
$this->_getSession()->addError(Mage::helper('chronorelais')->__('Désolé, une erreure est survenu lors de la récupération de l\'étiquetes. Merci de contacter Chronopost ou de réessayer plus tard'));
|
500 |
+
}
|
501 |
+
}
|
502 |
+
return $this->_redirectReferer();
|
503 |
+
}
|
504 |
+
|
505 |
+
public function massLivraisonSamediStatusAction() {
|
506 |
+
if ($this->getRequest()->getPost('status')) {
|
507 |
+
$this->saveLivraisonSamediStatusAction();
|
508 |
+
}
|
509 |
+
}
|
510 |
+
|
511 |
+
/* Save the Livraison le Samedi status to orders */
|
512 |
+
|
513 |
+
public function saveLivraisonSamediStatusAction() {
|
514 |
+
/* get the orders */
|
515 |
+
$orderIds = $this->getRequest()->getPost('order_ids');
|
516 |
+
$status = $this->getRequest()->getPost('status');
|
517 |
+
$_connection = Mage::getSingleton('core/resource')->getConnection('core_write');
|
518 |
+
$_table = Mage::getSingleton('core/resource')->getTableName('sales_chronopost_order_export_status');
|
519 |
+
$exceptions = array();
|
520 |
+
|
521 |
+
foreach ($orderIds as $orderId) {
|
522 |
+
$order_details = Mage::getModel('sales/order')->load($orderId);
|
523 |
+
$shipping_method = '';
|
524 |
+
$livraison_le_samedi = $status;
|
525 |
+
if ($shipping_method = $order_details->getShippingMethod()) {
|
526 |
+
$shipping_method = explode('_', $shipping_method);
|
527 |
+
if ($shipping_method[0] == 'chronoexpress') {
|
528 |
+
$livraison_le_samedi = '--';
|
529 |
+
}
|
530 |
+
}
|
531 |
+
$condition = array(
|
532 |
+
$_connection->quoteInto('order_id = ?', $orderId),
|
533 |
+
);
|
534 |
+
$_connection->delete($_table, $condition);
|
535 |
+
|
536 |
+
$dataLine = array(
|
537 |
+
'order_id' => $orderId,
|
538 |
+
'livraison_le_samedi' => $livraison_le_samedi
|
539 |
+
);
|
540 |
+
try {
|
541 |
+
$_connection->insert($_table, $dataLine);
|
542 |
+
} catch (Exception $e) {
|
543 |
+
$exceptions[] = Mage::helper('chronorelais')->__('Order assigning error: ' . $e->getMessage());
|
544 |
+
}
|
545 |
+
}
|
546 |
+
if ($exceptions) {
|
547 |
+
$this->_getSession()->addError($exceptions);
|
548 |
+
} else {
|
549 |
+
$this->_getSession()->addSuccess($this->__('Livraison le Samedi statut a été ajouté'));
|
550 |
+
}
|
551 |
+
$this->_redirect('*/*/index');
|
552 |
+
}
|
553 |
+
|
554 |
+
/* Remove accents characters */
|
555 |
+
|
556 |
+
public function removeaccents($string) {
|
557 |
+
$stringToReturn = str_replace(
|
558 |
+
array('à', 'á', 'â', 'ã', 'ä', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ù', 'ú', 'û', 'ü', 'ý', 'ÿ', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', '/', '\xa8'), array('a', 'a', 'a', 'a', 'a', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 'y', 'A', 'A', 'A', 'A', 'A', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'N', 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'Y', ' ', 'e'), $string);
|
559 |
+
// Remove all remaining other unknown characters
|
560 |
+
$stringToReturn = preg_replace('/[^a-zA-Z0-9\-]/', ' ', $stringToReturn);
|
561 |
+
$stringToReturn = preg_replace('/^[\-]+/', '', $stringToReturn);
|
562 |
+
$stringToReturn = preg_replace('/[\-]+$/', '', $stringToReturn);
|
563 |
+
$stringToReturn = preg_replace('/[\-]{2,}/', ' ', $stringToReturn);
|
564 |
+
return $stringToReturn;
|
565 |
+
}
|
566 |
+
|
567 |
}
|
app/code/community/Chronopost/Chronorelais/controllers/Sales/Order/ShipmentController.php
CHANGED
@@ -1,268 +1,274 @@
|
|
1 |
-
<?php
|
2 |
-
require_once 'Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php';
|
3 |
-
class Chronopost_Chronorelais_Sales_Order_ShipmentController extends Mage_Adminhtml_Sales_Order_ShipmentController
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Save shipment
|
8 |
-
* We can save only new shipment. Existing shipments are not editable
|
9 |
-
*/
|
10 |
-
|
11 |
-
public function getFilledValue($value)
|
12 |
-
{
|
13 |
-
if($value) {
|
14 |
-
return $this->removeaccents(trim($value));
|
15 |
-
} else {
|
16 |
-
return '';
|
17 |
-
}
|
18 |
-
}
|
19 |
-
|
20 |
-
public function checkMobileNumber($value)
|
21 |
-
{
|
22 |
-
if($reqvalue = trim($value)) {
|
23 |
-
$_number = substr($reqvalue, 0, 2);
|
24 |
-
$fixed_array = array('01','02','03','04','05','06','06');
|
25 |
-
if(in_array($_number, $fixed_array)) {
|
26 |
-
return $reqvalue;
|
27 |
-
} else {
|
28 |
-
return '';
|
29 |
-
}
|
30 |
-
}
|
31 |
-
}
|
32 |
-
|
33 |
-
public function saveAction()
|
34 |
-
{
|
35 |
-
$data = $this->getRequest()->getPost('shipment');
|
36 |
-
|
37 |
-
try {
|
38 |
-
if ($shipment = $this->_initShipment()) {
|
39 |
-
$shipment->register();
|
40 |
-
|
41 |
-
//Si l'expedition est réalisé par Mondial Relay, on créé le tracking automatiquement.
|
42 |
-
|
43 |
-
$_order = $shipment->getOrder();
|
44 |
-
$_shippingMethod = explode("_",$_order->getShippingMethod());
|
45 |
-
|
46 |
-
$_shippingAddress = $
|
47 |
-
$_billingAddress = $
|
48 |
-
$_helper = Mage::helper('chronorelais');
|
49 |
-
|
50 |
-
if ($_shippingMethod[0] == 'chronorelais' || $_shippingMethod[0] == 'chronopost' || $_shippingMethod[0] == 'chronoexpress') {
|
51 |
-
|
52 |
-
$esdParams = $header = $shipper = $customer = $recipient = $ref = $skybill = $skybillParams = $password = array();
|
53 |
-
|
54 |
-
//esdParams parameters
|
55 |
-
$esdParams = array(
|
56 |
-
'height' => '',
|
57 |
-
'width' => '',
|
58 |
-
'length' => ''
|
59 |
-
);
|
60 |
-
|
61 |
-
//header parameters
|
62 |
-
$header = array(
|
63 |
-
'idEmit' => 'CHRFR',
|
64 |
-
'accountNumber' => $_helper->getConfigurationAccountNumber(),
|
65 |
-
'subAccount' => $_helper->getConfigurationSubAccountNumber()
|
66 |
-
);
|
67 |
-
|
68 |
-
//shipper parameters
|
69 |
-
$shipperMobilePhone = $this->checkMobileNumber($_helper->getConfigurationShipperInfo('mobilephone'));
|
70 |
-
$shipper = array(
|
71 |
-
'shipperAdress1' => $_helper->getConfigurationShipperInfo('address1'),
|
72 |
-
'shipperAdress2' => $_helper->getConfigurationShipperInfo('address2'),
|
73 |
-
'shipperCity' => $_helper->getConfigurationShipperInfo('city'),
|
74 |
-
'shipperCivility' => $_helper->getConfigurationShipperInfo('civility'),
|
75 |
-
'shipperContactName'=> $_helper->getConfigurationShipperInfo('contactname'),
|
76 |
-
'shipperCountry' => $_helper->getConfigurationShipperInfo('country'),
|
77 |
-
'shipperEmail' => $_helper->getConfigurationShipperInfo('email'),
|
78 |
-
'shipperMobilePhone'=> $shipperMobilePhone,
|
79 |
-
'shipperName' => $_helper->getConfigurationShipperInfo('name'),
|
80 |
-
'shipperName2' => $_helper->getConfigurationShipperInfo('name2'),
|
81 |
-
'shipperPhone' => $_helper->getConfigurationShipperInfo('phone'),
|
82 |
-
'shipperPreAlert' => '',
|
83 |
-
'shipperZipCode' => $_helper->getConfigurationShipperInfo('zipcode')
|
84 |
-
);
|
85 |
-
|
86 |
-
//customer parameters
|
87 |
-
$customerMobilePhone = $this->checkMobileNumber($_helper->getConfigurationCustomerInfo('mobilephone'));
|
88 |
-
$customer = array(
|
89 |
-
'customerAdress1' => $_helper->getConfigurationCustomerInfo('address1'),
|
90 |
-
'customerAdress2' => $_helper->getConfigurationCustomerInfo('address2'),
|
91 |
-
'customerCity' => $_helper->getConfigurationCustomerInfo('city'),
|
92 |
-
'customerCivility' => $_helper->getConfigurationCustomerInfo('civility'),
|
93 |
-
'customerContactName'=> $_helper->getConfigurationCustomerInfo('contactname'),
|
94 |
-
'customerCountry' => $_helper->getConfigurationCustomerInfo('country'),
|
95 |
-
'customerEmail' => $_helper->getConfigurationCustomerInfo('email'),
|
96 |
-
'customerMobilePhone'=> $customerMobilePhone,
|
97 |
-
'customerName' => $_helper->getConfigurationCustomerInfo('name'),
|
98 |
-
'customerName2' => $_helper->getConfigurationCustomerInfo('name2'),
|
99 |
-
'customerPhone' => $_helper->getConfigurationCustomerInfo('phone'),
|
100 |
-
'customerPreAlert' => '',
|
101 |
-
'customerZipCode' => $_helper->getConfigurationCustomerInfo('zipcode')
|
102 |
-
);
|
103 |
-
|
104 |
-
//recipient parameters
|
105 |
-
$recipient_address = $_shippingAddress->getStreet();
|
106 |
-
if (!isset($recipient_address[1])) {
|
107 |
-
$recipient_address[1] = '';
|
108 |
-
}
|
109 |
-
$customer_email = ($_shippingAddress->getEmail()) ? $_shippingAddress->getEmail() : ($_billingAddress->getEmail() ? $_billingAddress->getEmail() : $_order->getCustomerEmail());
|
110 |
-
$recipientMobilePhone = $this->checkMobileNumber($_shippingAddress->getTelephone());
|
111 |
-
$recipientName = $this->getFilledValue($_shippingAddress->getCompany()); //RelayPoint Name if chronorelais or Companyname if chronopost and
|
112 |
-
$recipientName2 = $this->getFilledValue($_shippingAddress->getFirstname() . ' ' . $_shippingAddress->getLastname());
|
113 |
-
//remove any alphabets in phone number
|
114 |
-
$recipientPhone = trim(ereg_replace("[^0-9.-]", " ", $_shippingAddress->getTelephone()));
|
115 |
-
|
116 |
-
$recipient = array(
|
117 |
-
'recipientAdress1' => $this->getFilledValue($recipient_address[0]),
|
118 |
-
'recipientAdress2' => $this->getFilledValue($recipient_address[1]),
|
119 |
-
'recipientCity' => $this->getFilledValue($_shippingAddress->getCity()),
|
120 |
-
'recipientContactName' => $recipientName2,
|
121 |
-
'recipientCountry' => $this->getFilledValue($_shippingAddress->getCountryId()),
|
122 |
-
'recipientEmail' => $customer_email,
|
123 |
-
'recipientMobilePhone' => $recipientMobilePhone,
|
124 |
-
'recipientName' => $recipientName,
|
125 |
-
'recipientName2' => $recipientName2,
|
126 |
-
'recipientPhone' => $recipientPhone,
|
127 |
-
'recipientPreAlert' => '',
|
128 |
-
'recipientZipCode' => $this->getFilledValue($_shippingAddress->getPostcode()),
|
129 |
-
);
|
130 |
-
|
131 |
-
//ref parameters
|
132 |
-
$recipientRef = $this->getFilledValue($_shippingAddress->getWRelayPointCode());
|
133 |
-
if(!$recipientRef) {
|
134 |
-
$recipientRef = $_order->getCustomerId();
|
135 |
-
}
|
136 |
-
$shipperRef = $_order->getRealOrderId();
|
137 |
-
|
138 |
-
$ref = array(
|
139 |
-
'recipientRef' => $recipientRef,
|
140 |
-
'shipperRef' => $shipperRef
|
141 |
-
);
|
142 |
-
|
143 |
-
//skybill parameters
|
144 |
-
/* Livraison Samedi (Delivery Saturday) field*/
|
145 |
-
$SaturdayShipping = 0; //default value for the saturday shipping
|
146 |
-
$send_day = strtolower(date('l'));
|
147 |
-
if($_shippingMethod[0] == "chronopost" || $_shippingMethod[0] == "chronorelais") {
|
148 |
-
if(!$_deliver_on_saturday = Mage::helper('chronorelais')->getLivraisonSamediStatus($_order->getEntityId())) {
|
149 |
-
$_deliver_on_saturday = Mage::helper('chronorelais')->getConfigData('carriers/'.$_shippingMethod[0].'/deliver_on_saturday');
|
150 |
-
} else {
|
151 |
-
if($_deliver_on_saturday=='Yes') {
|
152 |
-
$_deliver_on_saturday = 1;
|
153 |
-
} else {
|
154 |
-
$_deliver_on_saturday = 0;
|
155 |
-
}
|
156 |
-
}
|
157 |
-
$is_sending_day = Mage::helper('chronorelais')->isSendingDay();
|
158 |
-
if($_deliver_on_saturday && $is_sending_day) {
|
159 |
-
$SaturdayShipping = 1;
|
160 |
-
} elseif(!$_deliver_on_saturday && $is_sending_day) {
|
161 |
-
$SaturdayShipping = 6;
|
162 |
-
}
|
163 |
-
}
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
'
|
172 |
-
'
|
173 |
-
'
|
174 |
-
'
|
175 |
-
'
|
176 |
-
'
|
177 |
-
'
|
178 |
-
'
|
179 |
-
'
|
180 |
-
'
|
181 |
-
'
|
182 |
-
'
|
183 |
-
'
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
'
|
194 |
-
'
|
195 |
-
'
|
196 |
-
'
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
}
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
$
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
}
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once 'Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php';
|
3 |
+
class Chronopost_Chronorelais_Sales_Order_ShipmentController extends Mage_Adminhtml_Sales_Order_ShipmentController
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Save shipment
|
8 |
+
* We can save only new shipment. Existing shipments are not editable
|
9 |
+
*/
|
10 |
+
|
11 |
+
public function getFilledValue($value)
|
12 |
+
{
|
13 |
+
if($value) {
|
14 |
+
return $this->removeaccents(trim($value));
|
15 |
+
} else {
|
16 |
+
return '';
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
public function checkMobileNumber($value)
|
21 |
+
{
|
22 |
+
if($reqvalue = trim($value)) {
|
23 |
+
$_number = substr($reqvalue, 0, 2);
|
24 |
+
$fixed_array = array('01','02','03','04','05','06','06');
|
25 |
+
if(in_array($_number, $fixed_array)) {
|
26 |
+
return $reqvalue;
|
27 |
+
} else {
|
28 |
+
return '';
|
29 |
+
}
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
public function saveAction()
|
34 |
+
{
|
35 |
+
$data = $this->getRequest()->getPost('shipment');
|
36 |
+
|
37 |
+
try {
|
38 |
+
if ($shipment = $this->_initShipment()) {
|
39 |
+
$shipment->register();
|
40 |
+
|
41 |
+
//Si l'expedition est réalisé par Mondial Relay, on créé le tracking automatiquement.
|
42 |
+
|
43 |
+
$_order = $shipment->getOrder();
|
44 |
+
$_shippingMethod = explode("_",$_order->getShippingMethod());
|
45 |
+
|
46 |
+
$_shippingAddress = $shipment->getShippingAddress();
|
47 |
+
$_billingAddress = $shipment->getBillingAddress();
|
48 |
+
$_helper = Mage::helper('chronorelais');
|
49 |
+
|
50 |
+
if ($_shippingMethod[0] == 'chronorelais' || $_shippingMethod[0] == 'chronopost' || $_shippingMethod[0] == 'chronoexpress') {
|
51 |
+
|
52 |
+
$esdParams = $header = $shipper = $customer = $recipient = $ref = $skybill = $skybillParams = $password = array();
|
53 |
+
|
54 |
+
//esdParams parameters
|
55 |
+
$esdParams = array(
|
56 |
+
'height' => '',
|
57 |
+
'width' => '',
|
58 |
+
'length' => ''
|
59 |
+
);
|
60 |
+
|
61 |
+
//header parameters
|
62 |
+
$header = array(
|
63 |
+
'idEmit' => 'CHRFR',
|
64 |
+
'accountNumber' => $_helper->getConfigurationAccountNumber(),
|
65 |
+
'subAccount' => $_helper->getConfigurationSubAccountNumber()
|
66 |
+
);
|
67 |
+
|
68 |
+
//shipper parameters
|
69 |
+
$shipperMobilePhone = $this->checkMobileNumber($_helper->getConfigurationShipperInfo('mobilephone'));
|
70 |
+
$shipper = array(
|
71 |
+
'shipperAdress1' => $_helper->getConfigurationShipperInfo('address1'),
|
72 |
+
'shipperAdress2' => $_helper->getConfigurationShipperInfo('address2'),
|
73 |
+
'shipperCity' => $_helper->getConfigurationShipperInfo('city'),
|
74 |
+
'shipperCivility' => $_helper->getConfigurationShipperInfo('civility'),
|
75 |
+
'shipperContactName'=> $_helper->getConfigurationShipperInfo('contactname'),
|
76 |
+
'shipperCountry' => $_helper->getConfigurationShipperInfo('country'),
|
77 |
+
'shipperEmail' => $_helper->getConfigurationShipperInfo('email'),
|
78 |
+
'shipperMobilePhone'=> $shipperMobilePhone,
|
79 |
+
'shipperName' => $_helper->getConfigurationShipperInfo('name'),
|
80 |
+
'shipperName2' => $_helper->getConfigurationShipperInfo('name2'),
|
81 |
+
'shipperPhone' => $_helper->getConfigurationShipperInfo('phone'),
|
82 |
+
'shipperPreAlert' => '',
|
83 |
+
'shipperZipCode' => $_helper->getConfigurationShipperInfo('zipcode')
|
84 |
+
);
|
85 |
+
|
86 |
+
//customer parameters
|
87 |
+
$customerMobilePhone = $this->checkMobileNumber($_helper->getConfigurationCustomerInfo('mobilephone'));
|
88 |
+
$customer = array(
|
89 |
+
'customerAdress1' => $_helper->getConfigurationCustomerInfo('address1'),
|
90 |
+
'customerAdress2' => $_helper->getConfigurationCustomerInfo('address2'),
|
91 |
+
'customerCity' => $_helper->getConfigurationCustomerInfo('city'),
|
92 |
+
'customerCivility' => $_helper->getConfigurationCustomerInfo('civility'),
|
93 |
+
'customerContactName'=> $_helper->getConfigurationCustomerInfo('contactname'),
|
94 |
+
'customerCountry' => $_helper->getConfigurationCustomerInfo('country'),
|
95 |
+
'customerEmail' => $_helper->getConfigurationCustomerInfo('email'),
|
96 |
+
'customerMobilePhone'=> $customerMobilePhone,
|
97 |
+
'customerName' => $_helper->getConfigurationCustomerInfo('name'),
|
98 |
+
'customerName2' => $_helper->getConfigurationCustomerInfo('name2'),
|
99 |
+
'customerPhone' => $_helper->getConfigurationCustomerInfo('phone'),
|
100 |
+
'customerPreAlert' => '',
|
101 |
+
'customerZipCode' => $_helper->getConfigurationCustomerInfo('zipcode')
|
102 |
+
);
|
103 |
+
|
104 |
+
//recipient parameters
|
105 |
+
$recipient_address = $_shippingAddress->getStreet();
|
106 |
+
if (!isset($recipient_address[1])) {
|
107 |
+
$recipient_address[1] = '';
|
108 |
+
}
|
109 |
+
$customer_email = ($_shippingAddress->getEmail()) ? $_shippingAddress->getEmail() : ($_billingAddress->getEmail() ? $_billingAddress->getEmail() : $_order->getCustomerEmail());
|
110 |
+
$recipientMobilePhone = $this->checkMobileNumber($_shippingAddress->getTelephone());
|
111 |
+
$recipientName = $this->getFilledValue($_shippingAddress->getCompany()); //RelayPoint Name if chronorelais or Companyname if chronopost and
|
112 |
+
$recipientName2 = $this->getFilledValue($_shippingAddress->getFirstname() . ' ' . $_shippingAddress->getLastname());
|
113 |
+
//remove any alphabets in phone number
|
114 |
+
$recipientPhone = trim(ereg_replace("[^0-9.-]", " ", $_shippingAddress->getTelephone()));
|
115 |
+
|
116 |
+
$recipient = array(
|
117 |
+
'recipientAdress1' => $this->getFilledValue($recipient_address[0]),
|
118 |
+
'recipientAdress2' => $this->getFilledValue($recipient_address[1]),
|
119 |
+
'recipientCity' => $this->getFilledValue($_shippingAddress->getCity()),
|
120 |
+
'recipientContactName' => $recipientName2,
|
121 |
+
'recipientCountry' => $this->getFilledValue($_shippingAddress->getCountryId()),
|
122 |
+
'recipientEmail' => $customer_email,
|
123 |
+
'recipientMobilePhone' => $recipientMobilePhone,
|
124 |
+
'recipientName' => $recipientName,
|
125 |
+
'recipientName2' => $recipientName2,
|
126 |
+
'recipientPhone' => $recipientPhone,
|
127 |
+
'recipientPreAlert' => '',
|
128 |
+
'recipientZipCode' => $this->getFilledValue($_shippingAddress->getPostcode()),
|
129 |
+
);
|
130 |
+
|
131 |
+
//ref parameters
|
132 |
+
$recipientRef = $this->getFilledValue($_shippingAddress->getWRelayPointCode());
|
133 |
+
if(!$recipientRef) {
|
134 |
+
$recipientRef = $_order->getCustomerId();
|
135 |
+
}
|
136 |
+
$shipperRef = $_order->getRealOrderId();
|
137 |
+
|
138 |
+
$ref = array(
|
139 |
+
'recipientRef' => $recipientRef,
|
140 |
+
'shipperRef' => $shipperRef
|
141 |
+
);
|
142 |
+
|
143 |
+
//skybill parameters
|
144 |
+
/* Livraison Samedi (Delivery Saturday) field*/
|
145 |
+
$SaturdayShipping = 0; //default value for the saturday shipping
|
146 |
+
$send_day = strtolower(date('l'));
|
147 |
+
if($_shippingMethod[0] == "chronopost" || $_shippingMethod[0] == "chronorelais") {
|
148 |
+
if(!$_deliver_on_saturday = Mage::helper('chronorelais')->getLivraisonSamediStatus($_order->getEntityId())) {
|
149 |
+
$_deliver_on_saturday = Mage::helper('chronorelais')->getConfigData('carriers/'.$_shippingMethod[0].'/deliver_on_saturday');
|
150 |
+
} else {
|
151 |
+
if($_deliver_on_saturday=='Yes') {
|
152 |
+
$_deliver_on_saturday = 1;
|
153 |
+
} else {
|
154 |
+
$_deliver_on_saturday = 0;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
$is_sending_day = Mage::helper('chronorelais')->isSendingDay();
|
158 |
+
if($_deliver_on_saturday && $is_sending_day) {
|
159 |
+
$SaturdayShipping = 1;
|
160 |
+
} elseif(!$_deliver_on_saturday && $is_sending_day) {
|
161 |
+
$SaturdayShipping = 6;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
$weight = 0;
|
166 |
+
foreach ($shipment->getItemsCollection() as $item) {
|
167 |
+
$weight += $item->weight * $item->qty;
|
168 |
+
}
|
169 |
+
|
170 |
+
$skybill = array(
|
171 |
+
'codCurrency' => 'EUR',
|
172 |
+
'codValue' => '',
|
173 |
+
'content1' => '',
|
174 |
+
'content2' => '',
|
175 |
+
'content3' => '',
|
176 |
+
'content4' => '',
|
177 |
+
'content5' => '',
|
178 |
+
'customsCurrency' => 'EUR',
|
179 |
+
'customsValue' => '',
|
180 |
+
'evtCode' => 'DC',
|
181 |
+
'insuredCurrency' => 'EUR',
|
182 |
+
'insuredValue' => '',
|
183 |
+
'objectType' => 'MAR',
|
184 |
+
'productCode' => $_helper->getChronoProductCode($_shippingAddress->getCountryId(),$_shippingMethod[0]),
|
185 |
+
'service' => $SaturdayShipping,
|
186 |
+
'shipDate' => date('c'),
|
187 |
+
'shipHour' => date('H'),
|
188 |
+
'weight' => $weight,
|
189 |
+
'weightUnit' => 'KGM'
|
190 |
+
);
|
191 |
+
|
192 |
+
$expeditionArray = array(
|
193 |
+
'esdParams' => $esdParams,
|
194 |
+
'header' => $header,
|
195 |
+
'shipper' => $shipper,
|
196 |
+
'customer' => $customer,
|
197 |
+
'recipient' => $recipient,
|
198 |
+
'ref' => $ref,
|
199 |
+
'skybill' => $skybill,
|
200 |
+
'skybillParams' => $_helper->getConfigurationSkybillParam(),
|
201 |
+
'password' => $_helper->getConfigurationAccountPass(),
|
202 |
+
'option' => '0'
|
203 |
+
);
|
204 |
+
|
205 |
+
$client = new SoapClient("http://wsshipping.chronopost.fr/shipping/services/services/ServiceEProcurement?wsdl", array('trace' => true));
|
206 |
+
try
|
207 |
+
{
|
208 |
+
$expedition = $client->__call("reservationExpeditionV2",$expeditionArray);
|
209 |
+
if(!$expedition->errorCode && $expedition->skybillNumber) {
|
210 |
+
$track = Mage::getModel('sales/order_shipment_track')
|
211 |
+
->setNumber($expedition->skybillNumber)
|
212 |
+
->setCarrier(ucwords($_shippingMethod[0]))
|
213 |
+
->setCarrierCode($_shippingMethod[0])
|
214 |
+
->setTitle(ucwords($_shippingMethod[0]))
|
215 |
+
->setChronoReservationNumber($expedition->reservationNumber)
|
216 |
+
->setPopup(1);
|
217 |
+
$shipment->addTrack($track);
|
218 |
+
} else {
|
219 |
+
$this->_getSession()->addError($_helper->__($expedition->errorMessage));
|
220 |
+
$this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
|
221 |
+
return;
|
222 |
+
}
|
223 |
+
}
|
224 |
+
catch(SoapFault $fault)
|
225 |
+
{
|
226 |
+
$this->_getSession()->addError($_helper->__($fault->faultstring));
|
227 |
+
$this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
|
228 |
+
return;
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
$comment = '';
|
233 |
+
if (!empty($data['comment_text'])) {
|
234 |
+
$shipment->addComment($data['comment_text'], isset($data['comment_customer_notify']));
|
235 |
+
$comment = $data['comment_text'];
|
236 |
+
}
|
237 |
+
|
238 |
+
if (!empty($data['send_email'])) {
|
239 |
+
$shipment->setEmailSent(true);
|
240 |
+
}
|
241 |
+
|
242 |
+
$this->_saveShipment($shipment);
|
243 |
+
$shipment->sendEmail(!empty($data['send_email']), $comment);
|
244 |
+
$this->_getSession()->addSuccess($this->__('Shipment was successfully created.'));
|
245 |
+
$this->_redirect('adminhtml/sales_order/view', array('order_id' => $shipment->getOrderId()));
|
246 |
+
return;
|
247 |
+
|
248 |
+
}else {
|
249 |
+
$this->_forward('noRoute');
|
250 |
+
return;
|
251 |
+
}
|
252 |
+
}
|
253 |
+
catch (Mage_Core_Exception $e) {
|
254 |
+
$this->_getSession()->addError($e->getMessage());
|
255 |
+
}
|
256 |
+
catch (Exception $e) {
|
257 |
+
$this->_getSession()->addError($this->__('Can not save shipment: '.$e->getMessage()));
|
258 |
+
}
|
259 |
+
$this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
|
260 |
+
}
|
261 |
+
|
262 |
+
public function removeaccents($string){
|
263 |
+
$stringToReturn = str_replace(
|
264 |
+
array('�','�','�','�','�', '�', '�','�','�','�', '�','�','�','�', '�', '�','�','�','�','�', '�','�','�','�', '�','�', '�','�','�','�','�', '�', '�','�','�','�', '�','�','�','�', '�', '�','�','�','�','�', '�','�','�','�', '�','/','\xa8'),
|
265 |
+
array('a','a','a','a','a', 'c', 'e','e','e','e', 'i','i','i','i', 'n', 'o','o','o','o','o', 'u','u','u','u', 'y','y', 'A','A','A','A','A', 'C', 'E','E','E','E', 'I','I','I','I', 'N', 'O','O','O','O','O', 'U','U','U','U', 'Y',' ','e'), $string);
|
266 |
+
// Remove all remaining other unknown characters
|
267 |
+
$stringToReturn = preg_replace('/[^a-zA-Z0-9\-]/', ' ', $stringToReturn);
|
268 |
+
$stringToReturn = preg_replace('/^[\-]+/', '', $stringToReturn);
|
269 |
+
$stringToReturn = preg_replace('/[\-]+$/', '', $stringToReturn);
|
270 |
+
$stringToReturn = preg_replace('/[\-]{2,}/', ' ', $stringToReturn);
|
271 |
+
return $stringToReturn;
|
272 |
+
}
|
273 |
+
|
274 |
+
}
|
app/code/community/Chronopost/Chronorelais/etc/config.xml
CHANGED
@@ -1,340 +1,345 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Chronopost_Chronorelais>
|
5 |
-
<version>0.1.7.1</version>
|
6 |
-
<depends>
|
7 |
-
<Mage_Shipping />
|
8 |
-
<Mage_Sales />
|
9 |
-
<Mage_Adminhtml />
|
10 |
-
</depends>
|
11 |
-
</Chronopost_Chronorelais>
|
12 |
-
</modules>
|
13 |
-
|
14 |
-
<global>
|
15 |
-
<models>
|
16 |
-
<chronorelais>
|
17 |
-
<class>Chronopost_Chronorelais_Model</class>
|
18 |
-
</chronorelais>
|
19 |
-
<sales>
|
20 |
-
<rewrite>
|
21 |
-
<quote_address_total_shipping>Chronopost_Chronorelais_Model_Sales_Quote_Address_Total_Shipping</quote_address_total_shipping>
|
22 |
-
</rewrite>
|
23 |
-
</sales>
|
24 |
-
</models>
|
25 |
-
<blocks>
|
26 |
-
<chronorelais>
|
27 |
-
<class>Chronopost_Chronorelais_Block</class>
|
28 |
-
</chronorelais>
|
29 |
-
<adminhtml>
|
30 |
-
<rewrite>
|
31 |
-
<sales_order_shipment_view>Chronopost_Chronorelais_Block_Sales_Order_Shipment_View</sales_order_shipment_view>
|
32 |
-
</rewrite>
|
33 |
-
</adminhtml>
|
34 |
-
</blocks>
|
35 |
-
<helpers>
|
36 |
-
<chronorelais>
|
37 |
-
<class>Chronopost_Chronorelais_Helper</class>
|
38 |
-
</chronorelais>
|
39 |
-
</helpers>
|
40 |
-
|
41 |
-
<resources>
|
42 |
-
<sales>
|
43 |
-
<shipping>
|
44 |
-
<carriers>
|
45 |
-
<chronorelais>
|
46 |
-
<class>Chronopost_Chronorelais_Model_Carrier_Chronorelais</class>
|
47 |
-
</chronorelais>
|
48 |
-
<chronopost>
|
49 |
-
<class>Chronopost_Chronorelais_Model_Carrier_Chronopost</class>
|
50 |
-
</chronopost>
|
51 |
-
<chronoexpress>
|
52 |
-
<class>Chronopost_Chronorelais_Model_Carrier_Chronoexpress</class>
|
53 |
-
</chronoexpress>
|
54 |
-
</carriers>
|
55 |
-
</shipping>
|
56 |
-
</sales>
|
57 |
-
<chronorelais_setup>
|
58 |
-
<setup>
|
59 |
-
<module>Chronopost_Chronorelais</module>
|
60 |
-
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
|
61 |
-
</setup>
|
62 |
-
<connection>
|
63 |
-
<use>core_setup</use>
|
64 |
-
</connection>
|
65 |
-
</chronorelais_setup>
|
66 |
-
<chronorelais_write>
|
67 |
-
<connection>
|
68 |
-
<use>core_write</use>
|
69 |
-
</connection>
|
70 |
-
</chronorelais_write>
|
71 |
-
|
72 |
-
<chronorelais_read>
|
73 |
-
<connection>
|
74 |
-
<use>core_read</use>
|
75 |
-
</connection>
|
76 |
-
</chronorelais_read>
|
77 |
-
</resources>
|
78 |
-
|
79 |
-
<rewrite>
|
80 |
-
<chronopost_chronorelais_checkout_onepage>
|
81 |
-
<from><![CDATA[#^/checkout/onepage/#]]></from>
|
82 |
-
<to>/chronorelais/checkout_onepage/</to>
|
83 |
-
</chronopost_chronorelais_checkout_onepage>
|
84 |
-
<
|
85 |
-
<from><![CDATA[
|
86 |
-
<to>/chronorelais/
|
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 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
</
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
<
|
166 |
-
<
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
<
|
194 |
-
<title>
|
195 |
-
<sort_order>
|
196 |
-
</
|
197 |
-
|
198 |
-
|
199 |
-
<sort_order>
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
<
|
245 |
-
|
246 |
-
|
247 |
-
<
|
248 |
-
<
|
249 |
-
|
250 |
-
|
251 |
-
<
|
252 |
-
|
253 |
-
|
254 |
-
<
|
255 |
-
<
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
<
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
<
|
284 |
-
|
285 |
-
<
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
<
|
290 |
-
|
291 |
-
|
292 |
-
<
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
<
|
309 |
-
|
310 |
-
<
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
<
|
315 |
-
|
316 |
-
|
317 |
-
<
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
<
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
|
|
|
|
|
|
|
|
|
|
340 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Chronopost_Chronorelais>
|
5 |
+
<version>0.1.7.1</version>
|
6 |
+
<depends>
|
7 |
+
<Mage_Shipping />
|
8 |
+
<Mage_Sales />
|
9 |
+
<Mage_Adminhtml />
|
10 |
+
</depends>
|
11 |
+
</Chronopost_Chronorelais>
|
12 |
+
</modules>
|
13 |
+
|
14 |
+
<global>
|
15 |
+
<models>
|
16 |
+
<chronorelais>
|
17 |
+
<class>Chronopost_Chronorelais_Model</class>
|
18 |
+
</chronorelais>
|
19 |
+
<sales>
|
20 |
+
<rewrite>
|
21 |
+
<quote_address_total_shipping>Chronopost_Chronorelais_Model_Sales_Quote_Address_Total_Shipping</quote_address_total_shipping>
|
22 |
+
</rewrite>
|
23 |
+
</sales>
|
24 |
+
</models>
|
25 |
+
<blocks>
|
26 |
+
<chronorelais>
|
27 |
+
<class>Chronopost_Chronorelais_Block</class>
|
28 |
+
</chronorelais>
|
29 |
+
<adminhtml>
|
30 |
+
<rewrite>
|
31 |
+
<sales_order_shipment_view>Chronopost_Chronorelais_Block_Sales_Order_Shipment_View</sales_order_shipment_view>
|
32 |
+
</rewrite>
|
33 |
+
</adminhtml>
|
34 |
+
</blocks>
|
35 |
+
<helpers>
|
36 |
+
<chronorelais>
|
37 |
+
<class>Chronopost_Chronorelais_Helper</class>
|
38 |
+
</chronorelais>
|
39 |
+
</helpers>
|
40 |
+
|
41 |
+
<resources>
|
42 |
+
<sales>
|
43 |
+
<shipping>
|
44 |
+
<carriers>
|
45 |
+
<chronorelais>
|
46 |
+
<class>Chronopost_Chronorelais_Model_Carrier_Chronorelais</class>
|
47 |
+
</chronorelais>
|
48 |
+
<chronopost>
|
49 |
+
<class>Chronopost_Chronorelais_Model_Carrier_Chronopost</class>
|
50 |
+
</chronopost>
|
51 |
+
<chronoexpress>
|
52 |
+
<class>Chronopost_Chronorelais_Model_Carrier_Chronoexpress</class>
|
53 |
+
</chronoexpress>
|
54 |
+
</carriers>
|
55 |
+
</shipping>
|
56 |
+
</sales>
|
57 |
+
<chronorelais_setup>
|
58 |
+
<setup>
|
59 |
+
<module>Chronopost_Chronorelais</module>
|
60 |
+
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
|
61 |
+
</setup>
|
62 |
+
<connection>
|
63 |
+
<use>core_setup</use>
|
64 |
+
</connection>
|
65 |
+
</chronorelais_setup>
|
66 |
+
<chronorelais_write>
|
67 |
+
<connection>
|
68 |
+
<use>core_write</use>
|
69 |
+
</connection>
|
70 |
+
</chronorelais_write>
|
71 |
+
|
72 |
+
<chronorelais_read>
|
73 |
+
<connection>
|
74 |
+
<use>core_read</use>
|
75 |
+
</connection>
|
76 |
+
</chronorelais_read>
|
77 |
+
</resources>
|
78 |
+
|
79 |
+
<rewrite>
|
80 |
+
<chronopost_chronorelais_checkout_onepage>
|
81 |
+
<from><![CDATA[#^/checkout/onepage/#]]></from>
|
82 |
+
<to>/chronorelais/checkout_onepage/</to>
|
83 |
+
</chronopost_chronorelais_checkout_onepage>
|
84 |
+
<chronopost_chronorelais_checkout_multishipping>
|
85 |
+
<from><![CDATA[#^/checkout/multishipping/#]]></from>
|
86 |
+
<to>/chronorelais/checkout_multishipping/</to>
|
87 |
+
</chronopost_chronorelais_checkout_multishipping>
|
88 |
+
<chronopost_chronorelais_sales_order_shipment>
|
89 |
+
<from><![CDATA[#^/.*sales_order_shipment/save/#]]></from>
|
90 |
+
<to>/chronorelais/sales_order_shipment/save/</to>
|
91 |
+
</chronopost_chronorelais_sales_order_shipment>
|
92 |
+
</rewrite>
|
93 |
+
|
94 |
+
<fieldsets>
|
95 |
+
<sales_copy_order_billing_address>
|
96 |
+
<w_relay_point_code><to_order>*</to_order></w_relay_point_code>
|
97 |
+
</sales_copy_order_billing_address>
|
98 |
+
<sales_copy_order_shipping_address>
|
99 |
+
<w_relay_point_code><to_order>*</to_order></w_relay_point_code>
|
100 |
+
</sales_copy_order_shipping_address>
|
101 |
+
<sales_convert_quote_address>
|
102 |
+
<w_relay_point_code><to_order_address>*</to_order_address><to_customer_address>*</to_customer_address></w_relay_point_code>
|
103 |
+
</sales_convert_quote_address>
|
104 |
+
<sales_convert_order_address>
|
105 |
+
<w_relay_point_code><to_quote_address>*</to_quote_address></w_relay_point_code>
|
106 |
+
</sales_convert_order_address>
|
107 |
+
<customer_address>
|
108 |
+
<w_relay_point_code><to_quote_address>*</to_quote_address></w_relay_point_code>
|
109 |
+
</customer_address>
|
110 |
+
</fieldsets>
|
111 |
+
|
112 |
+
</global>
|
113 |
+
|
114 |
+
<frontend>
|
115 |
+
<routers>
|
116 |
+
<chronorelais>
|
117 |
+
<use>standard</use>
|
118 |
+
<args>
|
119 |
+
<module>Chronopost_Chronorelais</module>
|
120 |
+
<frontName>chronorelais</frontName>
|
121 |
+
</args>
|
122 |
+
</chronorelais>
|
123 |
+
</routers>
|
124 |
+
|
125 |
+
<layout>
|
126 |
+
<updates>
|
127 |
+
<chronorelais>
|
128 |
+
<file>chronorelais.xml</file>
|
129 |
+
</chronorelais>
|
130 |
+
</updates>
|
131 |
+
</layout>
|
132 |
+
<translate>
|
133 |
+
<modules>
|
134 |
+
<Chronopost_Chronorelais>
|
135 |
+
<files>
|
136 |
+
<default>Chronopost_Chronorelais.csv</default>
|
137 |
+
</files>
|
138 |
+
</Chronopost_Chronorelais>
|
139 |
+
</modules>
|
140 |
+
</translate>
|
141 |
+
</frontend>
|
142 |
+
|
143 |
+
<admin>
|
144 |
+
<routers>
|
145 |
+
<chronorelais>
|
146 |
+
<use>admin</use>
|
147 |
+
<args>
|
148 |
+
<module>Chronopost_Chronorelais</module>
|
149 |
+
<frontName>chronorelais</frontName>
|
150 |
+
</args>
|
151 |
+
</chronorelais>
|
152 |
+
</routers>
|
153 |
+
</admin>
|
154 |
+
|
155 |
+
<adminhtml>
|
156 |
+
<menu>
|
157 |
+
<sales>
|
158 |
+
<children>
|
159 |
+
<chronorelais translate="title"> <!-- TODO faire marcher : module="chronorelais" (aussi dans les children) -->
|
160 |
+
<title>Chronopost</title>
|
161 |
+
<sort_order>15</sort_order>
|
162 |
+
<children>
|
163 |
+
<export translate="title">
|
164 |
+
<title>Export</title>
|
165 |
+
<action>chronorelais/export</action>
|
166 |
+
<sort_order>10</sort_order>
|
167 |
+
</export>
|
168 |
+
<import translate="title">
|
169 |
+
<title>Import</title>
|
170 |
+
<action>chronorelais/import</action>
|
171 |
+
<sort_order>20</sort_order>
|
172 |
+
</import>
|
173 |
+
<impression translate="title" module="sales">
|
174 |
+
<title>Impression des étiquettes</title>
|
175 |
+
<action>chronorelais/sales_impression</action>
|
176 |
+
<sort_order>30</sort_order>
|
177 |
+
</impression>
|
178 |
+
</children>
|
179 |
+
</chronorelais>
|
180 |
+
</children>
|
181 |
+
</sales>
|
182 |
+
</menu>
|
183 |
+
<acl>
|
184 |
+
<resources>
|
185 |
+
<admin>
|
186 |
+
<children>
|
187 |
+
<sales>
|
188 |
+
<children>
|
189 |
+
<chronorelais translate="title">
|
190 |
+
<title>Chronopost</title>
|
191 |
+
<sort_order>15</sort_order>
|
192 |
+
<children>
|
193 |
+
<export translate="title">
|
194 |
+
<title>Export</title>
|
195 |
+
<sort_order>10</sort_order>
|
196 |
+
</export>
|
197 |
+
<import translate="title">
|
198 |
+
<title>Import</title>
|
199 |
+
<sort_order>20</sort_order>
|
200 |
+
</import>
|
201 |
+
<impression translate="title" module="sales">
|
202 |
+
<title>Impression des étiquettes</title>
|
203 |
+
<sort_order>30</sort_order>
|
204 |
+
</impression>
|
205 |
+
</children>
|
206 |
+
</chronorelais>
|
207 |
+
</children>
|
208 |
+
</sales>
|
209 |
+
<system>
|
210 |
+
<children>
|
211 |
+
<config>
|
212 |
+
<children>
|
213 |
+
<chronorelais translate="title" module="chronorelais">
|
214 |
+
<title>Chronopost</title>
|
215 |
+
<sort_order>100</sort_order>
|
216 |
+
</chronorelais>
|
217 |
+
</children>
|
218 |
+
</config>
|
219 |
+
</children>
|
220 |
+
</system>
|
221 |
+
</children>
|
222 |
+
</admin>
|
223 |
+
</resources>
|
224 |
+
</acl>
|
225 |
+
|
226 |
+
<translate>
|
227 |
+
<modules>
|
228 |
+
<Chronopost_Chronorelais>
|
229 |
+
<files>
|
230 |
+
<default>Chronopost_Chronorelais.csv</default>
|
231 |
+
</files>
|
232 |
+
</Chronopost_Chronorelais>
|
233 |
+
</modules>
|
234 |
+
</translate>
|
235 |
+
</adminhtml>
|
236 |
+
|
237 |
+
<default>
|
238 |
+
<chronorelais>
|
239 |
+
<shipping>
|
240 |
+
<google_map_api>ABQIAAAAZvdukOwsytNocL5anZKqZxS51Nc8ngbKeRYi0kVLSLeRaqOKHRSLs6O150txpwWCDcct2mH4X-G6OA</google_map_api>
|
241 |
+
<tracking_view_url><![CDATA[http://suivi.chronopost.fr/servletSuivi?langue=fr_FR&noLTList={tracking_number}]]></tracking_view_url>
|
242 |
+
</shipping>
|
243 |
+
<export_css>
|
244 |
+
<file_extension>.chr</file_extension>
|
245 |
+
<file_charset>ASCII-7</file_charset>
|
246 |
+
<endofline_character>crlf</endofline_character>
|
247 |
+
<field_delimiter>none</field_delimiter>
|
248 |
+
<field_separator>;</field_separator>
|
249 |
+
</export_css>
|
250 |
+
<export_cso>
|
251 |
+
<file_extension>.txt</file_extension>
|
252 |
+
<file_charset>ISO-8859-1</file_charset>
|
253 |
+
<endofline_character>crlf</endofline_character>
|
254 |
+
<field_delimiter>none</field_delimiter>
|
255 |
+
<field_separator>;</field_separator>
|
256 |
+
</export_cso>
|
257 |
+
<import>
|
258 |
+
<default_tracking_title>Chronopost - Chronopost livraison express à domicile</default_tracking_title>
|
259 |
+
<send_email>1</send_email>
|
260 |
+
<shipping_comment></shipping_comment>
|
261 |
+
<include_comment>0</include_comment>
|
262 |
+
</import>
|
263 |
+
</chronorelais>
|
264 |
+
<carriers>
|
265 |
+
<chronopost>
|
266 |
+
<active>0</active>
|
267 |
+
<title>Chronopost</title>
|
268 |
+
<model>Chronopost_Chronorelais_Model_Carrier_Chronopost</model>
|
269 |
+
<tracking_view_url></tracking_view_url>
|
270 |
+
<config>
|
271 |
+
# Chronopost
|
272 |
+
{
|
273 |
+
label: "Chronopost livraison express à domicile",
|
274 |
+
code: "chronopost",
|
275 |
+
description: "Colis livré le lendemain avant 13h, à l’adresse de votre choix.
|
276 |
+
Délai à compter de la prise en charge du colis par Chronopost, pour une livraison en France métropolitaine.
|
277 |
+
En cas d’absence, le colis est mis en instance dans le bureau de Poste le plus proche.",
|
278 |
+
tracking_url: "http://www.fr.chronopost.com/fr/tracking/result?listeNumeros={tracking_number}",
|
279 |
+
destination: "FR,MC",
|
280 |
+
fees: "{table {cart.weight} in 2.00:17.56, 3.00:18.40, 4.00:19.24, 5.00:20.08, 6.00:20.92, 7.00:21.76, 8.00:22.60, 9.00:23.44, 10.00:24.28, 15.00:28.48, 20.00:32.68, 25.00:36.88, 30.00:41.08}",
|
281 |
+
}
|
282 |
+
</config>
|
283 |
+
<weight_limit>30</weight_limit>
|
284 |
+
<quickcost_url>http://wsshipping.chronopost.fr/wsQuickcost/services/ServiceQuickCost?wsdl</quickcost_url>
|
285 |
+
<logo_url>chronopost.png</logo_url>
|
286 |
+
<debug>0</debug>
|
287 |
+
<stop_to_first_match>0</stop_to_first_match>
|
288 |
+
<!--<specificerrmsg>This shipping method is currently unavailable.</specificerrmsg>-->
|
289 |
+
<sort_order>1</sort_order>
|
290 |
+
</chronopost>
|
291 |
+
<chronoexpress>
|
292 |
+
<active>0</active>
|
293 |
+
<title>Chronopost</title>
|
294 |
+
<model>Chronopost_Chronorelais_Model_Carrier_Chronoexpress</model>
|
295 |
+
<tracking_view_url></tracking_view_url>
|
296 |
+
<config>
|
297 |
+
# Chronoexpress
|
298 |
+
{
|
299 |
+
label: "Chronopost livraison express partout dans le monde",
|
300 |
+
code: "chronoexpress",
|
301 |
+
description: "L'Europe livrée en 1 à 3 jours et le reste du monde en 2 à 5 jours.
|
302 |
+
Délai à compter de la prise en charge du colis par Chronopost.",
|
303 |
+
tracking_url: "http://www.fr.chronopost.com/fr/tracking/result?listeNumeros={tracking_number}",
|
304 |
+
destination: "DE,BE,BG,CY,DK,ES,EE,FI,GR,IE,IT,LV,LT,MT,NL,PL,PT,CZ,RO,SK,AT,HU,LU,GB,SI,SE,GF,YT,GP,MQ,RE",
|
305 |
+
fees: "{table {cart.weight} in 0.50:30.94, 1.00:45.07, 1.50:55.26, 2.00:65.45, 2.50:75.64, 3.00:85.83, 3.50:88.72, 4.00:91.61, 4.50:94.50, 5.00:97.39, 30.00:97.39}",
|
306 |
+
}
|
307 |
+
</config>
|
308 |
+
<weight_limit>30</weight_limit>
|
309 |
+
<quickcost_url>http://wsshipping.chronopost.fr/wsQuickcost/services/ServiceQuickCost?wsdl</quickcost_url>
|
310 |
+
<logo_url>chronopost.png</logo_url>
|
311 |
+
<debug>0</debug>
|
312 |
+
<stop_to_first_match>0</stop_to_first_match>
|
313 |
+
<!--<specificerrmsg>This shipping method is currently unavailable.</specificerrmsg>-->
|
314 |
+
<sort_order>1</sort_order>
|
315 |
+
</chronoexpress>
|
316 |
+
<chronorelais>
|
317 |
+
<active>0</active>
|
318 |
+
<title>Chrono Relais</title>
|
319 |
+
<model>Chronopost_Chronorelais_Model_Carrier_Chronorelais</model>
|
320 |
+
<tracking_view_url></tracking_view_url>
|
321 |
+
<config>
|
322 |
+
# Chronorelais
|
323 |
+
{
|
324 |
+
label: "Chrono Relais : livraison express en relais Pickup",
|
325 |
+
code: "chronorelais",
|
326 |
+
description: "Colis livré en Chronopost le lendemain avant 13 h dans le relais Pickup de votre choix.
|
327 |
+
Vous êtes averti par email ou SMS de l’arrivée du colis dans le point.
|
328 |
+
Délai à compter de la prise en charge du colis par Chronopost.",
|
329 |
+
tracking_url: "http://www.fr.chronopost.com/fr/tracking/result?listeNumeros={tracking_number}",
|
330 |
+
destination: "FR",
|
331 |
+
fees: "{table {cart.weight} in 2.00:17.56, 3.00:18.40, 4.00:19.24, 5.00:20.08, 6.00:20.92, 7.00:21.76, 8.00:22.60, 9.00:23.44, 10.00:24.28, 15.00:28.48, 20.00:32.68, 25.00:36.88, 30.00:41.08}",
|
332 |
+
}
|
333 |
+
</config>
|
334 |
+
<weight_limit>20</weight_limit>
|
335 |
+
<quickcost_url>http://wsshipping.chronopost.fr/wsQuickcost/services/ServiceQuickCost?wsdl</quickcost_url>
|
336 |
+
<logo_url>chronorelais.png</logo_url>
|
337 |
+
<debug>0</debug>
|
338 |
+
<stop_to_first_match>0</stop_to_first_match>
|
339 |
+
<!--<specificerrmsg>This shipping method is currently unavailable.</specificerrmsg>-->
|
340 |
+
<sort_order>2</sort_order>
|
341 |
+
</chronorelais>
|
342 |
+
</carriers>
|
343 |
+
</default>
|
344 |
+
|
345 |
</config>
|
app/code/community/Chronopost/Chronorelais/etc/system.xml
CHANGED
@@ -1,965 +1,965 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<tabs>
|
4 |
-
<chronopost translate="label" module="chronorelais">
|
5 |
-
<label>Chronopost</label>
|
6 |
-
<sort_order>200</sort_order>
|
7 |
-
</chronopost>
|
8 |
-
</tabs>
|
9 |
-
<sections>
|
10 |
-
<carriers>
|
11 |
-
<groups>
|
12 |
-
<chronopost translate="label">
|
13 |
-
<label>Chronopost</label>
|
14 |
-
<frontend_type>text</frontend_type>
|
15 |
-
<sort_order>20</sort_order>
|
16 |
-
<show_in_default>1</show_in_default>
|
17 |
-
<show_in_website>1</show_in_website>
|
18 |
-
<show_in_store>1</show_in_store>
|
19 |
-
<fields>
|
20 |
-
<active translate="label">
|
21 |
-
<label>Enabled</label>
|
22 |
-
<frontend_type>select</frontend_type>
|
23 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
24 |
-
<sort_order>1</sort_order>
|
25 |
-
<show_in_default>1</show_in_default>
|
26 |
-
<show_in_website>1</show_in_website>
|
27 |
-
<show_in_store>1</show_in_store>
|
28 |
-
</active>
|
29 |
-
<title translate="label">
|
30 |
-
<label>Title</label>
|
31 |
-
<frontend_type>text</frontend_type>
|
32 |
-
<sort_order>2</sort_order>
|
33 |
-
<show_in_default>1</show_in_default>
|
34 |
-
<show_in_website>1</show_in_website>
|
35 |
-
<show_in_store>1</show_in_store>
|
36 |
-
</title>
|
37 |
-
<config translate="label">
|
38 |
-
<label>Configuration</label>
|
39 |
-
<frontend_model>chronorelais/adminhtml_system_config_form_field_config</frontend_model>
|
40 |
-
<comment>{configuration_syntax_help}</comment>
|
41 |
-
<frontend_type>textarea</frontend_type>
|
42 |
-
<sort_order>3</sort_order>
|
43 |
-
<show_in_default>1</show_in_default>
|
44 |
-
<show_in_website>1</show_in_website>
|
45 |
-
<show_in_store>1</show_in_store>
|
46 |
-
</config>
|
47 |
-
<weight_limit translate="label">
|
48 |
-
<label>Weight Limit</label>
|
49 |
-
<frontend_type>text</frontend_type>
|
50 |
-
<comment>in Kg</comment>
|
51 |
-
<sort_order>7</sort_order>
|
52 |
-
<show_in_default>1</show_in_default>
|
53 |
-
<show_in_website>1</show_in_website>
|
54 |
-
<show_in_store>1</show_in_store>
|
55 |
-
</weight_limit>
|
56 |
-
<quickcost translate="label">
|
57 |
-
<label>Quickcost</label>
|
58 |
-
<frontend_type>select</frontend_type>
|
59 |
-
<comment>
|
60 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
61 |
-
<sort_order>10</sort_order>
|
62 |
-
<show_in_default>1</show_in_default>
|
63 |
-
<show_in_website>1</show_in_website>
|
64 |
-
<show_in_store>0</show_in_store>
|
65 |
-
</quickcost>
|
66 |
-
<quickcost_url>
|
67 |
-
<label>Quickcost Url</label>
|
68 |
-
<frontend_type>text</frontend_type>
|
69 |
-
<sort_order>11</sort_order>
|
70 |
-
<show_in_default>1</show_in_default>
|
71 |
-
<show_in_website>1</show_in_website>
|
72 |
-
<show_in_store>0</show_in_store>
|
73 |
-
</quickcost_url>
|
74 |
-
<free_shipping_enable translate="label">
|
75 |
-
<label>Free Shipping on the Amount</label>
|
76 |
-
<frontend_type>select</frontend_type>
|
77 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
78 |
-
<sort_order>12</sort_order>
|
79 |
-
<show_in_default>1</show_in_default>
|
80 |
-
<show_in_website>1</show_in_website>
|
81 |
-
<show_in_store>1</show_in_store>
|
82 |
-
</free_shipping_enable>
|
83 |
-
<free_shipping_subtotal translate="label">
|
84 |
-
<label>Minimum Amount for Free Shipping</label>
|
85 |
-
<frontend_type>text</frontend_type>
|
86 |
-
<sort_order>13</sort_order>
|
87 |
-
<show_in_default>1</show_in_default>
|
88 |
-
<show_in_website>1</show_in_website>
|
89 |
-
<show_in_store>0</show_in_store>
|
90 |
-
</free_shipping_subtotal>
|
91 |
-
<application_fee translate="label">
|
92 |
-
<label>Application Fee</label>
|
93 |
-
<frontend_type>text</frontend_type>
|
94 |
-
<sort_order>14</sort_order>
|
95 |
-
<show_in_default>1</show_in_default>
|
96 |
-
<show_in_website>1</show_in_website>
|
97 |
-
<show_in_store>1</show_in_store>
|
98 |
-
</application_fee>
|
99 |
-
<handling_fee translate="label">
|
100 |
-
<label>Handling Fee</label>
|
101 |
-
<frontend_type>text</frontend_type>
|
102 |
-
<sort_order>15</sort_order>
|
103 |
-
<show_in_default>1</show_in_default>
|
104 |
-
<show_in_website>1</show_in_website>
|
105 |
-
<show_in_store>1</show_in_store>
|
106 |
-
</handling_fee>
|
107 |
-
<logo_url>
|
108 |
-
<label>Logo Url</label>
|
109 |
-
<frontend_type>text</frontend_type>
|
110 |
-
<comment>{logo_ulr_help}</comment>
|
111 |
-
<sort_order>18</sort_order>
|
112 |
-
<show_in_default>1</show_in_default>
|
113 |
-
<show_in_website>1</show_in_website>
|
114 |
-
<show_in_store>1</show_in_store>
|
115 |
-
</logo_url>
|
116 |
-
<debug>
|
117 |
-
<label>Debug</label>
|
118 |
-
<comment>{debug_help}</comment>
|
119 |
-
<frontend_type>text</frontend_type>
|
120 |
-
<sort_order>20</sort_order>
|
121 |
-
<show_in_default>1</show_in_default>
|
122 |
-
<show_in_website>1</show_in_website>
|
123 |
-
<show_in_store>1</show_in_store>
|
124 |
-
</debug>
|
125 |
-
<!--<stop_to_first_match translate="label">
|
126 |
-
<label>Stop to first match</label>
|
127 |
-
<frontend_type>select</frontend_type>
|
128 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
129 |
-
<sort_order>22</sort_order>
|
130 |
-
<show_in_default>1</show_in_default>
|
131 |
-
<show_in_website>1</show_in_website>
|
132 |
-
<show_in_store>1</show_in_store>
|
133 |
-
</stop_to_first_match>-->
|
134 |
-
<deliver_on_saturday translate="label comment">
|
135 |
-
<label>Livraison le Samedi</label>
|
136 |
-
<comment>If yes has been selected, the option will be available every Thursdays from 6pm to Fridays at 3pm.</comment>
|
137 |
-
<frontend_type>select</frontend_type>
|
138 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
139 |
-
<sort_order>23</sort_order>
|
140 |
-
<show_in_default>1</show_in_default>
|
141 |
-
<show_in_website>1</show_in_website>
|
142 |
-
<show_in_store>1</show_in_store>
|
143 |
-
</deliver_on_saturday>
|
144 |
-
<!--<showmethod translate="label">
|
145 |
-
<label>Show Method if Not Applicable</label>
|
146 |
-
<frontend_type>select</frontend_type>
|
147 |
-
<sort_order>30</sort_order>
|
148 |
-
<frontend_class>shipping-skip-hide</frontend_class>
|
149 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
150 |
-
<show_in_default>1</show_in_default>
|
151 |
-
<show_in_website>1</show_in_website>
|
152 |
-
<show_in_store>0</show_in_store>
|
153 |
-
</showmethod>
|
154 |
-
<specificerrmsg translate="label">
|
155 |
-
<label>Displayed Error Message</label>
|
156 |
-
<frontend_type>textarea</frontend_type>
|
157 |
-
<sort_order>31</sort_order>
|
158 |
-
<show_in_default>1</show_in_default>
|
159 |
-
<show_in_website>1</show_in_website>
|
160 |
-
<show_in_store>1</show_in_store>
|
161 |
-
</specificerrmsg>-->
|
162 |
-
<sort_order translate="label">
|
163 |
-
<label>Sort order</label>
|
164 |
-
<frontend_type>text</frontend_type>
|
165 |
-
<sort_order>100</sort_order>
|
166 |
-
<show_in_default>1</show_in_default>
|
167 |
-
<show_in_website>1</show_in_website>
|
168 |
-
<show_in_store>1</show_in_store>
|
169 |
-
</sort_order>
|
170 |
-
</fields>
|
171 |
-
</chronopost>
|
172 |
-
|
173 |
-
<chronoexpress translate="label">
|
174 |
-
<label>Chrono Express</label>
|
175 |
-
<frontend_type>text</frontend_type>
|
176 |
-
<sort_order>21</sort_order>
|
177 |
-
<show_in_default>1</show_in_default>
|
178 |
-
<show_in_website>1</show_in_website>
|
179 |
-
<show_in_store>1</show_in_store>
|
180 |
-
<fields>
|
181 |
-
<active translate="label">
|
182 |
-
<label>Enabled</label>
|
183 |
-
<frontend_type>select</frontend_type>
|
184 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
185 |
-
<sort_order>1</sort_order>
|
186 |
-
<show_in_default>1</show_in_default>
|
187 |
-
<show_in_website>1</show_in_website>
|
188 |
-
<show_in_store>1</show_in_store>
|
189 |
-
</active>
|
190 |
-
<title translate="label">
|
191 |
-
<label>Title</label>
|
192 |
-
<frontend_type>text</frontend_type>
|
193 |
-
<sort_order>2</sort_order>
|
194 |
-
<show_in_default>1</show_in_default>
|
195 |
-
<show_in_website>1</show_in_website>
|
196 |
-
<show_in_store>1</show_in_store>
|
197 |
-
</title>
|
198 |
-
<config translate="label">
|
199 |
-
<label>Configuration</label>
|
200 |
-
<frontend_model>chronorelais/adminhtml_system_config_form_field_config</frontend_model>
|
201 |
-
<comment>{configuration_syntax_help}</comment>
|
202 |
-
<frontend_type>textarea</frontend_type>
|
203 |
-
<sort_order>3</sort_order>
|
204 |
-
<show_in_default>1</show_in_default>
|
205 |
-
<show_in_website>1</show_in_website>
|
206 |
-
<show_in_store>1</show_in_store>
|
207 |
-
</config>
|
208 |
-
<weight_limit translate="label">
|
209 |
-
<label>Weight Limit</label>
|
210 |
-
<frontend_type>text</frontend_type>
|
211 |
-
<comment>in Kg</comment>
|
212 |
-
<sort_order>7</sort_order>
|
213 |
-
<show_in_default>1</show_in_default>
|
214 |
-
<show_in_website>1</show_in_website>
|
215 |
-
<show_in_store>1</show_in_store>
|
216 |
-
</weight_limit>
|
217 |
-
<quickcost translate="label">
|
218 |
-
<label>Quickcost</label>
|
219 |
-
<frontend_type>select</frontend_type>
|
220 |
-
<comment>
|
221 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
222 |
-
<sort_order>10</sort_order>
|
223 |
-
<show_in_default>1</show_in_default>
|
224 |
-
<show_in_website>1</show_in_website>
|
225 |
-
<show_in_store>0</show_in_store>
|
226 |
-
</quickcost>
|
227 |
-
<quickcost_url>
|
228 |
-
<label>Quickcost Url</label>
|
229 |
-
<frontend_type>text</frontend_type>
|
230 |
-
<sort_order>11</sort_order>
|
231 |
-
<show_in_default>1</show_in_default>
|
232 |
-
<show_in_website>1</show_in_website>
|
233 |
-
<show_in_store>0</show_in_store>
|
234 |
-
</quickcost_url>
|
235 |
-
<free_shipping_enable translate="label">
|
236 |
-
<label>Free Shipping on the Amount</label>
|
237 |
-
<frontend_type>select</frontend_type>
|
238 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
239 |
-
<sort_order>12</sort_order>
|
240 |
-
<show_in_default>1</show_in_default>
|
241 |
-
<show_in_website>1</show_in_website>
|
242 |
-
<show_in_store>1</show_in_store>
|
243 |
-
</free_shipping_enable>
|
244 |
-
<free_shipping_subtotal translate="label">
|
245 |
-
<label>Minimum Amount for Free Shipping</label>
|
246 |
-
<frontend_type>text</frontend_type>
|
247 |
-
<sort_order>13</sort_order>
|
248 |
-
<show_in_default>1</show_in_default>
|
249 |
-
<show_in_website>1</show_in_website>
|
250 |
-
<show_in_store>0</show_in_store>
|
251 |
-
</free_shipping_subtotal>
|
252 |
-
<application_fee translate="label">
|
253 |
-
<label>Application Fee</label>
|
254 |
-
<frontend_type>text</frontend_type>
|
255 |
-
<sort_order>14</sort_order>
|
256 |
-
<show_in_default>1</show_in_default>
|
257 |
-
<show_in_website>1</show_in_website>
|
258 |
-
<show_in_store>1</show_in_store>
|
259 |
-
</application_fee>
|
260 |
-
<handling_fee translate="label">
|
261 |
-
<label>Handling Fee</label>
|
262 |
-
<frontend_type>text</frontend_type>
|
263 |
-
<sort_order>15</sort_order>
|
264 |
-
<show_in_default>1</show_in_default>
|
265 |
-
<show_in_website>1</show_in_website>
|
266 |
-
<show_in_store>1</show_in_store>
|
267 |
-
</handling_fee>
|
268 |
-
<logo_url>
|
269 |
-
<label>Logo Url</label>
|
270 |
-
<frontend_type>text</frontend_type>
|
271 |
-
<comment>{logo_ulr_help}</comment>
|
272 |
-
<sort_order>18</sort_order>
|
273 |
-
<show_in_default>1</show_in_default>
|
274 |
-
<show_in_website>1</show_in_website>
|
275 |
-
<show_in_store>1</show_in_store>
|
276 |
-
</logo_url>
|
277 |
-
<debug>
|
278 |
-
<label>Debug</label>
|
279 |
-
<comment>{debug_help}</comment>
|
280 |
-
<frontend_type>text</frontend_type>
|
281 |
-
<sort_order>20</sort_order>
|
282 |
-
<show_in_default>1</show_in_default>
|
283 |
-
<show_in_website>1</show_in_website>
|
284 |
-
<show_in_store>1</show_in_store>
|
285 |
-
</debug>
|
286 |
-
<!--<stop_to_first_match translate="label">
|
287 |
-
<label>Stop to first match</label>
|
288 |
-
<frontend_type>select</frontend_type>
|
289 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
290 |
-
<sort_order>22</sort_order>
|
291 |
-
<show_in_default>1</show_in_default>
|
292 |
-
<show_in_website>1</show_in_website>
|
293 |
-
<show_in_store>1</show_in_store>
|
294 |
-
</stop_to_first_match>-->
|
295 |
-
<!-- deliver_on_saturday not included in chronoexpress only -->
|
296 |
-
<!--<showmethod translate="label">
|
297 |
-
<label>Show Method if Not Applicable</label>
|
298 |
-
<frontend_type>select</frontend_type>
|
299 |
-
<sort_order>30</sort_order>
|
300 |
-
<frontend_class>shipping-skip-hide</frontend_class>
|
301 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
302 |
-
<show_in_default>1</show_in_default>
|
303 |
-
<show_in_website>1</show_in_website>
|
304 |
-
<show_in_store>0</show_in_store>
|
305 |
-
</showmethod>
|
306 |
-
<specificerrmsg translate="label">
|
307 |
-
<label>Displayed Error Message</label>
|
308 |
-
<frontend_type>textarea</frontend_type>
|
309 |
-
<sort_order>31</sort_order>
|
310 |
-
<show_in_default>1</show_in_default>
|
311 |
-
<show_in_website>1</show_in_website>
|
312 |
-
<show_in_store>1</show_in_store>
|
313 |
-
</specificerrmsg>-->
|
314 |
-
<sort_order translate="label">
|
315 |
-
<label>Sort order</label>
|
316 |
-
<frontend_type>text</frontend_type>
|
317 |
-
<sort_order>100</sort_order>
|
318 |
-
<show_in_default>1</show_in_default>
|
319 |
-
<show_in_website>1</show_in_website>
|
320 |
-
<show_in_store>1</show_in_store>
|
321 |
-
</sort_order>
|
322 |
-
</fields>
|
323 |
-
</chronoexpress>
|
324 |
-
|
325 |
-
<chronorelais translate="label">
|
326 |
-
<label>Chrono Relais</label>
|
327 |
-
<frontend_type>text</frontend_type>
|
328 |
-
<sort_order>22</sort_order>
|
329 |
-
<show_in_default>1</show_in_default>
|
330 |
-
<show_in_website>1</show_in_website>
|
331 |
-
<show_in_store>1</show_in_store>
|
332 |
-
<fields>
|
333 |
-
<active translate="label">
|
334 |
-
<label>Enabled</label>
|
335 |
-
<frontend_type>select</frontend_type>
|
336 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
337 |
-
<sort_order>1</sort_order>
|
338 |
-
<show_in_default>1</show_in_default>
|
339 |
-
<show_in_website>1</show_in_website>
|
340 |
-
<show_in_store>1</show_in_store>
|
341 |
-
</active>
|
342 |
-
<title translate="label">
|
343 |
-
<label>Title</label>
|
344 |
-
<frontend_type>text</frontend_type>
|
345 |
-
<sort_order>2</sort_order>
|
346 |
-
<show_in_default>1</show_in_default>
|
347 |
-
<show_in_website>1</show_in_website>
|
348 |
-
<show_in_store>1</show_in_store>
|
349 |
-
</title>
|
350 |
-
<config translate="label">
|
351 |
-
<label>Configuration</label>
|
352 |
-
<frontend_model>chronorelais/adminhtml_system_config_form_field_config</frontend_model>
|
353 |
-
<comment>{configuration_syntax_help}</comment>
|
354 |
-
<frontend_type>textarea</frontend_type>
|
355 |
-
<sort_order>3</sort_order>
|
356 |
-
<show_in_default>1</show_in_default>
|
357 |
-
<show_in_website>1</show_in_website>
|
358 |
-
<show_in_store>1</show_in_store>
|
359 |
-
</config>
|
360 |
-
<weight_limit translate="label">
|
361 |
-
<label>Weight Limit</label>
|
362 |
-
<frontend_type>text</frontend_type>
|
363 |
-
<comment>in Kg</comment>
|
364 |
-
<sort_order>7</sort_order>
|
365 |
-
<show_in_default>1</show_in_default>
|
366 |
-
<show_in_website>1</show_in_website>
|
367 |
-
<show_in_store>1</show_in_store>
|
368 |
-
</weight_limit>
|
369 |
-
<quickcost translate="label">
|
370 |
-
<label>Quickcost</label>
|
371 |
-
<frontend_type>select</frontend_type>
|
372 |
-
<comment>
|
373 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
374 |
-
<sort_order>10</sort_order>
|
375 |
-
<show_in_default>1</show_in_default>
|
376 |
-
<show_in_website>1</show_in_website>
|
377 |
-
<show_in_store>0</show_in_store>
|
378 |
-
</quickcost>
|
379 |
-
<quickcost_url>
|
380 |
-
<label>Quickcost Url</label>
|
381 |
-
<frontend_type>text</frontend_type>
|
382 |
-
<sort_order>11</sort_order>
|
383 |
-
<show_in_default>1</show_in_default>
|
384 |
-
<show_in_website>1</show_in_website>
|
385 |
-
<show_in_store>0</show_in_store>
|
386 |
-
</quickcost_url>
|
387 |
-
<free_shipping_enable translate="label">
|
388 |
-
<label>Free Shipping with Minimum Order Amount</label>
|
389 |
-
<frontend_type>select</frontend_type>
|
390 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
391 |
-
<sort_order>12</sort_order>
|
392 |
-
<show_in_default>1</show_in_default>
|
393 |
-
<show_in_website>1</show_in_website>
|
394 |
-
<show_in_store>1</show_in_store>
|
395 |
-
</free_shipping_enable>
|
396 |
-
<free_shipping_subtotal translate="label">
|
397 |
-
<label>Minimum Order Amount for Free Shipping</label>
|
398 |
-
<frontend_type>text</frontend_type>
|
399 |
-
<sort_order>13</sort_order>
|
400 |
-
<show_in_default>1</show_in_default>
|
401 |
-
<show_in_website>1</show_in_website>
|
402 |
-
<show_in_store>1</show_in_store>
|
403 |
-
</free_shipping_subtotal>
|
404 |
-
<application_fee translate="label">
|
405 |
-
<label>Application Fee</label>
|
406 |
-
<frontend_type>text</frontend_type>
|
407 |
-
<sort_order>14</sort_order>
|
408 |
-
<show_in_default>1</show_in_default>
|
409 |
-
<show_in_website>1</show_in_website>
|
410 |
-
<show_in_store>1</show_in_store>
|
411 |
-
</application_fee>
|
412 |
-
<handling_fee translate="label">
|
413 |
-
<label>Handling Fee</label>
|
414 |
-
<frontend_type>text</frontend_type>
|
415 |
-
<sort_order>15</sort_order>
|
416 |
-
<show_in_default>1</show_in_default>
|
417 |
-
<show_in_website>1</show_in_website>
|
418 |
-
<show_in_store>1</show_in_store>
|
419 |
-
</handling_fee>
|
420 |
-
<logo_url>
|
421 |
-
<label>Logo Url</label>
|
422 |
-
<frontend_type>text</frontend_type>
|
423 |
-
<comment>{logo_ulr_help}</comment>
|
424 |
-
<sort_order>18</sort_order>
|
425 |
-
<show_in_default>1</show_in_default>
|
426 |
-
<show_in_website>1</show_in_website>
|
427 |
-
<show_in_store>1</show_in_store>
|
428 |
-
</logo_url>
|
429 |
-
<debug>
|
430 |
-
<label>Debug</label>
|
431 |
-
<comment>{debug_help}</comment>
|
432 |
-
<frontend_type>text</frontend_type>
|
433 |
-
<sort_order>20</sort_order>
|
434 |
-
<show_in_default>1</show_in_default>
|
435 |
-
<show_in_website>1</show_in_website>
|
436 |
-
<show_in_store>1</show_in_store>
|
437 |
-
</debug>
|
438 |
-
<!--<stop_to_first_match translate="label">
|
439 |
-
<label>Stop to first match</label>
|
440 |
-
<frontend_type>select</frontend_type>
|
441 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
442 |
-
<sort_order>22</sort_order>
|
443 |
-
<show_in_default>1</show_in_default>
|
444 |
-
<show_in_website>1</show_in_website>
|
445 |
-
<show_in_store>1</show_in_store>
|
446 |
-
</stop_to_first_match>-->
|
447 |
-
<deliver_on_saturday translate="label comment">
|
448 |
-
<label>Livraison le Samedi</label>
|
449 |
-
<comment>If yes has been selected, the option will be available every Thursdays from 6pm to Fridays at 3pm.</comment>
|
450 |
-
<frontend_type>select</frontend_type>
|
451 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
452 |
-
<sort_order>23</sort_order>
|
453 |
-
<show_in_default>1</show_in_default>
|
454 |
-
<show_in_website>1</show_in_website>
|
455 |
-
<show_in_store>1</show_in_store>
|
456 |
-
</deliver_on_saturday>
|
457 |
-
<!--<showmethod translate="label">
|
458 |
-
<label>Show Method if Not Applicable</label>
|
459 |
-
<frontend_type>select</frontend_type>
|
460 |
-
<sort_order>30</sort_order>
|
461 |
-
<frontend_class>shipping-skip-hide</frontend_class>
|
462 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
463 |
-
<show_in_default>1</show_in_default>
|
464 |
-
<show_in_website>1</show_in_website>
|
465 |
-
<show_in_store>0</show_in_store>
|
466 |
-
</showmethod>
|
467 |
-
<specificerrmsg translate="label">
|
468 |
-
<label>Displayed Error Message</label>
|
469 |
-
<frontend_type>textarea</frontend_type>
|
470 |
-
<sort_order>31</sort_order>
|
471 |
-
<show_in_default>1</show_in_default>
|
472 |
-
<show_in_website>1</show_in_website>
|
473 |
-
<show_in_store>1</show_in_store>
|
474 |
-
</specificerrmsg>-->
|
475 |
-
<sort_order translate="label">
|
476 |
-
<label>Sort order</label>
|
477 |
-
<frontend_type>text</frontend_type>
|
478 |
-
<sort_order>100</sort_order>
|
479 |
-
<show_in_default>1</show_in_default>
|
480 |
-
<show_in_website>1</show_in_website>
|
481 |
-
<show_in_store>1</show_in_store>
|
482 |
-
</sort_order>
|
483 |
-
</fields>
|
484 |
-
</chronorelais>
|
485 |
-
</groups>
|
486 |
-
</carriers>
|
487 |
-
</sections>
|
488 |
-
|
489 |
-
<sections>
|
490 |
-
<chronorelais>
|
491 |
-
<label>Chronopost Settings</label>
|
492 |
-
<tab>chronopost</tab>
|
493 |
-
<frontend_type>text</frontend_type>
|
494 |
-
<sort_order>2000</sort_order>
|
495 |
-
<show_in_default>1</show_in_default>
|
496 |
-
<show_in_website>1</show_in_website>
|
497 |
-
<show_in_store>1</show_in_store>
|
498 |
-
<groups>
|
499 |
-
<shipping translate="label">
|
500 |
-
<label>General</label>
|
501 |
-
<frontend_type>text</frontend_type>
|
502 |
-
<sort_order>10</sort_order>
|
503 |
-
<show_in_default>1</show_in_default>
|
504 |
-
<show_in_website>1</show_in_website>
|
505 |
-
<show_in_store>1</show_in_store>
|
506 |
-
<fields>
|
507 |
-
<account_number translate="label">
|
508 |
-
<label>N° de compte Chronopost</label>
|
509 |
-
<frontend_type>text</frontend_type>
|
510 |
-
<sort_order>7</sort_order>
|
511 |
-
<show_in_default>1</show_in_default>
|
512 |
-
<show_in_website>1</show_in_website>
|
513 |
-
<show_in_store>1</show_in_store>
|
514 |
-
</account_number>
|
515 |
-
<sub_account_number translate="label">
|
516 |
-
<label>Sous-compte</label>
|
517 |
-
<comment>must be 3 digits or empty</comment>
|
518 |
-
<frontend_type>text</frontend_type>
|
519 |
-
<sort_order>8</sort_order>
|
520 |
-
<show_in_default>1</show_in_default>
|
521 |
-
<show_in_website>1</show_in_website>
|
522 |
-
<show_in_store>1</show_in_store>
|
523 |
-
</sub_account_number>
|
524 |
-
<account_pass translate="label">
|
525 |
-
<label>Mot de passe Chronopost</label>
|
526 |
-
<frontend_type>text</frontend_type>
|
527 |
-
<sort_order>9</sort_order>
|
528 |
-
<show_in_default>1</show_in_default>
|
529 |
-
<show_in_website>1</show_in_website>
|
530 |
-
<show_in_store>1</show_in_store>
|
531 |
-
</account_pass>
|
532 |
-
<google_map_api translate="label">
|
533 |
-
<label>Google Map API Key</label>
|
534 |
-
<frontend_type>text</frontend_type>
|
535 |
-
<sort_order>10</sort_order>
|
536 |
-
<show_in_default>1</show_in_default>
|
537 |
-
<show_in_website>1</show_in_website>
|
538 |
-
<show_in_store>1</show_in_store>
|
539 |
-
</google_map_api>
|
540 |
-
<tracking_view_url translate="label">
|
541 |
-
<label>Tracking URL</label>
|
542 |
-
<comment>For English language, replace fr_FR with en_GB in the above url</comment>
|
543 |
-
<frontend_type>text</frontend_type>
|
544 |
-
<sort_order>20</sort_order>
|
545 |
-
<show_in_default>1</show_in_default>
|
546 |
-
<show_in_website>1</show_in_website>
|
547 |
-
<show_in_store>1</show_in_store>
|
548 |
-
</tracking_view_url>
|
549 |
-
|
550 |
-
</fields>
|
551 |
-
</shipping>
|
552 |
-
<export_css translate="label">
|
553 |
-
<label>Export Configuration CSS</label>
|
554 |
-
<frontend_type>text</frontend_type>
|
555 |
-
<sort_order>20</sort_order>
|
556 |
-
<show_in_default>1</show_in_default>
|
557 |
-
<show_in_website>1</show_in_website>
|
558 |
-
<show_in_store>1</show_in_store>
|
559 |
-
<fields>
|
560 |
-
<file_extension translate="label">
|
561 |
-
<label>File Extension</label>
|
562 |
-
<frontend_type>select</frontend_type>
|
563 |
-
<source_model>chronorelais/config_source_fileExtension</source_model>
|
564 |
-
<sort_order>10</sort_order>
|
565 |
-
<show_in_default>1</show_in_default>
|
566 |
-
<show_in_website>1</show_in_website>
|
567 |
-
<show_in_store>1</show_in_store>
|
568 |
-
</file_extension>
|
569 |
-
<file_charset translate="label">
|
570 |
-
<label>File Charset</label>
|
571 |
-
<frontend_type>select</frontend_type>
|
572 |
-
<source_model>chronorelais/config_source_fileCharset</source_model>
|
573 |
-
<sort_order>20</sort_order>
|
574 |
-
<show_in_default>1</show_in_default>
|
575 |
-
<show_in_website>1</show_in_website>
|
576 |
-
<show_in_store>1</show_in_store>
|
577 |
-
</file_charset>
|
578 |
-
<endofline_character translate="label">
|
579 |
-
<label>End Of Line Character</label>
|
580 |
-
<frontend_type>select</frontend_type>
|
581 |
-
<source_model>chronorelais/config_source_endOfLineCharacter</source_model>
|
582 |
-
<sort_order>30</sort_order>
|
583 |
-
<show_in_default>1</show_in_default>
|
584 |
-
<show_in_website>1</show_in_website>
|
585 |
-
<show_in_store>1</show_in_store>
|
586 |
-
</endofline_character>
|
587 |
-
<field_delimiter translate="label">
|
588 |
-
<label>Field Delimiter</label>
|
589 |
-
<frontend_type>select</frontend_type>
|
590 |
-
<source_model>chronorelais/config_source_fieldDelimiter</source_model>
|
591 |
-
<sort_order>40</sort_order>
|
592 |
-
<show_in_default>1</show_in_default>
|
593 |
-
<show_in_website>1</show_in_website>
|
594 |
-
<show_in_store>1</show_in_store>
|
595 |
-
</field_delimiter>
|
596 |
-
<field_separator translate="label">
|
597 |
-
<label>Field Separator</label>
|
598 |
-
<frontend_type>select</frontend_type>
|
599 |
-
<source_model>chronorelais/config_source_fieldSeparator</source_model>
|
600 |
-
<sort_order>50</sort_order>
|
601 |
-
<show_in_default>1</show_in_default>
|
602 |
-
<show_in_website>1</show_in_website>
|
603 |
-
<show_in_store>1</show_in_store>
|
604 |
-
</field_separator>
|
605 |
-
</fields>
|
606 |
-
</export_css>
|
607 |
-
<export_cso translate="label">
|
608 |
-
<label>Export Configuration CSO</label>
|
609 |
-
<frontend_type>text</frontend_type>
|
610 |
-
<sort_order>21</sort_order>
|
611 |
-
<show_in_default>1</show_in_default>
|
612 |
-
<show_in_website>1</show_in_website>
|
613 |
-
<show_in_store>1</show_in_store>
|
614 |
-
<fields>
|
615 |
-
<file_extension translate="label">
|
616 |
-
<label>File Extension</label>
|
617 |
-
<frontend_type>select</frontend_type>
|
618 |
-
<source_model>chronorelais/config_source_fileExtension</source_model>
|
619 |
-
<sort_order>10</sort_order>
|
620 |
-
<show_in_default>1</show_in_default>
|
621 |
-
<show_in_website>1</show_in_website>
|
622 |
-
<show_in_store>1</show_in_store>
|
623 |
-
</file_extension>
|
624 |
-
<file_charset translate="label">
|
625 |
-
<label>File Charset</label>
|
626 |
-
<frontend_type>select</frontend_type>
|
627 |
-
<source_model>chronorelais/config_source_fileCharset</source_model>
|
628 |
-
<sort_order>20</sort_order>
|
629 |
-
<show_in_default>1</show_in_default>
|
630 |
-
<show_in_website>1</show_in_website>
|
631 |
-
<show_in_store>1</show_in_store>
|
632 |
-
</file_charset>
|
633 |
-
<endofline_character translate="label">
|
634 |
-
<label>End Of Line Character</label>
|
635 |
-
<frontend_type>select</frontend_type>
|
636 |
-
<source_model>chronorelais/config_source_endOfLineCharacter</source_model>
|
637 |
-
<sort_order>30</sort_order>
|
638 |
-
<show_in_default>1</show_in_default>
|
639 |
-
<show_in_website>1</show_in_website>
|
640 |
-
<show_in_store>1</show_in_store>
|
641 |
-
</endofline_character>
|
642 |
-
<field_delimiter translate="label">
|
643 |
-
<label>Field Delimiter</label>
|
644 |
-
<frontend_type>select</frontend_type>
|
645 |
-
<source_model>chronorelais/config_source_fieldDelimiter</source_model>
|
646 |
-
<sort_order>40</sort_order>
|
647 |
-
<show_in_default>1</show_in_default>
|
648 |
-
<show_in_website>1</show_in_website>
|
649 |
-
<show_in_store>1</show_in_store>
|
650 |
-
</field_delimiter>
|
651 |
-
<field_separator translate="label">
|
652 |
-
<label>Field Separator</label>
|
653 |
-
<frontend_type>select</frontend_type>
|
654 |
-
<source_model>chronorelais/config_source_fieldSeparator</source_model>
|
655 |
-
<sort_order>50</sort_order>
|
656 |
-
<show_in_default>1</show_in_default>
|
657 |
-
<show_in_website>1</show_in_website>
|
658 |
-
<show_in_store>1</show_in_store>
|
659 |
-
</field_separator>
|
660 |
-
</fields>
|
661 |
-
</export_cso>
|
662 |
-
<import translate="label">
|
663 |
-
<label>Import Configuration</label>
|
664 |
-
<frontend_type>text</frontend_type>
|
665 |
-
<sort_order>30</sort_order>
|
666 |
-
<show_in_default>1</show_in_default>
|
667 |
-
<show_in_website>1</show_in_website>
|
668 |
-
<show_in_store>1</show_in_store>
|
669 |
-
<fields>
|
670 |
-
<default_tracking_title translate="label comment">
|
671 |
-
<label>Default Tracking Title</label>
|
672 |
-
<frontend_type>text</frontend_type>
|
673 |
-
<sort_order>10</sort_order>
|
674 |
-
<show_in_default>1</show_in_default>
|
675 |
-
<show_in_website>1</show_in_website>
|
676 |
-
<show_in_store>1</show_in_store>
|
677 |
-
<comment>This value can be changed in the import form</comment>
|
678 |
-
</default_tracking_title>
|
679 |
-
<send_email translate="label comment">
|
680 |
-
<label>Send an e-mail</label>
|
681 |
-
<frontend_type>select</frontend_type>
|
682 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
683 |
-
<sort_order>20</sort_order>
|
684 |
-
<show_in_default>1</show_in_default>
|
685 |
-
<show_in_website>1</show_in_website>
|
686 |
-
<show_in_store>1</show_in_store>
|
687 |
-
<comment>Send shipping confirmation to the customer</comment>
|
688 |
-
</send_email>
|
689 |
-
<shipping_comment translate="label comment">
|
690 |
-
<label>Shipping Comment</label>
|
691 |
-
<frontend_type>text</frontend_type>
|
692 |
-
<sort_order>30</sort_order>
|
693 |
-
<show_in_default>1</show_in_default>
|
694 |
-
<show_in_website>1</show_in_website>
|
695 |
-
<show_in_store>1</show_in_store>
|
696 |
-
<comment>Internal comment, can be left empty</comment>
|
697 |
-
</shipping_comment>
|
698 |
-
<include_comment translate="label comment">
|
699 |
-
<label>Include comment into e-mail</label>
|
700 |
-
<frontend_type>select</frontend_type>
|
701 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
702 |
-
<sort_order>40</sort_order>
|
703 |
-
<show_in_default>1</show_in_default>
|
704 |
-
<show_in_website>1</show_in_website>
|
705 |
-
<show_in_store>1</show_in_store>
|
706 |
-
<comment>Only applies if the shipping comment is set</comment>
|
707 |
-
</include_comment>
|
708 |
-
</fields>
|
709 |
-
</import>
|
710 |
-
|
711 |
-
<shipperinformation translate="label">
|
712 |
-
<label>Shipper Information for Labels printing</label>
|
713 |
-
<frontend_type>text</frontend_type>
|
714 |
-
<sort_order>40</sort_order>
|
715 |
-
<show_in_default>1</show_in_default>
|
716 |
-
<show_in_website>1</show_in_website>
|
717 |
-
<show_in_store>1</show_in_store>
|
718 |
-
<fields>
|
719 |
-
<civility translate="label">
|
720 |
-
<label>Shipper Civility</label>
|
721 |
-
<frontend_type>select</frontend_type>
|
722 |
-
<source_model>chronorelais/config_source_civility</source_model>
|
723 |
-
<sort_order>10</sort_order>
|
724 |
-
<show_in_default>1</show_in_default>
|
725 |
-
<show_in_website>1</show_in_website>
|
726 |
-
<show_in_store>1</show_in_store>
|
727 |
-
</civility>
|
728 |
-
<name translate="label comment">
|
729 |
-
<label>Shipper Name</label>
|
730 |
-
<frontend_type>text</frontend_type>
|
731 |
-
<sort_order>20</sort_order>
|
732 |
-
<show_in_default>1</show_in_default>
|
733 |
-
<show_in_website>1</show_in_website>
|
734 |
-
<show_in_store>1</show_in_store>
|
735 |
-
<comment>Company name</comment>
|
736 |
-
</name>
|
737 |
-
<name2 translate="label comment">
|
738 |
-
<label>Shipper Name2</label>
|
739 |
-
<frontend_type>text</frontend_type>
|
740 |
-
<sort_order>30</sort_order>
|
741 |
-
<show_in_default>1</show_in_default>
|
742 |
-
<show_in_website>1</show_in_website>
|
743 |
-
<show_in_store>1</show_in_store>
|
744 |
-
<comment>[Optional]</comment>
|
745 |
-
</name2>
|
746 |
-
<address1 translate="label">
|
747 |
-
<label>Shipper Address1</label>
|
748 |
-
<frontend_type>text</frontend_type>
|
749 |
-
<sort_order>40</sort_order>
|
750 |
-
<show_in_default>1</show_in_default>
|
751 |
-
<show_in_website>1</show_in_website>
|
752 |
-
<show_in_store>1</show_in_store>
|
753 |
-
</address1>
|
754 |
-
<address2 translate="label comment">
|
755 |
-
<label>Shipper Address2</label>
|
756 |
-
<frontend_type>text</frontend_type>
|
757 |
-
<sort_order>50</sort_order>
|
758 |
-
<show_in_default>1</show_in_default>
|
759 |
-
<show_in_website>1</show_in_website>
|
760 |
-
<show_in_store>1</show_in_store>
|
761 |
-
<comment>[Optional]</comment>
|
762 |
-
</address2>
|
763 |
-
<zipcode translate="label">
|
764 |
-
<label>Shipper Zipcode</label>
|
765 |
-
<frontend_type>text</frontend_type>
|
766 |
-
<sort_order>60</sort_order>
|
767 |
-
<show_in_default>1</show_in_default>
|
768 |
-
<show_in_website>1</show_in_website>
|
769 |
-
<show_in_store>1</show_in_store>
|
770 |
-
</zipcode>
|
771 |
-
<city translate="label">
|
772 |
-
<label>Shipper City</label>
|
773 |
-
<frontend_type>text</frontend_type>
|
774 |
-
<sort_order>70</sort_order>
|
775 |
-
<show_in_default>1</show_in_default>
|
776 |
-
<show_in_website>1</show_in_website>
|
777 |
-
<show_in_store>1</show_in_store>
|
778 |
-
</city>
|
779 |
-
<country translate="label">
|
780 |
-
<label>Shipper Country</label>
|
781 |
-
<frontend_type>select</frontend_type>
|
782 |
-
<sort_order>80</sort_order>
|
783 |
-
<source_model>adminhtml/system_config_source_country</source_model>
|
784 |
-
<show_in_default>1</show_in_default>
|
785 |
-
<show_in_website>1</show_in_website>
|
786 |
-
<show_in_store>1</show_in_store>
|
787 |
-
</country>
|
788 |
-
<contactname translate="label">
|
789 |
-
<label>Shipper Contact Name</label>
|
790 |
-
<frontend_type>text</frontend_type>
|
791 |
-
<sort_order>90</sort_order>
|
792 |
-
<show_in_default>1</show_in_default>
|
793 |
-
<show_in_website>1</show_in_website>
|
794 |
-
<show_in_store>1</show_in_store>
|
795 |
-
</contactname>
|
796 |
-
<email translate="label">
|
797 |
-
<label>Shipper Email</label>
|
798 |
-
<frontend_type>text</frontend_type>
|
799 |
-
<sort_order>100</sort_order>
|
800 |
-
<show_in_default>1</show_in_default>
|
801 |
-
<show_in_website>1</show_in_website>
|
802 |
-
<show_in_store>1</show_in_store>
|
803 |
-
<comment>[Optional]</comment>
|
804 |
-
</email>
|
805 |
-
<phone translate="label comment">
|
806 |
-
<label>Shipper Telephone</label>
|
807 |
-
<frontend_type>text</frontend_type>
|
808 |
-
<sort_order>110</sort_order>
|
809 |
-
<show_in_default>1</show_in_default>
|
810 |
-
<show_in_website>1</show_in_website>
|
811 |
-
<show_in_store>1</show_in_store>
|
812 |
-
<comment>[Optional]</comment>
|
813 |
-
</phone>
|
814 |
-
<mobilephone translate="label comment">
|
815 |
-
<label>Shipper Mobile</label>
|
816 |
-
<frontend_type>text</frontend_type>
|
817 |
-
<sort_order>120</sort_order>
|
818 |
-
<show_in_default>1</show_in_default>
|
819 |
-
<show_in_website>1</show_in_website>
|
820 |
-
<show_in_store>1</show_in_store>
|
821 |
-
<comment>[Optional]</comment>
|
822 |
-
</mobilephone>
|
823 |
-
</fields>
|
824 |
-
</shipperinformation>
|
825 |
-
|
826 |
-
<customerinformation translate="label">
|
827 |
-
<label>Chronopost Customer Account Information for Labels printing</label>
|
828 |
-
<frontend_type>text</frontend_type>
|
829 |
-
<sort_order>50</sort_order>
|
830 |
-
<show_in_default>1</show_in_default>
|
831 |
-
<show_in_website>1</show_in_website>
|
832 |
-
<show_in_store>1</show_in_store>
|
833 |
-
<fields>
|
834 |
-
<civility translate="label">
|
835 |
-
<label>Customer Civility</label>
|
836 |
-
<frontend_type>select</frontend_type>
|
837 |
-
<source_model>chronorelais/config_source_civility</source_model>
|
838 |
-
<sort_order>10</sort_order>
|
839 |
-
<show_in_default>1</show_in_default>
|
840 |
-
<show_in_website>1</show_in_website>
|
841 |
-
<show_in_store>1</show_in_store>
|
842 |
-
</civility>
|
843 |
-
<name translate="label comment">
|
844 |
-
<label>Customer Name </label>
|
845 |
-
<frontend_type>text</frontend_type>
|
846 |
-
<sort_order>20</sort_order>
|
847 |
-
<show_in_default>1</show_in_default>
|
848 |
-
<show_in_website>1</show_in_website>
|
849 |
-
<show_in_store>1</show_in_store>
|
850 |
-
<comment>Company name</comment>
|
851 |
-
</name>
|
852 |
-
<name2 translate="label comment">
|
853 |
-
<label>Customer Name2</label>
|
854 |
-
<frontend_type>text</frontend_type>
|
855 |
-
<sort_order>30</sort_order>
|
856 |
-
<show_in_default>1</show_in_default>
|
857 |
-
<show_in_website>1</show_in_website>
|
858 |
-
<show_in_store>1</show_in_store>
|
859 |
-
<comment>[Optional]</comment>
|
860 |
-
</name2>
|
861 |
-
<address1 translate="label">
|
862 |
-
<label>Customer Address1</label>
|
863 |
-
<frontend_type>text</frontend_type>
|
864 |
-
<sort_order>40</sort_order>
|
865 |
-
<show_in_default>1</show_in_default>
|
866 |
-
<show_in_website>1</show_in_website>
|
867 |
-
<show_in_store>1</show_in_store>
|
868 |
-
</address1>
|
869 |
-
<address2 translate="label comment">
|
870 |
-
<label>Customer Address2</label>
|
871 |
-
<frontend_type>text</frontend_type>
|
872 |
-
<sort_order>50</sort_order>
|
873 |
-
<show_in_default>1</show_in_default>
|
874 |
-
<show_in_website>1</show_in_website>
|
875 |
-
<show_in_store>1</show_in_store>
|
876 |
-
<comment>[Optional]</comment>
|
877 |
-
</address2>
|
878 |
-
<zipcode translate="label">
|
879 |
-
<label>Customer Zipcode</label>
|
880 |
-
<frontend_type>text</frontend_type>
|
881 |
-
<sort_order>60</sort_order>
|
882 |
-
<show_in_default>1</show_in_default>
|
883 |
-
<show_in_website>1</show_in_website>
|
884 |
-
<show_in_store>1</show_in_store>
|
885 |
-
</zipcode>
|
886 |
-
<city translate="label">
|
887 |
-
<label>Customer City</label>
|
888 |
-
<frontend_type>text</frontend_type>
|
889 |
-
<sort_order>70</sort_order>
|
890 |
-
<show_in_default>1</show_in_default>
|
891 |
-
<show_in_website>1</show_in_website>
|
892 |
-
<show_in_store>1</show_in_store>
|
893 |
-
</city>
|
894 |
-
<country translate="label">
|
895 |
-
<label>Customer Country</label>
|
896 |
-
<frontend_type>select</frontend_type>
|
897 |
-
<sort_order>80</sort_order>
|
898 |
-
<source_model>adminhtml/system_config_source_country</source_model>
|
899 |
-
<show_in_default>1</show_in_default>
|
900 |
-
<show_in_website>1</show_in_website>
|
901 |
-
<show_in_store>1</show_in_store>
|
902 |
-
</country>
|
903 |
-
<contactname translate="label">
|
904 |
-
<label>Customer Contact Name</label>
|
905 |
-
<frontend_type>text</frontend_type>
|
906 |
-
<sort_order>90</sort_order>
|
907 |
-
<show_in_default>1</show_in_default>
|
908 |
-
<show_in_website>1</show_in_website>
|
909 |
-
<show_in_store>1</show_in_store>
|
910 |
-
</contactname>
|
911 |
-
<email translate="label">
|
912 |
-
<label>Customer Email</label>
|
913 |
-
<frontend_type>text</frontend_type>
|
914 |
-
<sort_order>100</sort_order>
|
915 |
-
<show_in_default>1</show_in_default>
|
916 |
-
<show_in_website>1</show_in_website>
|
917 |
-
<show_in_store>1</show_in_store>
|
918 |
-
<comment>[Optional]</comment>
|
919 |
-
</email>
|
920 |
-
<phone translate="label comment">
|
921 |
-
<label>Customer Telephone</label>
|
922 |
-
<frontend_type>text</frontend_type>
|
923 |
-
<sort_order>110</sort_order>
|
924 |
-
<show_in_default>1</show_in_default>
|
925 |
-
<show_in_website>1</show_in_website>
|
926 |
-
<show_in_store>1</show_in_store>
|
927 |
-
<comment>[Optional]</comment>
|
928 |
-
</phone>
|
929 |
-
<mobilephone translate="label comment">
|
930 |
-
<label>Customer Mobile</label>
|
931 |
-
<frontend_type>text</frontend_type>
|
932 |
-
<sort_order>120</sort_order>
|
933 |
-
<show_in_default>1</show_in_default>
|
934 |
-
<show_in_website>1</show_in_website>
|
935 |
-
<show_in_store>1</show_in_store>
|
936 |
-
<comment>[Optional]</comment>
|
937 |
-
</mobilephone>
|
938 |
-
</fields>
|
939 |
-
</customerinformation>
|
940 |
-
|
941 |
-
<skybillparam translate="label">
|
942 |
-
<label>Skybill Parameters for Labels printing</label>
|
943 |
-
<frontend_type>text</frontend_type>
|
944 |
-
<sort_order>60</sort_order>
|
945 |
-
<show_in_default>1</show_in_default>
|
946 |
-
<show_in_website>1</show_in_website>
|
947 |
-
<show_in_store>1</show_in_store>
|
948 |
-
<fields>
|
949 |
-
<mode translate="label">
|
950 |
-
<label>Print Mode</label>
|
951 |
-
<frontend_type>select</frontend_type>
|
952 |
-
<source_model>chronorelais/config_source_printMode</source_model>
|
953 |
-
<sort_order>10</sort_order>
|
954 |
-
<show_in_default>1</show_in_default>
|
955 |
-
<show_in_website>1</show_in_website>
|
956 |
-
<show_in_store>1</show_in_store>
|
957 |
-
<required>1</required>
|
958 |
-
</mode>
|
959 |
-
</fields>
|
960 |
-
</skybillparam>
|
961 |
-
</groups>
|
962 |
-
</chronorelais>
|
963 |
-
</sections>
|
964 |
-
|
965 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<chronopost translate="label" module="chronorelais">
|
5 |
+
<label>Chronopost</label>
|
6 |
+
<sort_order>200</sort_order>
|
7 |
+
</chronopost>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<carriers>
|
11 |
+
<groups>
|
12 |
+
<chronopost translate="label">
|
13 |
+
<label>Chronopost</label>
|
14 |
+
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>20</sort_order>
|
16 |
+
<show_in_default>1</show_in_default>
|
17 |
+
<show_in_website>1</show_in_website>
|
18 |
+
<show_in_store>1</show_in_store>
|
19 |
+
<fields>
|
20 |
+
<active translate="label">
|
21 |
+
<label>Enabled</label>
|
22 |
+
<frontend_type>select</frontend_type>
|
23 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
24 |
+
<sort_order>1</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
</active>
|
29 |
+
<title translate="label">
|
30 |
+
<label>Title</label>
|
31 |
+
<frontend_type>text</frontend_type>
|
32 |
+
<sort_order>2</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
</title>
|
37 |
+
<config translate="label">
|
38 |
+
<label>Configuration</label>
|
39 |
+
<frontend_model>chronorelais/adminhtml_system_config_form_field_config</frontend_model>
|
40 |
+
<comment>{configuration_syntax_help}</comment>
|
41 |
+
<frontend_type>textarea</frontend_type>
|
42 |
+
<sort_order>3</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</config>
|
47 |
+
<weight_limit translate="label">
|
48 |
+
<label>Weight Limit</label>
|
49 |
+
<frontend_type>text</frontend_type>
|
50 |
+
<comment>in Kg</comment>
|
51 |
+
<sort_order>7</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
</weight_limit>
|
56 |
+
<quickcost translate="label">
|
57 |
+
<label>Quickcost</label>
|
58 |
+
<frontend_type>select</frontend_type>
|
59 |
+
<comment>No : cost is obtained from your rate grid ; Yes : cost is fetched from URL below</comment>
|
60 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
61 |
+
<sort_order>10</sort_order>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>0</show_in_store>
|
65 |
+
</quickcost>
|
66 |
+
<quickcost_url>
|
67 |
+
<label>Quickcost Url</label>
|
68 |
+
<frontend_type>text</frontend_type>
|
69 |
+
<sort_order>11</sort_order>
|
70 |
+
<show_in_default>1</show_in_default>
|
71 |
+
<show_in_website>1</show_in_website>
|
72 |
+
<show_in_store>0</show_in_store>
|
73 |
+
</quickcost_url>
|
74 |
+
<free_shipping_enable translate="label">
|
75 |
+
<label>Free Shipping on the Amount</label>
|
76 |
+
<frontend_type>select</frontend_type>
|
77 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
78 |
+
<sort_order>12</sort_order>
|
79 |
+
<show_in_default>1</show_in_default>
|
80 |
+
<show_in_website>1</show_in_website>
|
81 |
+
<show_in_store>1</show_in_store>
|
82 |
+
</free_shipping_enable>
|
83 |
+
<free_shipping_subtotal translate="label">
|
84 |
+
<label>Minimum Amount for Free Shipping</label>
|
85 |
+
<frontend_type>text</frontend_type>
|
86 |
+
<sort_order>13</sort_order>
|
87 |
+
<show_in_default>1</show_in_default>
|
88 |
+
<show_in_website>1</show_in_website>
|
89 |
+
<show_in_store>0</show_in_store>
|
90 |
+
</free_shipping_subtotal>
|
91 |
+
<application_fee translate="label">
|
92 |
+
<label>Application Fee</label>
|
93 |
+
<frontend_type>text</frontend_type>
|
94 |
+
<sort_order>14</sort_order>
|
95 |
+
<show_in_default>1</show_in_default>
|
96 |
+
<show_in_website>1</show_in_website>
|
97 |
+
<show_in_store>1</show_in_store>
|
98 |
+
</application_fee>
|
99 |
+
<handling_fee translate="label">
|
100 |
+
<label>Handling Fee</label>
|
101 |
+
<frontend_type>text</frontend_type>
|
102 |
+
<sort_order>15</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>1</show_in_store>
|
106 |
+
</handling_fee>
|
107 |
+
<logo_url>
|
108 |
+
<label>Logo Url</label>
|
109 |
+
<frontend_type>text</frontend_type>
|
110 |
+
<comment>{logo_ulr_help}</comment>
|
111 |
+
<sort_order>18</sort_order>
|
112 |
+
<show_in_default>1</show_in_default>
|
113 |
+
<show_in_website>1</show_in_website>
|
114 |
+
<show_in_store>1</show_in_store>
|
115 |
+
</logo_url>
|
116 |
+
<debug>
|
117 |
+
<label>Debug</label>
|
118 |
+
<comment>{debug_help}</comment>
|
119 |
+
<frontend_type>text</frontend_type>
|
120 |
+
<sort_order>20</sort_order>
|
121 |
+
<show_in_default>1</show_in_default>
|
122 |
+
<show_in_website>1</show_in_website>
|
123 |
+
<show_in_store>1</show_in_store>
|
124 |
+
</debug>
|
125 |
+
<!--<stop_to_first_match translate="label">
|
126 |
+
<label>Stop to first match</label>
|
127 |
+
<frontend_type>select</frontend_type>
|
128 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
129 |
+
<sort_order>22</sort_order>
|
130 |
+
<show_in_default>1</show_in_default>
|
131 |
+
<show_in_website>1</show_in_website>
|
132 |
+
<show_in_store>1</show_in_store>
|
133 |
+
</stop_to_first_match>-->
|
134 |
+
<deliver_on_saturday translate="label comment">
|
135 |
+
<label>Livraison le Samedi</label>
|
136 |
+
<comment>If yes has been selected, the option will be available every Thursdays from 6pm to Fridays at 3pm.</comment>
|
137 |
+
<frontend_type>select</frontend_type>
|
138 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
139 |
+
<sort_order>23</sort_order>
|
140 |
+
<show_in_default>1</show_in_default>
|
141 |
+
<show_in_website>1</show_in_website>
|
142 |
+
<show_in_store>1</show_in_store>
|
143 |
+
</deliver_on_saturday>
|
144 |
+
<!--<showmethod translate="label">
|
145 |
+
<label>Show Method if Not Applicable</label>
|
146 |
+
<frontend_type>select</frontend_type>
|
147 |
+
<sort_order>30</sort_order>
|
148 |
+
<frontend_class>shipping-skip-hide</frontend_class>
|
149 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
150 |
+
<show_in_default>1</show_in_default>
|
151 |
+
<show_in_website>1</show_in_website>
|
152 |
+
<show_in_store>0</show_in_store>
|
153 |
+
</showmethod>
|
154 |
+
<specificerrmsg translate="label">
|
155 |
+
<label>Displayed Error Message</label>
|
156 |
+
<frontend_type>textarea</frontend_type>
|
157 |
+
<sort_order>31</sort_order>
|
158 |
+
<show_in_default>1</show_in_default>
|
159 |
+
<show_in_website>1</show_in_website>
|
160 |
+
<show_in_store>1</show_in_store>
|
161 |
+
</specificerrmsg>-->
|
162 |
+
<sort_order translate="label">
|
163 |
+
<label>Sort order</label>
|
164 |
+
<frontend_type>text</frontend_type>
|
165 |
+
<sort_order>100</sort_order>
|
166 |
+
<show_in_default>1</show_in_default>
|
167 |
+
<show_in_website>1</show_in_website>
|
168 |
+
<show_in_store>1</show_in_store>
|
169 |
+
</sort_order>
|
170 |
+
</fields>
|
171 |
+
</chronopost>
|
172 |
+
|
173 |
+
<chronoexpress translate="label">
|
174 |
+
<label>Chrono Express</label>
|
175 |
+
<frontend_type>text</frontend_type>
|
176 |
+
<sort_order>21</sort_order>
|
177 |
+
<show_in_default>1</show_in_default>
|
178 |
+
<show_in_website>1</show_in_website>
|
179 |
+
<show_in_store>1</show_in_store>
|
180 |
+
<fields>
|
181 |
+
<active translate="label">
|
182 |
+
<label>Enabled</label>
|
183 |
+
<frontend_type>select</frontend_type>
|
184 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
185 |
+
<sort_order>1</sort_order>
|
186 |
+
<show_in_default>1</show_in_default>
|
187 |
+
<show_in_website>1</show_in_website>
|
188 |
+
<show_in_store>1</show_in_store>
|
189 |
+
</active>
|
190 |
+
<title translate="label">
|
191 |
+
<label>Title</label>
|
192 |
+
<frontend_type>text</frontend_type>
|
193 |
+
<sort_order>2</sort_order>
|
194 |
+
<show_in_default>1</show_in_default>
|
195 |
+
<show_in_website>1</show_in_website>
|
196 |
+
<show_in_store>1</show_in_store>
|
197 |
+
</title>
|
198 |
+
<config translate="label">
|
199 |
+
<label>Configuration</label>
|
200 |
+
<frontend_model>chronorelais/adminhtml_system_config_form_field_config</frontend_model>
|
201 |
+
<comment>{configuration_syntax_help}</comment>
|
202 |
+
<frontend_type>textarea</frontend_type>
|
203 |
+
<sort_order>3</sort_order>
|
204 |
+
<show_in_default>1</show_in_default>
|
205 |
+
<show_in_website>1</show_in_website>
|
206 |
+
<show_in_store>1</show_in_store>
|
207 |
+
</config>
|
208 |
+
<weight_limit translate="label">
|
209 |
+
<label>Weight Limit</label>
|
210 |
+
<frontend_type>text</frontend_type>
|
211 |
+
<comment>in Kg</comment>
|
212 |
+
<sort_order>7</sort_order>
|
213 |
+
<show_in_default>1</show_in_default>
|
214 |
+
<show_in_website>1</show_in_website>
|
215 |
+
<show_in_store>1</show_in_store>
|
216 |
+
</weight_limit>
|
217 |
+
<quickcost translate="label">
|
218 |
+
<label>Quickcost</label>
|
219 |
+
<frontend_type>select</frontend_type>
|
220 |
+
<comment>No : cost is obtained from your rate grid ; Yes : cost is fetched from URL below</comment>
|
221 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
222 |
+
<sort_order>10</sort_order>
|
223 |
+
<show_in_default>1</show_in_default>
|
224 |
+
<show_in_website>1</show_in_website>
|
225 |
+
<show_in_store>0</show_in_store>
|
226 |
+
</quickcost>
|
227 |
+
<quickcost_url>
|
228 |
+
<label>Quickcost Url</label>
|
229 |
+
<frontend_type>text</frontend_type>
|
230 |
+
<sort_order>11</sort_order>
|
231 |
+
<show_in_default>1</show_in_default>
|
232 |
+
<show_in_website>1</show_in_website>
|
233 |
+
<show_in_store>0</show_in_store>
|
234 |
+
</quickcost_url>
|
235 |
+
<free_shipping_enable translate="label">
|
236 |
+
<label>Free Shipping on the Amount</label>
|
237 |
+
<frontend_type>select</frontend_type>
|
238 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
239 |
+
<sort_order>12</sort_order>
|
240 |
+
<show_in_default>1</show_in_default>
|
241 |
+
<show_in_website>1</show_in_website>
|
242 |
+
<show_in_store>1</show_in_store>
|
243 |
+
</free_shipping_enable>
|
244 |
+
<free_shipping_subtotal translate="label">
|
245 |
+
<label>Minimum Amount for Free Shipping</label>
|
246 |
+
<frontend_type>text</frontend_type>
|
247 |
+
<sort_order>13</sort_order>
|
248 |
+
<show_in_default>1</show_in_default>
|
249 |
+
<show_in_website>1</show_in_website>
|
250 |
+
<show_in_store>0</show_in_store>
|
251 |
+
</free_shipping_subtotal>
|
252 |
+
<application_fee translate="label">
|
253 |
+
<label>Application Fee</label>
|
254 |
+
<frontend_type>text</frontend_type>
|
255 |
+
<sort_order>14</sort_order>
|
256 |
+
<show_in_default>1</show_in_default>
|
257 |
+
<show_in_website>1</show_in_website>
|
258 |
+
<show_in_store>1</show_in_store>
|
259 |
+
</application_fee>
|
260 |
+
<handling_fee translate="label">
|
261 |
+
<label>Handling Fee</label>
|
262 |
+
<frontend_type>text</frontend_type>
|
263 |
+
<sort_order>15</sort_order>
|
264 |
+
<show_in_default>1</show_in_default>
|
265 |
+
<show_in_website>1</show_in_website>
|
266 |
+
<show_in_store>1</show_in_store>
|
267 |
+
</handling_fee>
|
268 |
+
<logo_url>
|
269 |
+
<label>Logo Url</label>
|
270 |
+
<frontend_type>text</frontend_type>
|
271 |
+
<comment>{logo_ulr_help}</comment>
|
272 |
+
<sort_order>18</sort_order>
|
273 |
+
<show_in_default>1</show_in_default>
|
274 |
+
<show_in_website>1</show_in_website>
|
275 |
+
<show_in_store>1</show_in_store>
|
276 |
+
</logo_url>
|
277 |
+
<debug>
|
278 |
+
<label>Debug</label>
|
279 |
+
<comment>{debug_help}</comment>
|
280 |
+
<frontend_type>text</frontend_type>
|
281 |
+
<sort_order>20</sort_order>
|
282 |
+
<show_in_default>1</show_in_default>
|
283 |
+
<show_in_website>1</show_in_website>
|
284 |
+
<show_in_store>1</show_in_store>
|
285 |
+
</debug>
|
286 |
+
<!--<stop_to_first_match translate="label">
|
287 |
+
<label>Stop to first match</label>
|
288 |
+
<frontend_type>select</frontend_type>
|
289 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
290 |
+
<sort_order>22</sort_order>
|
291 |
+
<show_in_default>1</show_in_default>
|
292 |
+
<show_in_website>1</show_in_website>
|
293 |
+
<show_in_store>1</show_in_store>
|
294 |
+
</stop_to_first_match>-->
|
295 |
+
<!-- deliver_on_saturday not included in chronoexpress only -->
|
296 |
+
<!--<showmethod translate="label">
|
297 |
+
<label>Show Method if Not Applicable</label>
|
298 |
+
<frontend_type>select</frontend_type>
|
299 |
+
<sort_order>30</sort_order>
|
300 |
+
<frontend_class>shipping-skip-hide</frontend_class>
|
301 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
302 |
+
<show_in_default>1</show_in_default>
|
303 |
+
<show_in_website>1</show_in_website>
|
304 |
+
<show_in_store>0</show_in_store>
|
305 |
+
</showmethod>
|
306 |
+
<specificerrmsg translate="label">
|
307 |
+
<label>Displayed Error Message</label>
|
308 |
+
<frontend_type>textarea</frontend_type>
|
309 |
+
<sort_order>31</sort_order>
|
310 |
+
<show_in_default>1</show_in_default>
|
311 |
+
<show_in_website>1</show_in_website>
|
312 |
+
<show_in_store>1</show_in_store>
|
313 |
+
</specificerrmsg>-->
|
314 |
+
<sort_order translate="label">
|
315 |
+
<label>Sort order</label>
|
316 |
+
<frontend_type>text</frontend_type>
|
317 |
+
<sort_order>100</sort_order>
|
318 |
+
<show_in_default>1</show_in_default>
|
319 |
+
<show_in_website>1</show_in_website>
|
320 |
+
<show_in_store>1</show_in_store>
|
321 |
+
</sort_order>
|
322 |
+
</fields>
|
323 |
+
</chronoexpress>
|
324 |
+
|
325 |
+
<chronorelais translate="label">
|
326 |
+
<label>Chrono Relais</label>
|
327 |
+
<frontend_type>text</frontend_type>
|
328 |
+
<sort_order>22</sort_order>
|
329 |
+
<show_in_default>1</show_in_default>
|
330 |
+
<show_in_website>1</show_in_website>
|
331 |
+
<show_in_store>1</show_in_store>
|
332 |
+
<fields>
|
333 |
+
<active translate="label">
|
334 |
+
<label>Enabled</label>
|
335 |
+
<frontend_type>select</frontend_type>
|
336 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
337 |
+
<sort_order>1</sort_order>
|
338 |
+
<show_in_default>1</show_in_default>
|
339 |
+
<show_in_website>1</show_in_website>
|
340 |
+
<show_in_store>1</show_in_store>
|
341 |
+
</active>
|
342 |
+
<title translate="label">
|
343 |
+
<label>Title</label>
|
344 |
+
<frontend_type>text</frontend_type>
|
345 |
+
<sort_order>2</sort_order>
|
346 |
+
<show_in_default>1</show_in_default>
|
347 |
+
<show_in_website>1</show_in_website>
|
348 |
+
<show_in_store>1</show_in_store>
|
349 |
+
</title>
|
350 |
+
<config translate="label">
|
351 |
+
<label>Configuration</label>
|
352 |
+
<frontend_model>chronorelais/adminhtml_system_config_form_field_config</frontend_model>
|
353 |
+
<comment>{configuration_syntax_help}</comment>
|
354 |
+
<frontend_type>textarea</frontend_type>
|
355 |
+
<sort_order>3</sort_order>
|
356 |
+
<show_in_default>1</show_in_default>
|
357 |
+
<show_in_website>1</show_in_website>
|
358 |
+
<show_in_store>1</show_in_store>
|
359 |
+
</config>
|
360 |
+
<weight_limit translate="label">
|
361 |
+
<label>Weight Limit</label>
|
362 |
+
<frontend_type>text</frontend_type>
|
363 |
+
<comment>in Kg</comment>
|
364 |
+
<sort_order>7</sort_order>
|
365 |
+
<show_in_default>1</show_in_default>
|
366 |
+
<show_in_website>1</show_in_website>
|
367 |
+
<show_in_store>1</show_in_store>
|
368 |
+
</weight_limit>
|
369 |
+
<quickcost translate="label">
|
370 |
+
<label>Quickcost</label>
|
371 |
+
<frontend_type>select</frontend_type>
|
372 |
+
<comment>No : cost is obtained from your rate grid ; Yes : cost is fetched from URL below</comment>
|
373 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
374 |
+
<sort_order>10</sort_order>
|
375 |
+
<show_in_default>1</show_in_default>
|
376 |
+
<show_in_website>1</show_in_website>
|
377 |
+
<show_in_store>0</show_in_store>
|
378 |
+
</quickcost>
|
379 |
+
<quickcost_url>
|
380 |
+
<label>Quickcost Url</label>
|
381 |
+
<frontend_type>text</frontend_type>
|
382 |
+
<sort_order>11</sort_order>
|
383 |
+
<show_in_default>1</show_in_default>
|
384 |
+
<show_in_website>1</show_in_website>
|
385 |
+
<show_in_store>0</show_in_store>
|
386 |
+
</quickcost_url>
|
387 |
+
<free_shipping_enable translate="label">
|
388 |
+
<label>Free Shipping with Minimum Order Amount</label>
|
389 |
+
<frontend_type>select</frontend_type>
|
390 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
391 |
+
<sort_order>12</sort_order>
|
392 |
+
<show_in_default>1</show_in_default>
|
393 |
+
<show_in_website>1</show_in_website>
|
394 |
+
<show_in_store>1</show_in_store>
|
395 |
+
</free_shipping_enable>
|
396 |
+
<free_shipping_subtotal translate="label">
|
397 |
+
<label>Minimum Order Amount for Free Shipping</label>
|
398 |
+
<frontend_type>text</frontend_type>
|
399 |
+
<sort_order>13</sort_order>
|
400 |
+
<show_in_default>1</show_in_default>
|
401 |
+
<show_in_website>1</show_in_website>
|
402 |
+
<show_in_store>1</show_in_store>
|
403 |
+
</free_shipping_subtotal>
|
404 |
+
<application_fee translate="label">
|
405 |
+
<label>Application Fee</label>
|
406 |
+
<frontend_type>text</frontend_type>
|
407 |
+
<sort_order>14</sort_order>
|
408 |
+
<show_in_default>1</show_in_default>
|
409 |
+
<show_in_website>1</show_in_website>
|
410 |
+
<show_in_store>1</show_in_store>
|
411 |
+
</application_fee>
|
412 |
+
<handling_fee translate="label">
|
413 |
+
<label>Handling Fee</label>
|
414 |
+
<frontend_type>text</frontend_type>
|
415 |
+
<sort_order>15</sort_order>
|
416 |
+
<show_in_default>1</show_in_default>
|
417 |
+
<show_in_website>1</show_in_website>
|
418 |
+
<show_in_store>1</show_in_store>
|
419 |
+
</handling_fee>
|
420 |
+
<logo_url>
|
421 |
+
<label>Logo Url</label>
|
422 |
+
<frontend_type>text</frontend_type>
|
423 |
+
<comment>{logo_ulr_help}</comment>
|
424 |
+
<sort_order>18</sort_order>
|
425 |
+
<show_in_default>1</show_in_default>
|
426 |
+
<show_in_website>1</show_in_website>
|
427 |
+
<show_in_store>1</show_in_store>
|
428 |
+
</logo_url>
|
429 |
+
<debug>
|
430 |
+
<label>Debug</label>
|
431 |
+
<comment>{debug_help}</comment>
|
432 |
+
<frontend_type>text</frontend_type>
|
433 |
+
<sort_order>20</sort_order>
|
434 |
+
<show_in_default>1</show_in_default>
|
435 |
+
<show_in_website>1</show_in_website>
|
436 |
+
<show_in_store>1</show_in_store>
|
437 |
+
</debug>
|
438 |
+
<!--<stop_to_first_match translate="label">
|
439 |
+
<label>Stop to first match</label>
|
440 |
+
<frontend_type>select</frontend_type>
|
441 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
442 |
+
<sort_order>22</sort_order>
|
443 |
+
<show_in_default>1</show_in_default>
|
444 |
+
<show_in_website>1</show_in_website>
|
445 |
+
<show_in_store>1</show_in_store>
|
446 |
+
</stop_to_first_match>-->
|
447 |
+
<deliver_on_saturday translate="label comment">
|
448 |
+
<label>Livraison le Samedi</label>
|
449 |
+
<comment>If yes has been selected, the option will be available every Thursdays from 6pm to Fridays at 3pm.</comment>
|
450 |
+
<frontend_type>select</frontend_type>
|
451 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
452 |
+
<sort_order>23</sort_order>
|
453 |
+
<show_in_default>1</show_in_default>
|
454 |
+
<show_in_website>1</show_in_website>
|
455 |
+
<show_in_store>1</show_in_store>
|
456 |
+
</deliver_on_saturday>
|
457 |
+
<!--<showmethod translate="label">
|
458 |
+
<label>Show Method if Not Applicable</label>
|
459 |
+
<frontend_type>select</frontend_type>
|
460 |
+
<sort_order>30</sort_order>
|
461 |
+
<frontend_class>shipping-skip-hide</frontend_class>
|
462 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
463 |
+
<show_in_default>1</show_in_default>
|
464 |
+
<show_in_website>1</show_in_website>
|
465 |
+
<show_in_store>0</show_in_store>
|
466 |
+
</showmethod>
|
467 |
+
<specificerrmsg translate="label">
|
468 |
+
<label>Displayed Error Message</label>
|
469 |
+
<frontend_type>textarea</frontend_type>
|
470 |
+
<sort_order>31</sort_order>
|
471 |
+
<show_in_default>1</show_in_default>
|
472 |
+
<show_in_website>1</show_in_website>
|
473 |
+
<show_in_store>1</show_in_store>
|
474 |
+
</specificerrmsg>-->
|
475 |
+
<sort_order translate="label">
|
476 |
+
<label>Sort order</label>
|
477 |
+
<frontend_type>text</frontend_type>
|
478 |
+
<sort_order>100</sort_order>
|
479 |
+
<show_in_default>1</show_in_default>
|
480 |
+
<show_in_website>1</show_in_website>
|
481 |
+
<show_in_store>1</show_in_store>
|
482 |
+
</sort_order>
|
483 |
+
</fields>
|
484 |
+
</chronorelais>
|
485 |
+
</groups>
|
486 |
+
</carriers>
|
487 |
+
</sections>
|
488 |
+
|
489 |
+
<sections>
|
490 |
+
<chronorelais>
|
491 |
+
<label>Chronopost Settings</label>
|
492 |
+
<tab>chronopost</tab>
|
493 |
+
<frontend_type>text</frontend_type>
|
494 |
+
<sort_order>2000</sort_order>
|
495 |
+
<show_in_default>1</show_in_default>
|
496 |
+
<show_in_website>1</show_in_website>
|
497 |
+
<show_in_store>1</show_in_store>
|
498 |
+
<groups>
|
499 |
+
<shipping translate="label">
|
500 |
+
<label>General</label>
|
501 |
+
<frontend_type>text</frontend_type>
|
502 |
+
<sort_order>10</sort_order>
|
503 |
+
<show_in_default>1</show_in_default>
|
504 |
+
<show_in_website>1</show_in_website>
|
505 |
+
<show_in_store>1</show_in_store>
|
506 |
+
<fields>
|
507 |
+
<account_number translate="label">
|
508 |
+
<label>N° de compte Chronopost</label>
|
509 |
+
<frontend_type>text</frontend_type>
|
510 |
+
<sort_order>7</sort_order>
|
511 |
+
<show_in_default>1</show_in_default>
|
512 |
+
<show_in_website>1</show_in_website>
|
513 |
+
<show_in_store>1</show_in_store>
|
514 |
+
</account_number>
|
515 |
+
<sub_account_number translate="label">
|
516 |
+
<label>Sous-compte</label>
|
517 |
+
<comment>must be 3 digits or empty</comment>
|
518 |
+
<frontend_type>text</frontend_type>
|
519 |
+
<sort_order>8</sort_order>
|
520 |
+
<show_in_default>1</show_in_default>
|
521 |
+
<show_in_website>1</show_in_website>
|
522 |
+
<show_in_store>1</show_in_store>
|
523 |
+
</sub_account_number>
|
524 |
+
<account_pass translate="label">
|
525 |
+
<label>Mot de passe Chronopost</label>
|
526 |
+
<frontend_type>text</frontend_type>
|
527 |
+
<sort_order>9</sort_order>
|
528 |
+
<show_in_default>1</show_in_default>
|
529 |
+
<show_in_website>1</show_in_website>
|
530 |
+
<show_in_store>1</show_in_store>
|
531 |
+
</account_pass>
|
532 |
+
<google_map_api translate="label">
|
533 |
+
<label>Google Map API Key</label>
|
534 |
+
<frontend_type>text</frontend_type>
|
535 |
+
<sort_order>10</sort_order>
|
536 |
+
<show_in_default>1</show_in_default>
|
537 |
+
<show_in_website>1</show_in_website>
|
538 |
+
<show_in_store>1</show_in_store>
|
539 |
+
</google_map_api>
|
540 |
+
<tracking_view_url translate="label">
|
541 |
+
<label>Tracking URL</label>
|
542 |
+
<comment>For English language, replace fr_FR with en_GB in the above url</comment>
|
543 |
+
<frontend_type>text</frontend_type>
|
544 |
+
<sort_order>20</sort_order>
|
545 |
+
<show_in_default>1</show_in_default>
|
546 |
+
<show_in_website>1</show_in_website>
|
547 |
+
<show_in_store>1</show_in_store>
|
548 |
+
</tracking_view_url>
|
549 |
+
|
550 |
+
</fields>
|
551 |
+
</shipping>
|
552 |
+
<export_css translate="label">
|
553 |
+
<label>Export Configuration CSS</label>
|
554 |
+
<frontend_type>text</frontend_type>
|
555 |
+
<sort_order>20</sort_order>
|
556 |
+
<show_in_default>1</show_in_default>
|
557 |
+
<show_in_website>1</show_in_website>
|
558 |
+
<show_in_store>1</show_in_store>
|
559 |
+
<fields>
|
560 |
+
<file_extension translate="label">
|
561 |
+
<label>File Extension</label>
|
562 |
+
<frontend_type>select</frontend_type>
|
563 |
+
<source_model>chronorelais/config_source_fileExtension</source_model>
|
564 |
+
<sort_order>10</sort_order>
|
565 |
+
<show_in_default>1</show_in_default>
|
566 |
+
<show_in_website>1</show_in_website>
|
567 |
+
<show_in_store>1</show_in_store>
|
568 |
+
</file_extension>
|
569 |
+
<file_charset translate="label">
|
570 |
+
<label>File Charset</label>
|
571 |
+
<frontend_type>select</frontend_type>
|
572 |
+
<source_model>chronorelais/config_source_fileCharset</source_model>
|
573 |
+
<sort_order>20</sort_order>
|
574 |
+
<show_in_default>1</show_in_default>
|
575 |
+
<show_in_website>1</show_in_website>
|
576 |
+
<show_in_store>1</show_in_store>
|
577 |
+
</file_charset>
|
578 |
+
<endofline_character translate="label">
|
579 |
+
<label>End Of Line Character</label>
|
580 |
+
<frontend_type>select</frontend_type>
|
581 |
+
<source_model>chronorelais/config_source_endOfLineCharacter</source_model>
|
582 |
+
<sort_order>30</sort_order>
|
583 |
+
<show_in_default>1</show_in_default>
|
584 |
+
<show_in_website>1</show_in_website>
|
585 |
+
<show_in_store>1</show_in_store>
|
586 |
+
</endofline_character>
|
587 |
+
<field_delimiter translate="label">
|
588 |
+
<label>Field Delimiter</label>
|
589 |
+
<frontend_type>select</frontend_type>
|
590 |
+
<source_model>chronorelais/config_source_fieldDelimiter</source_model>
|
591 |
+
<sort_order>40</sort_order>
|
592 |
+
<show_in_default>1</show_in_default>
|
593 |
+
<show_in_website>1</show_in_website>
|
594 |
+
<show_in_store>1</show_in_store>
|
595 |
+
</field_delimiter>
|
596 |
+
<field_separator translate="label">
|
597 |
+
<label>Field Separator</label>
|
598 |
+
<frontend_type>select</frontend_type>
|
599 |
+
<source_model>chronorelais/config_source_fieldSeparator</source_model>
|
600 |
+
<sort_order>50</sort_order>
|
601 |
+
<show_in_default>1</show_in_default>
|
602 |
+
<show_in_website>1</show_in_website>
|
603 |
+
<show_in_store>1</show_in_store>
|
604 |
+
</field_separator>
|
605 |
+
</fields>
|
606 |
+
</export_css>
|
607 |
+
<export_cso translate="label">
|
608 |
+
<label>Export Configuration CSO</label>
|
609 |
+
<frontend_type>text</frontend_type>
|
610 |
+
<sort_order>21</sort_order>
|
611 |
+
<show_in_default>1</show_in_default>
|
612 |
+
<show_in_website>1</show_in_website>
|
613 |
+
<show_in_store>1</show_in_store>
|
614 |
+
<fields>
|
615 |
+
<file_extension translate="label">
|
616 |
+
<label>File Extension</label>
|
617 |
+
<frontend_type>select</frontend_type>
|
618 |
+
<source_model>chronorelais/config_source_fileExtension</source_model>
|
619 |
+
<sort_order>10</sort_order>
|
620 |
+
<show_in_default>1</show_in_default>
|
621 |
+
<show_in_website>1</show_in_website>
|
622 |
+
<show_in_store>1</show_in_store>
|
623 |
+
</file_extension>
|
624 |
+
<file_charset translate="label">
|
625 |
+
<label>File Charset</label>
|
626 |
+
<frontend_type>select</frontend_type>
|
627 |
+
<source_model>chronorelais/config_source_fileCharset</source_model>
|
628 |
+
<sort_order>20</sort_order>
|
629 |
+
<show_in_default>1</show_in_default>
|
630 |
+
<show_in_website>1</show_in_website>
|
631 |
+
<show_in_store>1</show_in_store>
|
632 |
+
</file_charset>
|
633 |
+
<endofline_character translate="label">
|
634 |
+
<label>End Of Line Character</label>
|
635 |
+
<frontend_type>select</frontend_type>
|
636 |
+
<source_model>chronorelais/config_source_endOfLineCharacter</source_model>
|
637 |
+
<sort_order>30</sort_order>
|
638 |
+
<show_in_default>1</show_in_default>
|
639 |
+
<show_in_website>1</show_in_website>
|
640 |
+
<show_in_store>1</show_in_store>
|
641 |
+
</endofline_character>
|
642 |
+
<field_delimiter translate="label">
|
643 |
+
<label>Field Delimiter</label>
|
644 |
+
<frontend_type>select</frontend_type>
|
645 |
+
<source_model>chronorelais/config_source_fieldDelimiter</source_model>
|
646 |
+
<sort_order>40</sort_order>
|
647 |
+
<show_in_default>1</show_in_default>
|
648 |
+
<show_in_website>1</show_in_website>
|
649 |
+
<show_in_store>1</show_in_store>
|
650 |
+
</field_delimiter>
|
651 |
+
<field_separator translate="label">
|
652 |
+
<label>Field Separator</label>
|
653 |
+
<frontend_type>select</frontend_type>
|
654 |
+
<source_model>chronorelais/config_source_fieldSeparator</source_model>
|
655 |
+
<sort_order>50</sort_order>
|
656 |
+
<show_in_default>1</show_in_default>
|
657 |
+
<show_in_website>1</show_in_website>
|
658 |
+
<show_in_store>1</show_in_store>
|
659 |
+
</field_separator>
|
660 |
+
</fields>
|
661 |
+
</export_cso>
|
662 |
+
<import translate="label">
|
663 |
+
<label>Import Configuration</label>
|
664 |
+
<frontend_type>text</frontend_type>
|
665 |
+
<sort_order>30</sort_order>
|
666 |
+
<show_in_default>1</show_in_default>
|
667 |
+
<show_in_website>1</show_in_website>
|
668 |
+
<show_in_store>1</show_in_store>
|
669 |
+
<fields>
|
670 |
+
<default_tracking_title translate="label comment">
|
671 |
+
<label>Default Tracking Title</label>
|
672 |
+
<frontend_type>text</frontend_type>
|
673 |
+
<sort_order>10</sort_order>
|
674 |
+
<show_in_default>1</show_in_default>
|
675 |
+
<show_in_website>1</show_in_website>
|
676 |
+
<show_in_store>1</show_in_store>
|
677 |
+
<comment>This value can be changed in the import form</comment>
|
678 |
+
</default_tracking_title>
|
679 |
+
<send_email translate="label comment">
|
680 |
+
<label>Send an e-mail</label>
|
681 |
+
<frontend_type>select</frontend_type>
|
682 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
683 |
+
<sort_order>20</sort_order>
|
684 |
+
<show_in_default>1</show_in_default>
|
685 |
+
<show_in_website>1</show_in_website>
|
686 |
+
<show_in_store>1</show_in_store>
|
687 |
+
<comment>Send shipping confirmation to the customer</comment>
|
688 |
+
</send_email>
|
689 |
+
<shipping_comment translate="label comment">
|
690 |
+
<label>Shipping Comment</label>
|
691 |
+
<frontend_type>text</frontend_type>
|
692 |
+
<sort_order>30</sort_order>
|
693 |
+
<show_in_default>1</show_in_default>
|
694 |
+
<show_in_website>1</show_in_website>
|
695 |
+
<show_in_store>1</show_in_store>
|
696 |
+
<comment>Internal comment, can be left empty</comment>
|
697 |
+
</shipping_comment>
|
698 |
+
<include_comment translate="label comment">
|
699 |
+
<label>Include comment into e-mail</label>
|
700 |
+
<frontend_type>select</frontend_type>
|
701 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
702 |
+
<sort_order>40</sort_order>
|
703 |
+
<show_in_default>1</show_in_default>
|
704 |
+
<show_in_website>1</show_in_website>
|
705 |
+
<show_in_store>1</show_in_store>
|
706 |
+
<comment>Only applies if the shipping comment is set</comment>
|
707 |
+
</include_comment>
|
708 |
+
</fields>
|
709 |
+
</import>
|
710 |
+
|
711 |
+
<shipperinformation translate="label">
|
712 |
+
<label>Shipper Information for Labels printing</label>
|
713 |
+
<frontend_type>text</frontend_type>
|
714 |
+
<sort_order>40</sort_order>
|
715 |
+
<show_in_default>1</show_in_default>
|
716 |
+
<show_in_website>1</show_in_website>
|
717 |
+
<show_in_store>1</show_in_store>
|
718 |
+
<fields>
|
719 |
+
<civility translate="label">
|
720 |
+
<label>Shipper Civility</label>
|
721 |
+
<frontend_type>select</frontend_type>
|
722 |
+
<source_model>chronorelais/config_source_civility</source_model>
|
723 |
+
<sort_order>10</sort_order>
|
724 |
+
<show_in_default>1</show_in_default>
|
725 |
+
<show_in_website>1</show_in_website>
|
726 |
+
<show_in_store>1</show_in_store>
|
727 |
+
</civility>
|
728 |
+
<name translate="label comment">
|
729 |
+
<label>Shipper Name</label>
|
730 |
+
<frontend_type>text</frontend_type>
|
731 |
+
<sort_order>20</sort_order>
|
732 |
+
<show_in_default>1</show_in_default>
|
733 |
+
<show_in_website>1</show_in_website>
|
734 |
+
<show_in_store>1</show_in_store>
|
735 |
+
<comment>Company name</comment>
|
736 |
+
</name>
|
737 |
+
<name2 translate="label comment">
|
738 |
+
<label>Shipper Name2</label>
|
739 |
+
<frontend_type>text</frontend_type>
|
740 |
+
<sort_order>30</sort_order>
|
741 |
+
<show_in_default>1</show_in_default>
|
742 |
+
<show_in_website>1</show_in_website>
|
743 |
+
<show_in_store>1</show_in_store>
|
744 |
+
<comment>[Optional]</comment>
|
745 |
+
</name2>
|
746 |
+
<address1 translate="label">
|
747 |
+
<label>Shipper Address1</label>
|
748 |
+
<frontend_type>text</frontend_type>
|
749 |
+
<sort_order>40</sort_order>
|
750 |
+
<show_in_default>1</show_in_default>
|
751 |
+
<show_in_website>1</show_in_website>
|
752 |
+
<show_in_store>1</show_in_store>
|
753 |
+
</address1>
|
754 |
+
<address2 translate="label comment">
|
755 |
+
<label>Shipper Address2</label>
|
756 |
+
<frontend_type>text</frontend_type>
|
757 |
+
<sort_order>50</sort_order>
|
758 |
+
<show_in_default>1</show_in_default>
|
759 |
+
<show_in_website>1</show_in_website>
|
760 |
+
<show_in_store>1</show_in_store>
|
761 |
+
<comment>[Optional]</comment>
|
762 |
+
</address2>
|
763 |
+
<zipcode translate="label">
|
764 |
+
<label>Shipper Zipcode</label>
|
765 |
+
<frontend_type>text</frontend_type>
|
766 |
+
<sort_order>60</sort_order>
|
767 |
+
<show_in_default>1</show_in_default>
|
768 |
+
<show_in_website>1</show_in_website>
|
769 |
+
<show_in_store>1</show_in_store>
|
770 |
+
</zipcode>
|
771 |
+
<city translate="label">
|
772 |
+
<label>Shipper City</label>
|
773 |
+
<frontend_type>text</frontend_type>
|
774 |
+
<sort_order>70</sort_order>
|
775 |
+
<show_in_default>1</show_in_default>
|
776 |
+
<show_in_website>1</show_in_website>
|
777 |
+
<show_in_store>1</show_in_store>
|
778 |
+
</city>
|
779 |
+
<country translate="label">
|
780 |
+
<label>Shipper Country</label>
|
781 |
+
<frontend_type>select</frontend_type>
|
782 |
+
<sort_order>80</sort_order>
|
783 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
784 |
+
<show_in_default>1</show_in_default>
|
785 |
+
<show_in_website>1</show_in_website>
|
786 |
+
<show_in_store>1</show_in_store>
|
787 |
+
</country>
|
788 |
+
<contactname translate="label">
|
789 |
+
<label>Shipper Contact Name</label>
|
790 |
+
<frontend_type>text</frontend_type>
|
791 |
+
<sort_order>90</sort_order>
|
792 |
+
<show_in_default>1</show_in_default>
|
793 |
+
<show_in_website>1</show_in_website>
|
794 |
+
<show_in_store>1</show_in_store>
|
795 |
+
</contactname>
|
796 |
+
<email translate="label">
|
797 |
+
<label>Shipper Email</label>
|
798 |
+
<frontend_type>text</frontend_type>
|
799 |
+
<sort_order>100</sort_order>
|
800 |
+
<show_in_default>1</show_in_default>
|
801 |
+
<show_in_website>1</show_in_website>
|
802 |
+
<show_in_store>1</show_in_store>
|
803 |
+
<comment>[Optional]</comment>
|
804 |
+
</email>
|
805 |
+
<phone translate="label comment">
|
806 |
+
<label>Shipper Telephone</label>
|
807 |
+
<frontend_type>text</frontend_type>
|
808 |
+
<sort_order>110</sort_order>
|
809 |
+
<show_in_default>1</show_in_default>
|
810 |
+
<show_in_website>1</show_in_website>
|
811 |
+
<show_in_store>1</show_in_store>
|
812 |
+
<comment>[Optional]</comment>
|
813 |
+
</phone>
|
814 |
+
<mobilephone translate="label comment">
|
815 |
+
<label>Shipper Mobile</label>
|
816 |
+
<frontend_type>text</frontend_type>
|
817 |
+
<sort_order>120</sort_order>
|
818 |
+
<show_in_default>1</show_in_default>
|
819 |
+
<show_in_website>1</show_in_website>
|
820 |
+
<show_in_store>1</show_in_store>
|
821 |
+
<comment>[Optional]</comment>
|
822 |
+
</mobilephone>
|
823 |
+
</fields>
|
824 |
+
</shipperinformation>
|
825 |
+
|
826 |
+
<customerinformation translate="label">
|
827 |
+
<label>Chronopost Customer Account Information for Labels printing</label>
|
828 |
+
<frontend_type>text</frontend_type>
|
829 |
+
<sort_order>50</sort_order>
|
830 |
+
<show_in_default>1</show_in_default>
|
831 |
+
<show_in_website>1</show_in_website>
|
832 |
+
<show_in_store>1</show_in_store>
|
833 |
+
<fields>
|
834 |
+
<civility translate="label">
|
835 |
+
<label>Customer Civility</label>
|
836 |
+
<frontend_type>select</frontend_type>
|
837 |
+
<source_model>chronorelais/config_source_civility</source_model>
|
838 |
+
<sort_order>10</sort_order>
|
839 |
+
<show_in_default>1</show_in_default>
|
840 |
+
<show_in_website>1</show_in_website>
|
841 |
+
<show_in_store>1</show_in_store>
|
842 |
+
</civility>
|
843 |
+
<name translate="label comment">
|
844 |
+
<label>Customer Name </label>
|
845 |
+
<frontend_type>text</frontend_type>
|
846 |
+
<sort_order>20</sort_order>
|
847 |
+
<show_in_default>1</show_in_default>
|
848 |
+
<show_in_website>1</show_in_website>
|
849 |
+
<show_in_store>1</show_in_store>
|
850 |
+
<comment>Company name</comment>
|
851 |
+
</name>
|
852 |
+
<name2 translate="label comment">
|
853 |
+
<label>Customer Name2</label>
|
854 |
+
<frontend_type>text</frontend_type>
|
855 |
+
<sort_order>30</sort_order>
|
856 |
+
<show_in_default>1</show_in_default>
|
857 |
+
<show_in_website>1</show_in_website>
|
858 |
+
<show_in_store>1</show_in_store>
|
859 |
+
<comment>[Optional]</comment>
|
860 |
+
</name2>
|
861 |
+
<address1 translate="label">
|
862 |
+
<label>Customer Address1</label>
|
863 |
+
<frontend_type>text</frontend_type>
|
864 |
+
<sort_order>40</sort_order>
|
865 |
+
<show_in_default>1</show_in_default>
|
866 |
+
<show_in_website>1</show_in_website>
|
867 |
+
<show_in_store>1</show_in_store>
|
868 |
+
</address1>
|
869 |
+
<address2 translate="label comment">
|
870 |
+
<label>Customer Address2</label>
|
871 |
+
<frontend_type>text</frontend_type>
|
872 |
+
<sort_order>50</sort_order>
|
873 |
+
<show_in_default>1</show_in_default>
|
874 |
+
<show_in_website>1</show_in_website>
|
875 |
+
<show_in_store>1</show_in_store>
|
876 |
+
<comment>[Optional]</comment>
|
877 |
+
</address2>
|
878 |
+
<zipcode translate="label">
|
879 |
+
<label>Customer Zipcode</label>
|
880 |
+
<frontend_type>text</frontend_type>
|
881 |
+
<sort_order>60</sort_order>
|
882 |
+
<show_in_default>1</show_in_default>
|
883 |
+
<show_in_website>1</show_in_website>
|
884 |
+
<show_in_store>1</show_in_store>
|
885 |
+
</zipcode>
|
886 |
+
<city translate="label">
|
887 |
+
<label>Customer City</label>
|
888 |
+
<frontend_type>text</frontend_type>
|
889 |
+
<sort_order>70</sort_order>
|
890 |
+
<show_in_default>1</show_in_default>
|
891 |
+
<show_in_website>1</show_in_website>
|
892 |
+
<show_in_store>1</show_in_store>
|
893 |
+
</city>
|
894 |
+
<country translate="label">
|
895 |
+
<label>Customer Country</label>
|
896 |
+
<frontend_type>select</frontend_type>
|
897 |
+
<sort_order>80</sort_order>
|
898 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
899 |
+
<show_in_default>1</show_in_default>
|
900 |
+
<show_in_website>1</show_in_website>
|
901 |
+
<show_in_store>1</show_in_store>
|
902 |
+
</country>
|
903 |
+
<contactname translate="label">
|
904 |
+
<label>Customer Contact Name</label>
|
905 |
+
<frontend_type>text</frontend_type>
|
906 |
+
<sort_order>90</sort_order>
|
907 |
+
<show_in_default>1</show_in_default>
|
908 |
+
<show_in_website>1</show_in_website>
|
909 |
+
<show_in_store>1</show_in_store>
|
910 |
+
</contactname>
|
911 |
+
<email translate="label">
|
912 |
+
<label>Customer Email</label>
|
913 |
+
<frontend_type>text</frontend_type>
|
914 |
+
<sort_order>100</sort_order>
|
915 |
+
<show_in_default>1</show_in_default>
|
916 |
+
<show_in_website>1</show_in_website>
|
917 |
+
<show_in_store>1</show_in_store>
|
918 |
+
<comment>[Optional]</comment>
|
919 |
+
</email>
|
920 |
+
<phone translate="label comment">
|
921 |
+
<label>Customer Telephone</label>
|
922 |
+
<frontend_type>text</frontend_type>
|
923 |
+
<sort_order>110</sort_order>
|
924 |
+
<show_in_default>1</show_in_default>
|
925 |
+
<show_in_website>1</show_in_website>
|
926 |
+
<show_in_store>1</show_in_store>
|
927 |
+
<comment>[Optional]</comment>
|
928 |
+
</phone>
|
929 |
+
<mobilephone translate="label comment">
|
930 |
+
<label>Customer Mobile</label>
|
931 |
+
<frontend_type>text</frontend_type>
|
932 |
+
<sort_order>120</sort_order>
|
933 |
+
<show_in_default>1</show_in_default>
|
934 |
+
<show_in_website>1</show_in_website>
|
935 |
+
<show_in_store>1</show_in_store>
|
936 |
+
<comment>[Optional]</comment>
|
937 |
+
</mobilephone>
|
938 |
+
</fields>
|
939 |
+
</customerinformation>
|
940 |
+
|
941 |
+
<skybillparam translate="label">
|
942 |
+
<label>Skybill Parameters for Labels printing</label>
|
943 |
+
<frontend_type>text</frontend_type>
|
944 |
+
<sort_order>60</sort_order>
|
945 |
+
<show_in_default>1</show_in_default>
|
946 |
+
<show_in_website>1</show_in_website>
|
947 |
+
<show_in_store>1</show_in_store>
|
948 |
+
<fields>
|
949 |
+
<mode translate="label">
|
950 |
+
<label>Print Mode</label>
|
951 |
+
<frontend_type>select</frontend_type>
|
952 |
+
<source_model>chronorelais/config_source_printMode</source_model>
|
953 |
+
<sort_order>10</sort_order>
|
954 |
+
<show_in_default>1</show_in_default>
|
955 |
+
<show_in_website>1</show_in_website>
|
956 |
+
<show_in_store>1</show_in_store>
|
957 |
+
<required>1</required>
|
958 |
+
</mode>
|
959 |
+
</fields>
|
960 |
+
</skybillparam>
|
961 |
+
</groups>
|
962 |
+
</chronorelais>
|
963 |
+
</sections>
|
964 |
+
|
965 |
</config>
|
app/design/frontend/default/default/layout/chronorelais.xml
CHANGED
@@ -1,44 +1,60 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
<default>
|
4 |
-
<reference name="head">
|
5 |
-
<action method="addItem"><type>skin_css</type><name>chronorelais/chronorelais.css</name></action>
|
6 |
-
</reference>
|
7 |
-
</default>
|
8 |
-
|
9 |
-
<checkout_onepage_index>
|
10 |
-
<reference name="checkout.onepage.shipping_method">
|
11 |
-
<action method="setTemplate"><template>chronorelais/checkout/onepage/shipping_method.phtml</template></action>
|
12 |
-
<block type="checkout/onepage_shipping_method_available" name="checkout.onepage.shipping_method.available" as="available" template="chronorelais/checkout/onepage/shipping_method/available.phtml">
|
13 |
-
<block type="chronorelais/checkout_onepage_shipping_method_chronorelais" name="checkout.onepage.shipping_method.chronorelais" as="relaislist" template="chronorelais/checkout/onepage/shipping_method/chronorelais.phtml"/>
|
14 |
-
</block>
|
15 |
-
</reference>
|
16 |
-
</checkout_onepage_index>
|
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 |
</layout>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addItem"><type>skin_css</type><name>chronorelais/chronorelais.css</name></action>
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
|
9 |
+
<checkout_onepage_index>
|
10 |
+
<reference name="checkout.onepage.shipping_method">
|
11 |
+
<action method="setTemplate"><template>chronorelais/checkout/onepage/shipping_method.phtml</template></action>
|
12 |
+
<block type="checkout/onepage_shipping_method_available" name="checkout.onepage.shipping_method.available" as="available" template="chronorelais/checkout/onepage/shipping_method/available.phtml">
|
13 |
+
<block type="chronorelais/checkout_onepage_shipping_method_chronorelais" name="checkout.onepage.shipping_method.chronorelais" as="relaislist" template="chronorelais/checkout/onepage/shipping_method/chronorelais.phtml"/>
|
14 |
+
</block>
|
15 |
+
</reference>
|
16 |
+
</checkout_onepage_index>
|
17 |
+
|
18 |
+
<!-- -->
|
19 |
+
<checkout_multishipping_shipping>
|
20 |
+
<update handle="checkout_multishipping"/>
|
21 |
+
<reference name="checkout_shipping">
|
22 |
+
<action method="setTemplate"><template>chronorelais/checkout/multishipping/shipping.phtml</template></action>
|
23 |
+
<block type="chronorelais/checkout_multishipping_shipping_method_chronorelais" name="checkout.multishipping.shipping_method.chronorelais" as="relaislist" template="chronorelais/checkout/multishipping/shipping_method/chronorelais.phtml"/>
|
24 |
+
</reference>
|
25 |
+
</checkout_multishipping_shipping>
|
26 |
+
<!-- -->
|
27 |
+
|
28 |
+
<checkout_onepage_shippingmethod>
|
29 |
+
<remove name="right"/>
|
30 |
+
<remove name="left"/>
|
31 |
+
<block type="checkout/onepage_shipping_method_available" name="root" output="toHtml" template="chronorelais/checkout/onepage/shipping_method/available.phtml">
|
32 |
+
<!--<block type="checkout/onepage_shipping_method_chronorelais" name="checkout.onepage.shipping_method.chronorelais" as="relaislist" template="chronorelais/checkout/onepage/shipping_method/chronorelais.phtml"/>-->
|
33 |
+
</block>
|
34 |
+
</checkout_onepage_shippingmethod>
|
35 |
+
|
36 |
+
<checkout_onepage_shippingchronorelais>
|
37 |
+
<remove name="right"/>
|
38 |
+
<remove name="left"/>
|
39 |
+
<block type="chronorelais/checkout_onepage_shipping_method_chronorelais" name="root" output="toHtml" template="chronorelais/checkout/onepage/shipping_method/chronorelais.phtml"/>
|
40 |
+
</checkout_onepage_shippingchronorelais>
|
41 |
+
|
42 |
+
<checkout_multishipping_shippingchronorelais>
|
43 |
+
<remove name="right"/>
|
44 |
+
<remove name="left"/>
|
45 |
+
<block type="chronorelais/checkout_multishipping_shipping_method_chronorelais" name="root" output="toHtml" template="chronorelais/checkout/multishipping/shipping_method/chronorelais.phtml"/>
|
46 |
+
</checkout_multishipping_shippingchronorelais>
|
47 |
+
|
48 |
+
<customer_account_index>
|
49 |
+
<reference name="customer_account_dashboard">
|
50 |
+
<block type="sales/order_recent" name="customer_account_dashboard_top" as="top" template="chronorelais/sales/order/recent.phtml"/>
|
51 |
+
</reference>
|
52 |
+
</customer_account_index>
|
53 |
+
|
54 |
+
<sales_order_history>
|
55 |
+
<reference name="sales.order.history">
|
56 |
+
<action method="setTemplate"><template>chronorelais/sales/order/history.phtml</template></action>
|
57 |
+
</reference>
|
58 |
+
</sales_order_history>
|
59 |
+
|
60 |
</layout>
|
app/design/frontend/default/default/template/chronorelais/checkout/multishipping/shipping.phtml
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* Multishipping checkout shipping template
|
30 |
+
*
|
31 |
+
* @see Mage_Checkout_Block_Multishipping_Shipping
|
32 |
+
*/
|
33 |
+
?>
|
34 |
+
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo Mage::helper('chronorelais')->getConfigurationGoogleMapAPIKey()?>" type="text/javascript"></script>
|
35 |
+
<script type="text/javascript" src="<?php echo $this->getSkinUrl('chronorelais/chronorelaismap.js') ?>"></script>
|
36 |
+
<script type="text/javascript">
|
37 |
+
//<![CDATA[
|
38 |
+
var Picto_Chrono_Relais = '<?php echo $this->getSkinUrl('chronorelais/Picto_Chrono_Relais.png')?>';
|
39 |
+
var Home_Chrono_Icon = '<?php echo $this->getSkinUrl('chronorelais/home.png')?>';
|
40 |
+
//]]>
|
41 |
+
</script>
|
42 |
+
|
43 |
+
<div class="multiple-checkout">
|
44 |
+
<div class="page-title">
|
45 |
+
<h1><?php echo $this->__('Select Shipping Method') ?></h1>
|
46 |
+
</div>
|
47 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
48 |
+
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="shipping_method_form">
|
49 |
+
<?php foreach ($this->getAddresses() as $_index => $_address): ?>
|
50 |
+
<div class="col2-set">
|
51 |
+
<h2 class="legend"><?php echo $this->__('Address %s of %s', ($_index+1), $this->getAddressCount()) ?></h2>
|
52 |
+
<div class="col-1 col-narrow">
|
53 |
+
<div class="box">
|
54 |
+
<div class="box-title">
|
55 |
+
<h3><?php echo $this->__('Shipping To') ?> <span class="separator">|</span> <a href="<?php echo $this->getAddressEditUrl($_address) ?>"><?php echo $this->__('Change') ?></a></h3>
|
56 |
+
</div>
|
57 |
+
<div class="box-content">
|
58 |
+
<address><?php echo $_address->format('html') ?></address>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
<div class="box box-sp-methods">
|
62 |
+
<div class="pointer"></div>
|
63 |
+
<div class="box-title">
|
64 |
+
<h3><?php echo $this->__('Shipping Method') ?></h3>
|
65 |
+
</div>
|
66 |
+
<div class="box-content">
|
67 |
+
<?php if (!($_shippingRateGroups = $this->getShippingRates($_address))): ?>
|
68 |
+
<p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
|
69 |
+
<?php else: ?>
|
70 |
+
<dl class="sp-methods">
|
71 |
+
<?php $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates): ?>
|
72 |
+
<dt><?php echo $this->getCarrierName($code) ?></dt>
|
73 |
+
<dd>
|
74 |
+
<ul>
|
75 |
+
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
76 |
+
<li<?php if ($_rate->getErrorMessage()) echo ' class="error-msg"' ?>>
|
77 |
+
<?php if ($_rate->getErrorMessage()): ?>
|
78 |
+
<?php echo $_rate->getCarrierTitle() ?>: <?php echo $_rate->getErrorMessage() ?>
|
79 |
+
<?php else: ?>
|
80 |
+
<?php /*if ($_sole) : ?>
|
81 |
+
<span class="no-display"><input type="radio" name="shipping_method[<?php echo $_address->getId() ?>]" value="<?php echo $this->htmlEscape($_rate->getCode()) ?>" id="s_method_<?php echo $_address->getId() ?>_<?php echo $_rate->getCode() ?>" checked="checked"/></span>
|
82 |
+
<?php else:*/ ?>
|
83 |
+
<input type="radio" name="shipping_method[<?php echo $_address->getId() ?>]" value="<?php echo $this->htmlEscape($_rate->getCode()) ?>" id="s_method_<?php echo $_address->getId() ?>_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod($_address)) echo ' checked="checked"' ?> class="radio" onclick="<?php if($code=="chronorelais"): ?>shippingMethod.getrelais('<?php echo $this->getUrl('checkout/multishipping/getMultiRelais')?>?zip=<?php echo $_address->getPostcode() ?>&index=<?php echo $_address->getId() ?>', <?php echo $_address->getId() ?>, '<?php echo $_address->getPostcode() ?> <?php echo $_address->getCity() ?>')<?php else: ?>shippingMethod.hiderelais(<?php echo $_address->getId() ?>)<?php endif; ?>" />
|
84 |
+
<?php //endif; ?>
|
85 |
+
<label for="s_method_<?php echo $_address->getId() ?>_<?php echo $_rate->getCode() ?>"><?php echo $_rate->getMethodTitle() ?>
|
86 |
+
<?php $_excl = $this->getShippingPrice($_address, $_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
87 |
+
<?php $_incl = $this->getShippingPrice($_address, $_rate->getPrice(), true); ?>
|
88 |
+
<?php echo $_excl; ?>
|
89 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
90 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
91 |
+
<?php endif; ?>
|
92 |
+
</label>
|
93 |
+
<?php endif ?>
|
94 |
+
</li>
|
95 |
+
<?php endforeach; ?>
|
96 |
+
</ul>
|
97 |
+
</dd>
|
98 |
+
<?php endforeach; ?>
|
99 |
+
</dl>
|
100 |
+
<?php endif; ?>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
<div class="col-2 col-wide">
|
105 |
+
<?php echo $this->helper('giftmessage/message')->getInline('multishipping_adress_checkbox', $_address); ?>
|
106 |
+
<h3><?php echo $this->__('Items') ?> <span class="separator">|</span> <a href="<?php echo $this->getItemsEditUrl($_address) ?>"><?php echo $this->__('Edit Items') ?></a></h3>
|
107 |
+
<table class="data-table" id="shipping-table-<?php echo $_address->getId() ?>">
|
108 |
+
<col />
|
109 |
+
<col width="1" />
|
110 |
+
<thead>
|
111 |
+
<tr>
|
112 |
+
<th><?php echo $this->__('Product Name') ?></th>
|
113 |
+
<th class="a-center"><?php echo $this->__('Qty') ?></th>
|
114 |
+
</tr>
|
115 |
+
</thead>
|
116 |
+
<tbody>
|
117 |
+
<?php foreach ($this->getAddressItems($_address) as $_item): ?>
|
118 |
+
<tr>
|
119 |
+
<td>
|
120 |
+
<?php echo $this->getItemHtml($_item->getQuoteItem()) ?>
|
121 |
+
</td>
|
122 |
+
<td class="a-center"><?php echo $_item->getQty() ?></td>
|
123 |
+
</tr>
|
124 |
+
<?php endforeach; ?>
|
125 |
+
</tbody>
|
126 |
+
</table>
|
127 |
+
<script type="text/javascript">decorateTable('shipping-table-<?php echo $_address->getId() ?>')</script>
|
128 |
+
<?php echo $this->helper('giftmessage/message')->getInline('multishipping_adress', $_address); ?>
|
129 |
+
</div>
|
130 |
+
|
131 |
+
<span style="display: none;" class="please-wait" id="loading-process"><img class="v-middle" title="<?php echo $this->__('Loading...')?>" alt="<?php echo $this->__('Loading...')?>" src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>"> <?php echo $this->__('Loading...')?></span>
|
132 |
+
<div id="checkout-shipping-method-chronorelais-load_<?php echo $_address->getId() ?>" class="chronorelais-list" style="clear: both;">
|
133 |
+
<?php if($this->getAddressShippingMethod($_address)=="chronorelais_chronorelais"): ?>
|
134 |
+
<?php Mage::getSingleton('core/session')->setMultiPostcode($_address->getPostcode()); ?>
|
135 |
+
<?php echo $this->getChildHtml('relaislist') ?>
|
136 |
+
<?php endif; ?>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
<?php endforeach; ?>
|
140 |
+
<?php echo $this->getChildHtml('checkout_billing_items') ?>
|
141 |
+
<div class="buttons-set">
|
142 |
+
<p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>« </small><?php echo $this->__('Back to Select Addresses') ?></a></p>
|
143 |
+
<button type="submit" title="<?php echo $this->__('Continue to Billing Information') ?>" class="button"><span><span><?php echo $this->__('Continue to Billing Information') ?></span></span></button>
|
144 |
+
</div>
|
145 |
+
</form>
|
146 |
+
|
147 |
+
<script type="text/javascript">
|
148 |
+
//<![CDATA[
|
149 |
+
var shippingMethod = new MultiShippingMethod();
|
150 |
+
//]]>
|
151 |
+
</script>
|
152 |
+
</div>
|
app/design/frontend/default/default/template/chronorelais/checkout/multishipping/shipping_method/chronorelais.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if(count($this->getChronorelais())>0): ?>
|
2 |
+
<?php
|
3 |
+
$postcode = Mage::getSingleton('core/session')->getMultiPostcode();
|
4 |
+
?>
|
5 |
+
<div class="chronorelaismap">
|
6 |
+
<div class="mappostalcode">
|
7 |
+
<form id="mappostalcodeform_%%id%%" onsubmit="return false;" action="#">
|
8 |
+
<input type="text" name="mappostalcode[%%id%%]" id="mappostalcode_%%id%%" value="<?php echo $postcode ?>" class="input-text" onkeyup="if (event.keyCode == 13) shippingMethod.changePostalCode('<?php echo $this->getUrl('checkout/multishipping/getMultiRelais')?>?index=%%id%%', %%id%%)" />
|
9 |
+
<button onclick="shippingMethod.changePostalCode('<?php echo $this->getUrl('checkout/multishipping/getMultiRelais')?>?index=%%id%%', %%id%%);" id="mappostalcodebtn_%%id%%" class="button" type="button"><span><span><?php echo $this->__('Changer mon code postal')?></span></span></button>
|
10 |
+
<span style="display: none;" class="please-wait" id="postalcode-please-wait_%%id%%"><img class="v-middle" title="<?php echo $this->__('Loading map...')?>" alt="<?php echo $this->__('Loading map...')?>" src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>"> <?php echo $this->__('Loading map...')?></span>
|
11 |
+
</form>
|
12 |
+
</div>
|
13 |
+
<div id="chronomap_%%id%%" class="chronomap"></div>
|
14 |
+
</div>
|
15 |
+
<p style="margin: 0;"><?php echo $this->__('Veuillez choisir parmi les 5 relais Pickup affichés ci-dessous celui qui servira d\'adresse de livraison.')?></p>
|
16 |
+
<dl class="sp-methods-chronorelais">
|
17 |
+
<dt><?php echo $this->__('Chronorelay points')?></dt>
|
18 |
+
<dd>
|
19 |
+
<ul>
|
20 |
+
<?php foreach($this->getChronorelais() as $key=>$chronorelais): ?>
|
21 |
+
<li>
|
22 |
+
<input name="shipping_method_chronorelais[%%id%%]" type="radio" value="<?php echo $chronorelais->identifiantChronopostPointA2PAS;?>" id="s_method_chronorelais_%%id%%_<?php echo $chronorelais->identifiantChronopostPointA2PAS;?>" class="radio" onclick="loadMyPoint('<?php echo $chronorelais->identifiantChronopostPointA2PAS;//$key?>')" />
|
23 |
+
<label for="s_method_chronorelais_%%id%%_<?php echo $chronorelais->identifiantChronopostPointA2PAS;?>"><?php echo $chronorelais->nomEnseigne.' - '.$chronorelais->adresse1.' - '.$chronorelais->codePostal.' - '.$chronorelais->localite;?></label>
|
24 |
+
</li>
|
25 |
+
<?php endforeach; ?>
|
26 |
+
</ul>
|
27 |
+
</dd>
|
28 |
+
</dl>
|
29 |
+
|
30 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/chronorelais/checkout/onepage/shipping_method/chronorelais.phtml
CHANGED
@@ -1,29 +1,30 @@
|
|
1 |
-
<?php if(count($this->getChronorelais())>0): ?>
|
2 |
-
<?php
|
3 |
-
$quote = Mage::getSingleton('checkout/cart')->init()->getQuote();
|
4 |
-
$address = $quote->getShippingAddress();
|
5 |
-
$postcode = $address->getPostcode();
|
6 |
-
?>
|
7 |
-
<div class="chronorelaismap">
|
8 |
-
<div class="mappostalcode">
|
9 |
-
<input type="text" name="mappostalcode" id="mappostalcode" value="<?php echo $postcode ?>" class="input-text" onkeydown="if (event.keyCode == 13) shippingMethod.changePostalCode('<?php echo $this->getUrl('checkout/onepage/changePostalCode')?>')" />
|
10 |
-
<button onclick="shippingMethod.changePostalCode('<?php echo $this->getUrl('checkout/onepage/changePostalCode')?>');" id="mappostalcodebtn" class="button" type="button"><span><span><?php echo $this->__('Changer mon code postal')?></span></span></button>
|
11 |
-
<span style="display: none;" class="please-wait" id="postalcode-please-wait"><img class="v-middle" title="<?php echo $this->__('Loading map...')?>" alt="<?php echo $this->__('Loading map...')?>" src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>"> <?php echo $this->__('Loading map...')?></span>
|
12 |
-
</div>
|
13 |
-
<div id="chronomap"></div>
|
14 |
-
</div>
|
15 |
-
<
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
<
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
</
|
28 |
-
|
|
|
29 |
<?php endif; ?>
|
1 |
+
<?php if(count($this->getChronorelais())>0): ?>
|
2 |
+
<?php
|
3 |
+
$quote = Mage::getSingleton('checkout/cart')->init()->getQuote();
|
4 |
+
$address = $quote->getShippingAddress();
|
5 |
+
$postcode = $address->getPostcode();
|
6 |
+
?>
|
7 |
+
<div class="chronorelaismap">
|
8 |
+
<div class="mappostalcode">
|
9 |
+
<input type="text" name="mappostalcode" id="mappostalcode" value="<?php echo $postcode ?>" class="input-text" onkeydown="if (event.keyCode == 13) shippingMethod.changePostalCode('<?php echo $this->getUrl('checkout/onepage/changePostalCode')?>')" />
|
10 |
+
<button onclick="shippingMethod.changePostalCode('<?php echo $this->getUrl('checkout/onepage/changePostalCode')?>');" id="mappostalcodebtn" class="button" type="button"><span><span><?php echo $this->__('Changer mon code postal')?></span></span></button>
|
11 |
+
<span style="display: none;" class="please-wait" id="postalcode-please-wait"><img class="v-middle" title="<?php echo $this->__('Loading map...')?>" alt="<?php echo $this->__('Loading map...')?>" src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>"> <?php echo $this->__('Loading map...')?></span>
|
12 |
+
</div>
|
13 |
+
<div id="chronomap" class="chronomap"></div>
|
14 |
+
</div>
|
15 |
+
<p style="margin: 0;"><?php echo $this->__('Veuillez choisir parmi les 5 relais Pickup affichés ci-dessous celui qui servira d\'adresse de livraison.')?></p>
|
16 |
+
<dl class="sp-methods-chronorelais">
|
17 |
+
<dt><?php echo $this->__('Chronorelay points')?></dt>
|
18 |
+
<dd>
|
19 |
+
<ul>
|
20 |
+
<?php foreach($this->getChronorelais() as $key=>$chronorelais): ?>
|
21 |
+
<li>
|
22 |
+
<input name="shipping_method_chronorelais" type="radio" value="<?php echo $chronorelais->identifiantChronopostPointA2PAS;?>" id="s_method_chronorelais_<?php echo $chronorelais->identifiantChronopostPointA2PAS;?>" class="radio" onclick="loadMyPoint('<?php echo $chronorelais->identifiantChronopostPointA2PAS;//$key?>')" />
|
23 |
+
<label for="s_method_chronorelais_<?php echo $chronorelais->identifiantChronopostPointA2PAS;?>"><?php echo $chronorelais->nomEnseigne.' - '.$chronorelais->adresse1.' - '.$chronorelais->codePostal.' - '.$chronorelais->localite;?></label>
|
24 |
+
</li>
|
25 |
+
<?php endforeach; ?>
|
26 |
+
</ul>
|
27 |
+
</dd>
|
28 |
+
</dl>
|
29 |
+
|
30 |
<?php endif; ?>
|
app/locale/en_US/Chronopost_Chronorelais.csv
CHANGED
@@ -36,6 +36,7 @@
|
|
36 |
"{configuration_syntax_help}","<a href='http://www.magentocommerce.com/boards/viewthread/37860/' target='_blank'>Help</a>"
|
37 |
"{debug_help}","0 = none, 1 = minimum, 10 = full"
|
38 |
"{logo_ulr_help}","Upload the logo image to the given skin folder. skin/frontend/[your package name]/[your skin name]/chronorelais/"
|
|
|
39 |
|
40 |
"Tracking URL","Tracking URL"
|
41 |
"Debug","Debug"
|
36 |
"{configuration_syntax_help}","<a href='http://www.magentocommerce.com/boards/viewthread/37860/' target='_blank'>Help</a>"
|
37 |
"{debug_help}","0 = none, 1 = minimum, 10 = full"
|
38 |
"{logo_ulr_help}","Upload the logo image to the given skin folder. skin/frontend/[your package name]/[your skin name]/chronorelais/"
|
39 |
+
"No : cost is obtained from your rate grid ; Yes : cost is fetched from URL below";"No : cost is obtained from your rate grid ; Yes : cost is fetched from URL below"
|
40 |
|
41 |
"Tracking URL","Tracking URL"
|
42 |
"Debug","Debug"
|
app/locale/fr_FR/Chronopost_Chronorelais.csv
CHANGED
@@ -36,6 +36,7 @@
|
|
36 |
"{configuration_syntax_help}","<a href='http://www.magentocommerce.com/boards/viewthread/37860/' target='_blank'>Aide</a>"
|
37 |
"{debug_help}","0 = aucun, 1 = minimum, 10 = complet"
|
38 |
"{logo_ulr_help}","Upload the logo image to the given skin folder. skin/frontend/[your package name]/[your skin name]/chronorelais/"
|
|
|
39 |
|
40 |
"Tracking URL","URL de suivi"
|
41 |
"Debug","Debug"
|
36 |
"{configuration_syntax_help}","<a href='http://www.magentocommerce.com/boards/viewthread/37860/' target='_blank'>Aide</a>"
|
37 |
"{debug_help}","0 = aucun, 1 = minimum, 10 = complet"
|
38 |
"{logo_ulr_help}","Upload the logo image to the given skin folder. skin/frontend/[your package name]/[your skin name]/chronorelais/"
|
39 |
+
"No : cost is obtained from your rate grid ; Yes : cost is fetched from URL below";"Non : le prix est calculé grâce à votre grille tarifaire ; Oui : le prix est calculé via le webservice ci-dessous"
|
40 |
|
41 |
"Tracking URL","URL de suivi"
|
42 |
"Debug","Debug"
|
package.xml
CHANGED
@@ -1,37 +1,43 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Chronopost</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Cette extension officielle permet de proposer à vos clients le mode de livraison Chronopost</summary>
|
10 |
-
<description>Chronopost offre le choix parmi 2 solutions de livraison en France et 1 à l
|
11 |
-
|
12 |
-
Chronopost livraison Express à domicile. Colis livré le lendemain avant 13h à l
|
13 |
-
Chrono Relais, colis disponible le lendemain à partir de 13h dans l
|
14 |
-
Chrono Express : livraison express partout dans le monde. L
|
15 |
-
|
16 |
-
Afin de vous accompagner dans le développement des sites e-marchands sur la plateforme Magento, vous trouverez dans le module Chronopost un package de solutions
|
17 |
-
|
18 |
-
La géolocalisation des points Chrono Relais
|
19 |
-
Le calcul du coût du transport (via logiciel QuickCost)
|
20 |
-
Le suivi intégré&#
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
29 |
Ce module est dévellopé à partir de l'extension Owebia Shipping 2</description>
|
30 |
-
<notes>
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
35 |
<compatible/>
|
36 |
-
<dependencies
|
37 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Chronopost</name>
|
4 |
+
<version>0.2.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Cette extension officielle permet de proposer à vos clients le mode de livraison Chronopost</summary>
|
10 |
+
<description>Chronopost offre le choix parmi 2 solutions de livraison en France et 1 à l'international pour toutes vos commandes en ligne :
|
11 |
+

|
12 |
+
Chronopost livraison Express à domicile. Colis livré le lendemain avant 13h à l'adresse de votre choix
|
13 |
+
Chrono Relais, colis disponible le lendemain à partir de 13h dans l'un de 3500 points Chrono Relais de votre choix
|
14 |
+
Chrono Express : livraison express partout dans le monde. L'Europe livrée en 1 à 3 jours et le reste du monde en 3 à 5 jours.
|
15 |
+

|
16 |
+
Afin de vous accompagner dans le développement des sites e-marchands sur la plateforme Magento, vous trouverez dans le module Chronopost un package de solutions :
|
17 |
+

|
18 |
+
La géolocalisation des points Chrono Relais
|
19 |
+
Le calcul du coût du transport (via logiciel QuickCost)
|
20 |
+
Le suivi intégré
|
21 |
+
Le choix entre 3 solutions possibles d'étiquetage des envois selon les besoins de l'e-commerçant
|
22 |
+
Testé et validé sur Magento 1.6.2
|
23 |
+

|
24 |
+
--> Un manuel d'installation est à votre disposition dans la partie 'Docs' afin de vous guider dans l'installation du module. (A lire impérativement)
|
25 |
+

|
26 |
+
ATTENTION : Pour toute mise en production du module Chronopost, un contrat avec Chronopost est nécessaire. Si vous n'avez pas de contrat merci de prendre contact à l'adresse suivante : mychrono@chronopost.fr
|
27 |
+

|
28 |
+
Réalisation Adexos
|
29 |
+

|
30 |
Ce module est dévellopé à partir de l'extension Owebia Shipping 2</description>
|
31 |
+
<notes>Version destinée à Magento 1.6.X et supérieures
|
32 |
+
------------
|
33 |
+
Support du multi-shipping.
|
34 |
+
Correction sur le filtrage des commandes pour l'export.
|
35 |
+
Correction du nom de point relais manquant dans les exports.
|
36 |
+
Modification de libellé en admin pour explication du Quickcost.</notes>
|
37 |
+
<authors><author><name>Benjamin GOSSELET</name><user>Chronopost</user><email>bgosselet@adexos.fr</email></author></authors>
|
38 |
+
<date>2012-05-11</date>
|
39 |
+
<time>14:22:43</time>
|
40 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="chronorelais"><dir name="import"><file name="form.phtml" hash="356aadf2bb0182b23f7af38888a0cd38"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="chronorelais.xml" hash="a298640a9d7a9d5c9ad90b81801d0584"/></dir><dir name="template"><dir name="chronorelais"><dir name="checkout"><dir name="multishipping"><file name="shipping.phtml" hash="89ac65c42722975ec8b872a1e69b5ae9"/><dir name="shipping_method"><file name="chronorelais.phtml" hash="f184ce28e619c185434810545bc82d9f"/></dir></dir><dir name="onepage"><dir name="shipping_method"><file name="available.phtml" hash="7377a159a92db28c30f86ad52921a5b0"/><file name="chronorelais.phtml" hash="4d9d318e0add0ff4a70155541180654a"/></dir><file name="shipping_method.phtml" hash="4f084424b6dcdb187753f09357f46898"/></dir></dir><dir name="sales"><dir name="order"><file name="history.phtml" hash="f95a1860a4cf463f6fca48273cc45eaf"/><file name="recent.phtml" hash="8045fbbe75510efc55da31455d2cc47a"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Chronopost"><dir name="Chronorelais"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Config.php" hash="b38741ddd97fcae5dd276239fb3c6b70"/></dir></dir></dir></dir></dir><dir name="Checkout"><dir name="Multishipping"><dir name="Shipping"><dir name="Method"><file name="Chronorelais.php" hash="a095d54809c9ad04453758635879127e"/></dir></dir></dir><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Chronorelais.php" hash="c4d908310310e4cd90833378df260599"/></dir></dir></dir></dir><file name="Detail.php" hash="005fa3b6e5918c6c9779402fab5713f2"/><dir name="Export"><dir name="Orders"><file name="Grid.php" hash="bec368bcf626b7c7665a3f042be17905"/></dir><file name="Orders.php" hash="9ada10bd85cb58122e722b3e82c71e37"/></dir><file name="Filter.php" hash="28f80e3ab34f6ff03b61f070ccbac697"/><dir name="Import"><file name="Form.php" hash="56c6e3787c05e58d57b48ec4b1421468"/></dir><dir name="Sales"><file name="Impression.php" hash="619599b136b9cc49f01dba5b08ee8428"/><dir name="Order"><dir name="Shipment"><file name="View.php" hash="f5407d7d14aa59acb844479da5046900"/></dir></dir><dir name="Shipment"><file name="Grid.php" hash="06928b811ee8d71e5e1fdcc0814ff9e0"/></dir></dir></dir><dir name="Controller"><file name="Abstract.php" hash="94680cd88c6af59764dedb613b08d5f6"/></dir><dir name="Helper"><file name="Data.php" hash="70531f8f903a63986c063f65553d643d"/></dir><dir name="Model"><dir name="Carrier"><file name="AbstractChronorelais.php" hash="f4957f6d660c4adb0328f9f2d73da1e2"/><file name="AbstractChronorelaisShipping.php" hash="1adab13f3659559803b338ad86205d43"/><file name="Chronoexpress.php" hash="bc867a6b98966ada549a0b81ec334b64"/><file name="Chronopost.php" hash="c4d4525447d2801d28d921eaedc35a9a"/><file name="Chronorelais.php" hash="5cfcb83c23d05585fdc50f8b2747fc40"/></dir><dir name="Config"><dir name="Source"><file name="Civility.php" hash="fe6ec6eebe6faffdd0bb65479d91cd5d"/><file name="EndOfLineCharacter.php" hash="3fe6b6069a9efdc29ad0d3f7d1cf4794"/><file name="FieldDelimiter.php" hash="3e023d40aeca50932e62ff97eed6317e"/><file name="FieldSeparator.php" hash="ce30c5974a893bd5467334d574dd578a"/><file name="FileCharset.php" hash="6cc4ebab95735bd121af16e0eedd90d6"/><file name="FileExtension.php" hash="597c3e78e7584bf7c4b7b2ebad6d2a65"/><file name="PrintMode.php" hash="67e8a6e98e12c7e72624ba5322076c00"/></dir></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Shipping.php" hash="2e69db363011f84ef2cdb5d0e9d4c4df"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="1905b32a1366d3c27277836364737e98"/><dir name="Checkout"><file name="MultishippingController.php" hash="c44aa875ba9683e1d6311390c4e77080"/><file name="OnepageController.php" hash="6986dd92fff2085260d011234fc298f6"/></dir><file name="ExportController.php" hash="9a24df876d6d7c48df53d99ff5498d6b"/><file name="ImportController.php" hash="7cce42f41a838e1cb3e220742020eeff"/><file name="RelaisController.php" hash="5d48155ddb7cc2d4effbbfdeb4f3946d"/><dir name="Sales"><file name="ImpressionController.php" hash="7b040384c03fec329f66ec0afb2d4d44"/><dir name="Order"><file name="ShipmentController.php" hash="992c53ee433323ef9fb1c0f101c54ea3"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="8a9bc798220b1a454bef20bddcee2dd2"/><file name="system.xml" hash="1eb275cce36bcc0c8322f3f95fd5deb1"/></dir><dir name="includes"><file name="ChronorelaisShippingHelper.php" hash="9a3aa6bb5b3846102d78450d76c93fdf"/><file name="countries.inc.php" hash="d21cd393c7c0ebc83beccc99950d6ab1"/></dir><dir name="sql"><dir name="chronorelais_setup"><file name="mysql4-install-0.1.0.php" hash="c307802a7bd10c1ecce06799b04569c2"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="ea3358055a851a96b673c721202045be"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="961f41dc1012d0917504f9bb5f5d106c"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="b85470889421f652c3d01b96072f579c"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="def69d0ae26b0d130d2ce6e0838e5d7f"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Chronopost_Chronorelais.csv" hash="76475aa4fa500c135a666e47bab62ddf"/></dir><dir name="fr_FR"><file name="Chronopost_Chronorelais.csv" hash="ebcbda74580c951df42e932aa434a33a"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="chronorelais"><file name="Picto_Chrono_Relais.png" hash="1ea0f0c410d237adf23d5905cd8431f5"/><file name="Thumbs.db" hash="2e16ed23c37d1aa29a6caf73f513a648"/><file name="ac.png" hash="0c04f70da35d43a2636cfbd6ad2b10d5"/><file name="chronopost.png" hash="93e5b22e2f280923df8d503f5c8e5b92"/><file name="chronorelais.css" hash="a1fef1934a1114be6c8f4eebde2b5263"/><file name="chronorelais.png" hash="87c42de75ddafe495dfc0248c2a688b4"/><file name="chronorelaismap.js" hash="60db33945bcaeeaf58e1a57cb3a3f23d"/><file name="home.png" hash="7904b495e94047eb3406e260bc660cce"/><file name="ico_ac_shaded.gif" hash="e55d9b2071fb976cf5331b6273a40731"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="WSChronopost_Chronorelais.xml" hash="e614759d6b46c0c25f6c26d6e9dff45a"/></dir></target><target name="mage"><dir name="js"><dir name="chronopost"><dir name="chronorelais"><file name="ocseditor.css" hash="1bfc847153768d6729cdad7cb1abe443"/><file name="ocseditor.js" hash="8b7f29ddf7faff2fd3a63af18ba666aa"/></dir></dir></dir></target></contents>
|
41 |
<compatible/>
|
42 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
43 |
</package>
|
skin/frontend/default/default/chronorelais/chronorelais.css
CHANGED
@@ -1,46 +1,46 @@
|
|
1 |
-
/* styles for chrono relais */
|
2 |
-
|
3 |
-
.chronorelais-list { }
|
4 |
-
.sp-methods-chronorelais { padding:5px 20px;}
|
5 |
-
sp-methods-chronorelais dd li { clear:both;}
|
6 |
-
.chronorelaismap { margin:20px 0px 10px 0px; }
|
7 |
-
.chronorelaismap .mappostalcode { margin-bottom:10px; text-align:right;}
|
8 |
-
.sp-methods .method-description { clear:both; }
|
9 |
-
.sp-methods .method-radio, .sp-methods .method-image, .sp-methods .method-contents { }
|
10 |
-
.sp-methods .method-image { padding:0 10px;}
|
11 |
-
|
12 |
-
/*****************************
|
13 |
-
sw-Gmap
|
14 |
-
*******************************/
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
/*****************************
|
22 |
-
Infowindow
|
23 |
-
*******************************/
|
24 |
-
|
25 |
-
#sw-infowindow-info{max-height:400px}
|
26 |
-
#sw-infowindow-hor{height:150px}
|
27 |
-
.sw-map-adresse-wrp{min-height:90px}
|
28 |
-
.sw-map-adresse{font-size:1.2em;margin:5px 0 8px 0;line-height:1.45em;}
|
29 |
-
.sw-map-tools a{font-size:12px;}
|
30 |
-
|
31 |
-
|
32 |
-
.sw-map-itin-tools{font-size:11px;padding:8px 0;display:block;}
|
33 |
-
.sw-back-link{font-size:11px;display:block;text-align:right;margin:0px ;}
|
34 |
-
#sw-sendbymail-wrap{height:220px;overflow:hidden;}
|
35 |
-
|
36 |
-
.sw-tool-itineraire{height:220px;}
|
37 |
-
/*****************************
|
38 |
-
Tables
|
39 |
-
*******************************/
|
40 |
-
.sw-table {border-collapse:collapse; width:100%;}
|
41 |
-
.sw-table td {font-size:1.2em;border-bottom:1px solid #ccc; padding:1px 0px;}
|
42 |
-
.sw-table th{background:#eee;font-size:1.3em;border-top:1px solid #555}
|
43 |
-
#sw-table-horaire-client td ,#sw-table-horaire-depot td{width:50%;}
|
44 |
-
#sw-table-horaire-client{}
|
45 |
-
#sw-table-horaire-depot{margin-top:8px;}
|
46 |
-
/*****************************
|
1 |
+
/* styles for chrono relais */
|
2 |
+
|
3 |
+
.chronorelais-list { }
|
4 |
+
.sp-methods-chronorelais { padding:5px 20px;}
|
5 |
+
sp-methods-chronorelais dd li { clear:both;}
|
6 |
+
.chronorelaismap { margin:20px 0px 10px 0px; }
|
7 |
+
.chronorelaismap .mappostalcode { margin-bottom:10px; text-align:right;}
|
8 |
+
.sp-methods .method-description { clear:both; }
|
9 |
+
.sp-methods .method-radio, .sp-methods .method-image, .sp-methods .method-contents { }
|
10 |
+
.sp-methods .method-image { padding:0 10px;}
|
11 |
+
|
12 |
+
/*****************************
|
13 |
+
sw-Gmap
|
14 |
+
*******************************/
|
15 |
+
.chronomap { height:450px; width:100%; overflow:hidden!mportant; font:82.5%/1.3 Arial,Helvetica,sans-serif; background-color: #E5E3DF; border: 1px solid #aaa;}
|
16 |
+
.chronomap *{float:none;overflow:visible;font-family: Arial,sans-serif;}
|
17 |
+
.chronomap a {color:#0000cc;outline:none;}
|
18 |
+
.chronomap h4{font-size:14px;margin-bottom:6px;border-bottom:1px solid #ccc;}
|
19 |
+
.chronomap h2{font-size:16px;margin:2px 10px 6px 0; font-weight:bold;}
|
20 |
+
|
21 |
+
/*****************************
|
22 |
+
Infowindow
|
23 |
+
*******************************/
|
24 |
+
.chronomap .sw-infowindow a{cursor:pointer;}
|
25 |
+
#sw-infowindow-info{max-height:400px}
|
26 |
+
#sw-infowindow-hor{height:150px}
|
27 |
+
.sw-map-adresse-wrp{min-height:90px}
|
28 |
+
.sw-map-adresse{font-size:1.2em;margin:5px 0 8px 0;line-height:1.45em;}
|
29 |
+
.sw-map-tools a{font-size:12px;}
|
30 |
+
.chronomap .sw-desc{display:block;font-weight:bold;line-height:16px;float:none!important;width:auto;}
|
31 |
+
.chronomap .sw-help{display:block;float:none!important;width:auto;clear:both;}
|
32 |
+
.sw-map-itin-tools{font-size:11px;padding:8px 0;display:block;}
|
33 |
+
.sw-back-link{font-size:11px;display:block;text-align:right;margin:0px ;}
|
34 |
+
#sw-sendbymail-wrap{height:220px;overflow:hidden;}
|
35 |
+
.chronomap .sw-textarea{height:30px;}
|
36 |
+
.sw-tool-itineraire{height:220px;}
|
37 |
+
/*****************************
|
38 |
+
Tables
|
39 |
+
*******************************/
|
40 |
+
.sw-table {border-collapse:collapse; width:100%;}
|
41 |
+
.sw-table td {font-size:1.2em;border-bottom:1px solid #ccc; padding:1px 0px;}
|
42 |
+
.sw-table th{background:#eee;font-size:1.3em;border-top:1px solid #555}
|
43 |
+
#sw-table-horaire-client td ,#sw-table-horaire-depot td{width:50%;}
|
44 |
+
#sw-table-horaire-client{}
|
45 |
+
#sw-table-horaire-depot{margin-top:8px;}
|
46 |
+
/*****************************
|
skin/frontend/default/default/chronorelais/chronorelais.png
CHANGED
Binary file
|
skin/frontend/default/default/chronorelais/chronorelaismap.js
CHANGED
@@ -1,463 +1,569 @@
|
|
1 |
-
var gmarkers = [];
|
2 |
-
var map;
|
3 |
-
var homeaddress = "";
|
4 |
-
var addressrelais = [];
|
5 |
-
var relaylatan = [];
|
6 |
-
var next_pt = 0;
|
7 |
-
var hidehomeicon = false;
|
8 |
-
|
9 |
-
function loadMyPoint(i) {
|
10 |
-
GEvent.trigger(gmarkers[i], "click");
|
11 |
-
}
|
12 |
-
|
13 |
-
var bounds = new GLatLngBounds();
|
14 |
-
function loadRelayMap(address, relaisArray, nextpt) {
|
15 |
-
if (GBrowserIsCompatible()) {
|
16 |
-
var geo = new GClientGeocoder();
|
17 |
-
var reasons=[];
|
18 |
-
reasons[G_GEO_SUCCESS] = "Success";
|
19 |
-
reasons[G_GEO_MISSING_ADDRESS] = "Missing Address: The address was either missing or had no value.";
|
20 |
-
reasons[G_GEO_UNKNOWN_ADDRESS] = "Unknown Address: No corresponding geographic location could be found for the specified address.";
|
21 |
-
reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address: The geocode for the given address cannot be returned due to legal or contractual reasons.";
|
22 |
-
reasons[G_GEO_BAD_KEY] = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
|
23 |
-
reasons[G_GEO_TOO_MANY_QUERIES] = "Too Many Queries: The daily geocoding quota for this site has been exceeded.";
|
24 |
-
reasons[G_GEO_SERVER_ERROR] = "Server error: The geocoding request could not be successfully processed.";
|
25 |
-
|
26 |
-
map = new GMap2(document.getElementById(
|
27 |
-
//map.addControl(new GLargeMapControl());
|
28 |
-
map.setUIToDefault();
|
29 |
-
|
30 |
-
var blueIcon = new GIcon();
|
31 |
-
blueIcon.iconSize = new GSize(45, 30);
|
32 |
-
blueIcon.iconAnchor = new GPoint(9, 34);
|
33 |
-
blueIcon.infoWindowAnchor = new GPoint(9, 2);
|
34 |
-
blueIcon.transparent = Picto_Chrono_Relais;
|
35 |
-
var homeicon = new GIcon();
|
36 |
-
homeicon.iconSize = new GSize(32, 37);
|
37 |
-
homeicon.iconAnchor = new GPoint(9, 34);
|
38 |
-
homeicon.infoWindowAnchor = new GPoint(9, 2);
|
39 |
-
homeicon.transparent = Home_Chrono_Icon;
|
40 |
-
|
41 |
-
if(!homeaddress && !hidehomeicon) {
|
42 |
-
var ship_address = getShipAddress(); //get shipping address to set home address
|
43 |
-
homeaddress = relaisArray.codePostal + " " + relaisArray.localite;
|
44 |
-
if(ship_address) { homeaddress = ship_address+" "+homeaddress; }
|
45 |
-
|
46 |
-
geo.getLocations(homeaddress , function(result) {
|
47 |
-
if (result.Status.code == G_GEO_SUCCESS) {
|
48 |
-
var p = result.Placemark[0].Point.coordinates;
|
49 |
-
var point = new GLatLng(p[1],p[0]);
|
50 |
-
var marker = new GMarker(point,{title:'home',icon:homeicon});
|
51 |
-
map.addOverlay(marker);
|
52 |
-
map.setCenter(point, 17-5);
|
53 |
-
}
|
54 |
-
});
|
55 |
-
}
|
56 |
-
|
57 |
-
function createTabbedMarker(point, relaisArray) {
|
58 |
-
//alert(point);
|
59 |
-
addressrelais.push(relaisArray);
|
60 |
-
var label = nextpt;
|
61 |
-
var relaypoint_id = relaisArray.identifiantChronopostPointA2PAS;
|
62 |
-
var marker = new GMarker(point,{title:relaisArray.nomEnseigne,icon:blueIcon});
|
63 |
-
var tab = new GInfoWindowTab ("Infos", '<div id="sw-infowindow-info" class="sw-infowindow">'+getMarkerInfoContent(relaisArray) + getActionsForm(label)+'</div>');
|
64 |
-
var tab2 = new GInfoWindowTab ("Horaires", '<div id="sw-infowindow-hor" class="sw-infowindow">'+"<h2>Horaires</h2>"+getHorairesTab(relaisArray, true)+'</div>') ;
|
65 |
-
|
66 |
-
GEvent.addListener(marker, "click", function() {
|
67 |
-
if(document.getElementById('s_method_chronorelais_'+relaisArray.identifiantChronopostPointA2PAS))
|
68 |
-
document.getElementById('s_method_chronorelais_'+relaisArray.identifiantChronopostPointA2PAS).checked = true;
|
69 |
-
marker.openInfoWindowTabsHtml([tab, tab2]);
|
70 |
-
});
|
71 |
-
//gmarkers.push(marker);
|
72 |
-
gmarkers[relaypoint_id] = marker;
|
73 |
-
return marker;
|
74 |
-
}
|
75 |
-
|
76 |
-
function showAddress(address, relaisArray) {
|
77 |
-
var search = address;
|
78 |
-
// ====== Perform the Geocoding ======
|
79 |
-
geo.getLocations(search, function (result)
|
80 |
-
{
|
81 |
-
// If that was successful
|
82 |
-
if (result.Status.code == G_GEO_SUCCESS) {
|
83 |
-
// Loop through the results, placing markers
|
84 |
-
//for (var i=0; i<result.Placemark.length; i++) {
|
85 |
-
for (var i=0; i<1; i++) {
|
86 |
-
var p = result.Placemark[i].Point.coordinates;
|
87 |
-
relaylatan.push(p);
|
88 |
-
var point = new GLatLng(p[1],p[0]);
|
89 |
-
var marker = createTabbedMarker(point, relaisArray);
|
90 |
-
map.addOverlay(marker);
|
91 |
-
// ==== Each time a point is found, extent the bounds ato include it =====
|
92 |
-
bounds.extend(point);
|
93 |
-
}
|
94 |
-
// centre the map on the first result
|
95 |
-
//!homeaddress && hidehomeicon &&
|
96 |
-
if(nextpt==5) {
|
97 |
-
var p = result.Placemark[0].Point.coordinates;
|
98 |
-
map.setCenter(new GLatLng(p[1],p[0]),17-5);
|
99 |
-
// ===== determine the zoom level from the bounds =====
|
100 |
-
map.setZoom(map.getBoundsZoomLevel(bounds));
|
101 |
-
// ===== determine the centre from the bounds ======
|
102 |
-
map.setCenter(bounds.getCenter());
|
103 |
-
}
|
104 |
-
}
|
105 |
-
// ====== Decode the error status ======
|
106 |
-
else {
|
107 |
-
var reason="Code "+result.Status.code;
|
108 |
-
if (reasons[result.Status.code]) {
|
109 |
-
reason = reasons[result.Status.code]
|
110 |
-
}
|
111 |
-
alert('Could not find "'+search+ '" ' + reason);
|
112 |
-
}
|
113 |
-
}
|
114 |
-
);
|
115 |
-
}
|
116 |
-
showAddress(address, relaisArray);
|
117 |
-
|
118 |
-
} else {
|
119 |
-
alert("Sorry, the Google Maps API is not compatible with this browser");
|
120 |
-
}
|
121 |
-
} // end of loadRelayMap function
|
122 |
-
|
123 |
-
function addEvent( obj, type, fn ) {
|
124 |
-
if ( obj.attachEvent ) {
|
125 |
-
obj["e"+type+fn] = fn;
|
126 |
-
obj[type+fn] = function() { obj["e"+type+fn]( window.event ) };
|
127 |
-
obj.attachEvent( "on"+type, obj[type+fn] );
|
128 |
-
}
|
129 |
-
else{
|
130 |
-
obj.addEventListener( type, fn, false );
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
function getMarkerInfoContent(relaisArray){
|
135 |
-
var icoPath = Picto_Chrono_Relais;
|
136 |
-
var content="<div class=\"sw-map-adresse-wrp\" style=\"background-image: url("+ icoPath +"); background-repeat: no-repeat;padding-left:50px;\">"
|
137 |
-
+ "<h2>"+relaisArray.nomEnseigne+"</h2>"
|
138 |
-
+ "<div class=\"sw-map-adresse\">"
|
139 |
-
+ parseAdresse(relaisArray)
|
140 |
-
+ relaisArray.codePostal + " " + relaisArray.localite
|
141 |
-
+ "</div></div>";
|
142 |
-
return content;
|
143 |
-
}
|
144 |
-
function getActionsForm(label)
|
145 |
-
{
|
146 |
-
var html = '<div class="sw-map-tools"><a href="javascript:printPage('+label+')">Imprimer</a>'
|
147 |
-
+ '</div>';
|
148 |
-
return html;
|
149 |
-
}
|
150 |
-
|
151 |
-
function getHorairesTab(anArray, highlight)
|
152 |
-
{
|
153 |
-
var userAgent = navigator.userAgent.toLowerCase();
|
154 |
-
var msie = /msie/.test( userAgent ) && !/opera/.test( userAgent );
|
155 |
-
|
156 |
-
var rs = "" ;
|
157 |
-
rs = "<table id=\"sw-table-horaire\" class=\"sw-table\"";
|
158 |
-
if(msie) {
|
159 |
-
rs += " style=\"width:auto;\"";
|
160 |
-
}
|
161 |
-
rs += ">"
|
162 |
-
+ "<tr><td>Lun:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureLundi, 1, highlight) +"</tr>"
|
163 |
-
+ "<tr><td>Mar:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureMardi, 2, highlight) +"</tr>"
|
164 |
-
+ "<tr><td>Mer:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureMercredi, 3, highlight) +"</tr>"
|
165 |
-
+ "<tr><td>Jeu:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureJeudi, 4, highlight) +"</tr>"
|
166 |
-
+ "<tr><td>Ven:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureVendredi, 5, highlight) +"</tr>"
|
167 |
-
+ "<tr><td>Sam:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureSamedi, 6, highlight) +"</tr>"
|
168 |
-
+ "<tr><td>Dim:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureDimanche, 0, highlight) +"</tr>"
|
169 |
-
+ "</table>" ;
|
170 |
-
return rs ;
|
171 |
-
}
|
172 |
-
|
173 |
-
function parseAdresse(anArray)
|
174 |
-
{
|
175 |
-
var address = anArray.adresse1 + "<br />" ;
|
176 |
-
if (anArray.adresse2)
|
177 |
-
address += anArray.adresse2 + "<br />" ;
|
178 |
-
if (anArray.adresse3)
|
179 |
-
address += anArray.adresse3 + "<br />" ;
|
180 |
-
return address ;
|
181 |
-
}
|
182 |
-
|
183 |
-
function parseHorairesOuverture(value , day, highlight)
|
184 |
-
{
|
185 |
-
var rs = "" ;
|
186 |
-
|
187 |
-
var now = new Date() ;
|
188 |
-
var today = now.getDay() ; // number of day
|
189 |
-
var attributedCell = "" ;
|
190 |
-
var reg = new RegExp(" ", "g");
|
191 |
-
|
192 |
-
var horaires = value.split(reg) ;
|
193 |
-
|
194 |
-
for (var i=0; i < horaires.length; i++)
|
195 |
-
{
|
196 |
-
// first define the attributes for the current cell
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
{
|
213 |
-
horaires[i] = "<td "+attributedCell+">
|
214 |
-
}
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
+ "&
|
236 |
-
+
|
237 |
-
+ "&
|
238 |
-
+ "&
|
239 |
-
+ "&
|
240 |
-
+ "&
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
}
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
if(
|
281 |
-
|
282 |
-
|
283 |
-
}
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
if(
|
294 |
-
|
295 |
-
|
296 |
-
}
|
297 |
-
|
298 |
-
|
299 |
-
}
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
this.
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
return false;
|
327 |
-
}
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
},
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
}
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var gmarkers = [];
|
2 |
+
var map;
|
3 |
+
var homeaddress = "";
|
4 |
+
var addressrelais = [];
|
5 |
+
var relaylatan = [];
|
6 |
+
var next_pt = 0;
|
7 |
+
var hidehomeicon = false;
|
8 |
+
|
9 |
+
function loadMyPoint(i) {
|
10 |
+
GEvent.trigger(gmarkers[i], "click");
|
11 |
+
}
|
12 |
+
|
13 |
+
var bounds = new GLatLngBounds();
|
14 |
+
function loadRelayMap(address, relaisArray, nextpt, mapid) {
|
15 |
+
if (GBrowserIsCompatible()) {
|
16 |
+
var geo = new GClientGeocoder();
|
17 |
+
var reasons=[];
|
18 |
+
reasons[G_GEO_SUCCESS] = "Success";
|
19 |
+
reasons[G_GEO_MISSING_ADDRESS] = "Missing Address: The address was either missing or had no value.";
|
20 |
+
reasons[G_GEO_UNKNOWN_ADDRESS] = "Unknown Address: No corresponding geographic location could be found for the specified address.";
|
21 |
+
reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address: The geocode for the given address cannot be returned due to legal or contractual reasons.";
|
22 |
+
reasons[G_GEO_BAD_KEY] = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
|
23 |
+
reasons[G_GEO_TOO_MANY_QUERIES] = "Too Many Queries: The daily geocoding quota for this site has been exceeded.";
|
24 |
+
reasons[G_GEO_SERVER_ERROR] = "Server error: The geocoding request could not be successfully processed.";
|
25 |
+
|
26 |
+
map = new GMap2(document.getElementById(mapid));
|
27 |
+
//map.addControl(new GLargeMapControl());
|
28 |
+
map.setUIToDefault();
|
29 |
+
|
30 |
+
var blueIcon = new GIcon();
|
31 |
+
blueIcon.iconSize = new GSize(45, 30);
|
32 |
+
blueIcon.iconAnchor = new GPoint(9, 34);
|
33 |
+
blueIcon.infoWindowAnchor = new GPoint(9, 2);
|
34 |
+
blueIcon.transparent = Picto_Chrono_Relais;
|
35 |
+
var homeicon = new GIcon();
|
36 |
+
homeicon.iconSize = new GSize(32, 37);
|
37 |
+
homeicon.iconAnchor = new GPoint(9, 34);
|
38 |
+
homeicon.infoWindowAnchor = new GPoint(9, 2);
|
39 |
+
homeicon.transparent = Home_Chrono_Icon;
|
40 |
+
|
41 |
+
if(!homeaddress && !hidehomeicon) {
|
42 |
+
var ship_address = getShipAddress(); //get shipping address to set home address
|
43 |
+
homeaddress = relaisArray.codePostal + " " + relaisArray.localite;
|
44 |
+
if(ship_address) { homeaddress = ship_address+" "+homeaddress; }
|
45 |
+
|
46 |
+
geo.getLocations(homeaddress , function(result) {
|
47 |
+
if (result.Status.code == G_GEO_SUCCESS) {
|
48 |
+
var p = result.Placemark[0].Point.coordinates;
|
49 |
+
var point = new GLatLng(p[1],p[0]);
|
50 |
+
var marker = new GMarker(point,{title:'home',icon:homeicon});
|
51 |
+
map.addOverlay(marker);
|
52 |
+
map.setCenter(point, 17-5);
|
53 |
+
}
|
54 |
+
});
|
55 |
+
}
|
56 |
+
|
57 |
+
function createTabbedMarker(point, relaisArray) {
|
58 |
+
//alert(point);
|
59 |
+
addressrelais.push(relaisArray);
|
60 |
+
var label = nextpt;
|
61 |
+
var relaypoint_id = relaisArray.identifiantChronopostPointA2PAS;
|
62 |
+
var marker = new GMarker(point,{title:relaisArray.nomEnseigne,icon:blueIcon});
|
63 |
+
var tab = new GInfoWindowTab ("Infos", '<div id="sw-infowindow-info" class="sw-infowindow">'+getMarkerInfoContent(relaisArray) + getActionsForm(label)+'</div>');
|
64 |
+
var tab2 = new GInfoWindowTab ("Horaires", '<div id="sw-infowindow-hor" class="sw-infowindow">'+"<h2>Horaires</h2>"+getHorairesTab(relaisArray, true)+'</div>') ;
|
65 |
+
|
66 |
+
GEvent.addListener(marker, "click", function() {
|
67 |
+
if(document.getElementById('s_method_chronorelais_'+relaisArray.identifiantChronopostPointA2PAS))
|
68 |
+
document.getElementById('s_method_chronorelais_'+relaisArray.identifiantChronopostPointA2PAS).checked = true;
|
69 |
+
marker.openInfoWindowTabsHtml([tab, tab2]);
|
70 |
+
});
|
71 |
+
//gmarkers.push(marker);
|
72 |
+
gmarkers[relaypoint_id] = marker;
|
73 |
+
return marker;
|
74 |
+
}
|
75 |
+
|
76 |
+
function showAddress(address, relaisArray) {
|
77 |
+
var search = address;
|
78 |
+
// ====== Perform the Geocoding ======
|
79 |
+
geo.getLocations(search, function (result)
|
80 |
+
{
|
81 |
+
// If that was successful
|
82 |
+
if (result.Status.code == G_GEO_SUCCESS) {
|
83 |
+
// Loop through the results, placing markers
|
84 |
+
//for (var i=0; i<result.Placemark.length; i++) {
|
85 |
+
for (var i=0; i<1; i++) {
|
86 |
+
var p = result.Placemark[i].Point.coordinates;
|
87 |
+
relaylatan.push(p);
|
88 |
+
var point = new GLatLng(p[1],p[0]);
|
89 |
+
var marker = createTabbedMarker(point, relaisArray);
|
90 |
+
map.addOverlay(marker);
|
91 |
+
// ==== Each time a point is found, extent the bounds ato include it =====
|
92 |
+
bounds.extend(point);
|
93 |
+
}
|
94 |
+
// centre the map on the first result
|
95 |
+
//!homeaddress && hidehomeicon &&
|
96 |
+
if(nextpt==5) {
|
97 |
+
var p = result.Placemark[0].Point.coordinates;
|
98 |
+
map.setCenter(new GLatLng(p[1],p[0]),17-5);
|
99 |
+
// ===== determine the zoom level from the bounds =====
|
100 |
+
map.setZoom(map.getBoundsZoomLevel(bounds));
|
101 |
+
// ===== determine the centre from the bounds ======
|
102 |
+
map.setCenter(bounds.getCenter());
|
103 |
+
}
|
104 |
+
}
|
105 |
+
// ====== Decode the error status ======
|
106 |
+
else {
|
107 |
+
var reason="Code "+result.Status.code;
|
108 |
+
if (reasons[result.Status.code]) {
|
109 |
+
reason = reasons[result.Status.code]
|
110 |
+
}
|
111 |
+
alert('Could not find "'+search+ '" ' + reason);
|
112 |
+
}
|
113 |
+
}
|
114 |
+
);
|
115 |
+
}
|
116 |
+
showAddress(address, relaisArray);
|
117 |
+
|
118 |
+
} else {
|
119 |
+
alert("Sorry, the Google Maps API is not compatible with this browser");
|
120 |
+
}
|
121 |
+
} // end of loadRelayMap function
|
122 |
+
|
123 |
+
function addEvent( obj, type, fn ) {
|
124 |
+
if ( obj.attachEvent ) {
|
125 |
+
obj["e"+type+fn] = fn;
|
126 |
+
obj[type+fn] = function() { obj["e"+type+fn]( window.event ) };
|
127 |
+
obj.attachEvent( "on"+type, obj[type+fn] );
|
128 |
+
}
|
129 |
+
else{
|
130 |
+
obj.addEventListener( type, fn, false );
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
function getMarkerInfoContent(relaisArray){
|
135 |
+
var icoPath = Picto_Chrono_Relais;
|
136 |
+
var content="<div class=\"sw-map-adresse-wrp\" style=\"background-image: url("+ icoPath +"); background-repeat: no-repeat;padding-left:50px;\">"
|
137 |
+
+ "<h2>"+relaisArray.nomEnseigne+"</h2>"
|
138 |
+
+ "<div class=\"sw-map-adresse\">"
|
139 |
+
+ parseAdresse(relaisArray)
|
140 |
+
+ relaisArray.codePostal + " " + relaisArray.localite
|
141 |
+
+ "</div></div>";
|
142 |
+
return content;
|
143 |
+
}
|
144 |
+
function getActionsForm(label)
|
145 |
+
{
|
146 |
+
var html = '<div class="sw-map-tools"><a href="javascript:printPage('+label+')">Imprimer</a>'
|
147 |
+
+ '</div>';
|
148 |
+
return html;
|
149 |
+
}
|
150 |
+
|
151 |
+
function getHorairesTab(anArray, highlight)
|
152 |
+
{
|
153 |
+
var userAgent = navigator.userAgent.toLowerCase();
|
154 |
+
var msie = /msie/.test( userAgent ) && !/opera/.test( userAgent );
|
155 |
+
|
156 |
+
var rs = "" ;
|
157 |
+
rs = "<table id=\"sw-table-horaire\" class=\"sw-table\"";
|
158 |
+
if(msie) {
|
159 |
+
rs += " style=\"width:auto;\"";
|
160 |
+
}
|
161 |
+
rs += ">"
|
162 |
+
+ "<tr><td>Lun:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureLundi, 1, highlight) +"</tr>"
|
163 |
+
+ "<tr><td>Mar:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureMardi, 2, highlight) +"</tr>"
|
164 |
+
+ "<tr><td>Mer:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureMercredi, 3, highlight) +"</tr>"
|
165 |
+
+ "<tr><td>Jeu:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureJeudi, 4, highlight) +"</tr>"
|
166 |
+
+ "<tr><td>Ven:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureVendredi, 5, highlight) +"</tr>"
|
167 |
+
+ "<tr><td>Sam:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureSamedi, 6, highlight) +"</tr>"
|
168 |
+
+ "<tr><td>Dim:</td>"+ parseHorairesOuverture(anArray.horairesOuvertureDimanche, 0, highlight) +"</tr>"
|
169 |
+
+ "</table>" ;
|
170 |
+
return rs ;
|
171 |
+
}
|
172 |
+
|
173 |
+
function parseAdresse(anArray)
|
174 |
+
{
|
175 |
+
var address = anArray.adresse1 + "<br />" ;
|
176 |
+
if (anArray.adresse2)
|
177 |
+
address += anArray.adresse2 + "<br />" ;
|
178 |
+
if (anArray.adresse3)
|
179 |
+
address += anArray.adresse3 + "<br />" ;
|
180 |
+
return address ;
|
181 |
+
}
|
182 |
+
|
183 |
+
function parseHorairesOuverture(value , day, highlight)
|
184 |
+
{
|
185 |
+
var rs = "" ;
|
186 |
+
|
187 |
+
var now = new Date() ;
|
188 |
+
var today = now.getDay() ; // number of day
|
189 |
+
var attributedCell = "" ;
|
190 |
+
var reg = new RegExp(" ", "g");
|
191 |
+
|
192 |
+
var horaires = value.split(reg) ;
|
193 |
+
|
194 |
+
for (var i=0; i < horaires.length; i++)
|
195 |
+
{
|
196 |
+
// first define the attributes for the current cell
|
197 |
+
/* Aucun jour n'est mis en exergue car on ne sait pas quel sera le jour de livraison
|
198 |
+
if ( highlight == true && day == today)
|
199 |
+
{
|
200 |
+
attributedCell = "style=\"color:red;\"" ;
|
201 |
+
}
|
202 |
+
else
|
203 |
+
{
|
204 |
+
*/
|
205 |
+
attributedCell = "" ;
|
206 |
+
/*
|
207 |
+
}
|
208 |
+
*/
|
209 |
+
|
210 |
+
// so, re-format time
|
211 |
+
if (horaires[i] == "00:00-00:00")
|
212 |
+
{
|
213 |
+
horaires[i] = "<td "+attributedCell+">Fermé</td>" ;
|
214 |
+
}
|
215 |
+
else
|
216 |
+
{
|
217 |
+
horaires[i] = "<td "+attributedCell+">"+horaires[i]+"</td>" ;
|
218 |
+
}
|
219 |
+
|
220 |
+
// yeah, concatenates result to the returned value
|
221 |
+
rs += horaires[i] ;
|
222 |
+
}
|
223 |
+
|
224 |
+
return rs ;
|
225 |
+
}
|
226 |
+
|
227 |
+
function printPage(i)
|
228 |
+
{
|
229 |
+
var fen=open("","Impression");
|
230 |
+
fen.focus();
|
231 |
+
var baseURL = "http://www.chronopost.fr/transport-express/webdav/site/chronov4/groups/administrators/public/Chronomaps/" ;
|
232 |
+
var latlngpoint = relaylatan[i-1];
|
233 |
+
if(latlngpoint) {
|
234 |
+
fen.location.href = baseURL
|
235 |
+
+ "print-result.html?request=print&"
|
236 |
+
+ btQueryString(addressrelais[i-1], true)
|
237 |
+
+ "&rtype=chronorelais"
|
238 |
+
+ "&icnname=ac"
|
239 |
+
+ "&lat=" + latlngpoint[1]
|
240 |
+
+ "&lng=" + latlngpoint[0]
|
241 |
+
+ "&sw-form-type-point=opt_chrlas"
|
242 |
+
+ "&is_print_direction=" + false
|
243 |
+
+ "&from_addr="
|
244 |
+
+ "&to_addr=";
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
function btQueryString(anArray, needEscape)
|
249 |
+
{
|
250 |
+
var rs = "" ;
|
251 |
+
for (key in anArray)
|
252 |
+
{
|
253 |
+
if (needEscape == true)
|
254 |
+
{
|
255 |
+
if(anArray[key]) {
|
256 |
+
if (rs != "")
|
257 |
+
rs += "&"
|
258 |
+
rs += key +"=" + escape(anArray[key]) ;
|
259 |
+
}
|
260 |
+
}
|
261 |
+
else
|
262 |
+
{
|
263 |
+
if(anArray[key]) {
|
264 |
+
if (rs != "")
|
265 |
+
rs += "_-_"
|
266 |
+
rs += key +"=" + anArray[key] ;
|
267 |
+
}
|
268 |
+
}
|
269 |
+
}
|
270 |
+
return rs ;
|
271 |
+
}
|
272 |
+
|
273 |
+
function getShipAddress() {
|
274 |
+
var ship_address = '';
|
275 |
+
if($('shipping:same_as_billing').checked) {
|
276 |
+
if ($('billing-address-select') && $('billing-address-select').value) {
|
277 |
+
var e = $('billing-address-select');
|
278 |
+
var address_value = e.options[e.selectedIndex].text;
|
279 |
+
var shipping_address = address_value.split(',');
|
280 |
+
if(shipping_address[1]) {
|
281 |
+
ship_address = shipping_address[1];
|
282 |
+
}
|
283 |
+
} else {
|
284 |
+
if($('billing:street1')) { ship_address = $('billing:street1').value; }
|
285 |
+
if($('billing:street2')) { ship_address = ship_address+" "+$('billing:street2').value; }
|
286 |
+
if($('billing:street3')) { ship_address = ship_address+" "+$('billing:street3').value; }
|
287 |
+
}
|
288 |
+
} else {
|
289 |
+
if ($('shipping-address-select') && $('shipping-address-select').value) {
|
290 |
+
var e = $('shipping-address-select');
|
291 |
+
var address_value = e.options[e.selectedIndex].text;
|
292 |
+
var shipping_address = address_value.split(',');
|
293 |
+
if(shipping_address[1]) {
|
294 |
+
ship_address = shipping_address[1];
|
295 |
+
}
|
296 |
+
} else {
|
297 |
+
if($('shipping:street1')) { ship_address = $('shipping:street1').value; }
|
298 |
+
if($('shipping:street2')) { ship_address = ship_address+" "+$('shipping:street2').value; }
|
299 |
+
if($('shipping:street3')) { ship_address = ship_address+" "+$('shipping:street3').value; }
|
300 |
+
}
|
301 |
+
}
|
302 |
+
return ship_address;
|
303 |
+
}
|
304 |
+
|
305 |
+
/** Map content end **/
|
306 |
+
|
307 |
+
|
308 |
+
// shipping method
|
309 |
+
var ShippingMethod = Class.create();
|
310 |
+
ShippingMethod.prototype = {
|
311 |
+
initialize: function(form, saveUrl){
|
312 |
+
this.form = form;
|
313 |
+
if ($(this.form)) {
|
314 |
+
$(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
|
315 |
+
}
|
316 |
+
this.saveUrl = saveUrl;
|
317 |
+
this.validator = new Validation(this.form);
|
318 |
+
this.onSave = this.nextStep.bindAsEventListener(this);
|
319 |
+
this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
|
320 |
+
},
|
321 |
+
|
322 |
+
validate: function() {
|
323 |
+
var methods = document.getElementsByName('shipping_method');
|
324 |
+
if (methods.length==0) {
|
325 |
+
alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make neccessary changes in your shipping address.'));
|
326 |
+
return false;
|
327 |
+
}
|
328 |
+
|
329 |
+
if(!this.validator.validate()) {
|
330 |
+
return false;
|
331 |
+
}
|
332 |
+
|
333 |
+
for (var i=0; i<methods.length; i++) {
|
334 |
+
if (methods[i].checked) {
|
335 |
+
return true;
|
336 |
+
}
|
337 |
+
}
|
338 |
+
alert(Translator.translate('Please specify shipping method.'));
|
339 |
+
return false;
|
340 |
+
},
|
341 |
+
|
342 |
+
getrelais: function(url){
|
343 |
+
if (checkout.loadWaiting!=false) return;
|
344 |
+
if (this.validate()) {
|
345 |
+
checkout.setLoadWaiting('shipping-method');
|
346 |
+
hidehomeicon = false;
|
347 |
+
var request = new Ajax.Request(
|
348 |
+
url,
|
349 |
+
{
|
350 |
+
method:'post',
|
351 |
+
onComplete: this.onComplete,
|
352 |
+
onSuccess: this.onSave,
|
353 |
+
onFailure: checkout.ajaxFailure.bind(checkout),
|
354 |
+
parameters: Form.serialize(this.form)
|
355 |
+
}
|
356 |
+
);
|
357 |
+
}
|
358 |
+
},
|
359 |
+
|
360 |
+
changePostalCode: function(url){
|
361 |
+
if (checkout.loadWaiting!=false) return;
|
362 |
+
if (this.validate()) {
|
363 |
+
if(!$('mappostalcode').value) { return false; }
|
364 |
+
checkout.setLoadWaiting('shipping-method');
|
365 |
+
$('mappostalcodebtn').hide();
|
366 |
+
$('postalcode-please-wait').show();
|
367 |
+
$('postalcode-please-wait').style.opacity = '0.5';
|
368 |
+
hidehomeicon = true;
|
369 |
+
var request = new Ajax.Request(
|
370 |
+
url,
|
371 |
+
{
|
372 |
+
method:'post',
|
373 |
+
onComplete: this.onComplete,
|
374 |
+
onSuccess: this.onSave,
|
375 |
+
onFailure: checkout.ajaxFailure.bind(checkout),
|
376 |
+
parameters: Form.serialize(this.form)
|
377 |
+
}
|
378 |
+
);
|
379 |
+
}
|
380 |
+
},
|
381 |
+
|
382 |
+
hiderelais: function(url){
|
383 |
+
if($('checkout-shipping-method-chronorelais-load')) {
|
384 |
+
$('checkout-shipping-method-chronorelais-load').innerHTML = "";
|
385 |
+
}
|
386 |
+
},
|
387 |
+
|
388 |
+
save: function(){
|
389 |
+
|
390 |
+
if (checkout.loadWaiting!=false) return;
|
391 |
+
if (this.validate()) {
|
392 |
+
checkout.setLoadWaiting('shipping-method');
|
393 |
+
var request = new Ajax.Request(
|
394 |
+
this.saveUrl,
|
395 |
+
{
|
396 |
+
method:'post',
|
397 |
+
onComplete: this.onComplete,
|
398 |
+
onSuccess: this.onSave,
|
399 |
+
onFailure: checkout.ajaxFailure.bind(checkout),
|
400 |
+
parameters: Form.serialize(this.form)
|
401 |
+
}
|
402 |
+
);
|
403 |
+
}
|
404 |
+
},
|
405 |
+
|
406 |
+
resetLoadWaiting: function(transport){
|
407 |
+
checkout.setLoadWaiting(false);
|
408 |
+
},
|
409 |
+
|
410 |
+
nextStep: function(transport){
|
411 |
+
if (transport && transport.responseText){
|
412 |
+
try{
|
413 |
+
response = eval('(' + transport.responseText + ')');
|
414 |
+
}
|
415 |
+
catch (e) {
|
416 |
+
response = {};
|
417 |
+
}
|
418 |
+
}
|
419 |
+
|
420 |
+
if (response.error) {
|
421 |
+
alert(response.message);
|
422 |
+
if($('mappostalcodebtn')) { $('mappostalcodebtn').show(); }
|
423 |
+
if($('postalcode-please-wait')) { $('postalcode-please-wait').hide(); }
|
424 |
+
return false;
|
425 |
+
}
|
426 |
+
|
427 |
+
if (response.update_section) {
|
428 |
+
$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
|
429 |
+
response.update_section.html.evalScripts();
|
430 |
+
|
431 |
+
if(response.relaypoints) {
|
432 |
+
if(response.relaypoints.length>0) {
|
433 |
+
var relayaddress = "";
|
434 |
+
gmarkers = [];
|
435 |
+
addressrelais = [];
|
436 |
+
relaylatan = [];
|
437 |
+
homeaddress = "";
|
438 |
+
next_pt = 0;
|
439 |
+
bounds = new GLatLngBounds();
|
440 |
+
for(var s=0; s<response.relaypoints.length; s++) {
|
441 |
+
next_pt = s+1;
|
442 |
+
relayaddress = response.relaypoints[s].adresse1;
|
443 |
+
if(response.relaypoints[s].codePostal)
|
444 |
+
relayaddress += " "+response.relaypoints[s].codePostal;
|
445 |
+
if(response.relaypoints[s].localite)
|
446 |
+
relayaddress += " "+response.relaypoints[s].localite;
|
447 |
+
loadRelayMap(relayaddress, response.relaypoints[s], next_pt, "chronomap");
|
448 |
+
}
|
449 |
+
}
|
450 |
+
}
|
451 |
+
}
|
452 |
+
|
453 |
+
payment.initWhatIsCvvListeners();
|
454 |
+
|
455 |
+
if (response.goto_section) {
|
456 |
+
checkout.gotoSection(response.goto_section);
|
457 |
+
checkout.reloadProgressBlock();
|
458 |
+
return;
|
459 |
+
}
|
460 |
+
|
461 |
+
if (response.payment_methods_html) {
|
462 |
+
$('checkout-payment-method-load').update(response.payment_methods_html);
|
463 |
+
}
|
464 |
+
|
465 |
+
checkout.setShippingMethod();
|
466 |
+
}
|
467 |
+
}
|
468 |
+
|
469 |
+
// shipping method
|
470 |
+
var multiindex = "";
|
471 |
+
var MultiShippingMethod = Class.create();
|
472 |
+
MultiShippingMethod.prototype = {
|
473 |
+
initialize: function(){
|
474 |
+
this.loadWaiting = false;
|
475 |
+
this.onComplete = this.complete.bindAsEventListener(this);
|
476 |
+
},
|
477 |
+
|
478 |
+
getrelais: function(url, index, home){
|
479 |
+
if (this.loadWaiting!=false) return;
|
480 |
+
this.loadWaiting = true;
|
481 |
+
homeaddress = home;
|
482 |
+
hidehomeicon = false;
|
483 |
+
multiindex = "_" + index;
|
484 |
+
var request = new Ajax.Request(
|
485 |
+
url,
|
486 |
+
{
|
487 |
+
method:'post',
|
488 |
+
onComplete: this.onComplete
|
489 |
+
//onSuccess: this.onSave,
|
490 |
+
//onFailure: checkout.ajaxFailure.bind(checkout),
|
491 |
+
//parameters: Form.serialize(this.form)
|
492 |
+
}
|
493 |
+
);
|
494 |
+
|
495 |
+
},
|
496 |
+
|
497 |
+
changePostalCode: function(url, index){
|
498 |
+
if (this.loadWaiting!=false) return;
|
499 |
+
this.loadWaiting = true;
|
500 |
+
multiindex = "_" + index;
|
501 |
+
if(!$('mappostalcode' + multiindex).value) { return false; }
|
502 |
+
homeaddress = $('mappostalcode' + multiindex).value;
|
503 |
+
$('mappostalcodebtn' + multiindex).hide();
|
504 |
+
$('postalcode-please-wait' + multiindex).show();
|
505 |
+
$('postalcode-please-wait' + multiindex).style.opacity = '0.5';
|
506 |
+
hidehomeicon = true;
|
507 |
+
var request = new Ajax.Request(
|
508 |
+
url + '&zip=' + $('mappostalcode' + multiindex).value,
|
509 |
+
{
|
510 |
+
method:'post',
|
511 |
+
onComplete: this.onComplete
|
512 |
+
//onSuccess: this.onSave,
|
513 |
+
//onFailure: checkout.ajaxFailure.bind(checkout),
|
514 |
+
//parameters: Form.serialize('mappostalcodeform' + multiindex)
|
515 |
+
}
|
516 |
+
);
|
517 |
+
},
|
518 |
+
|
519 |
+
hiderelais: function(url, index){
|
520 |
+
if($('checkout-shipping-method-chronorelais-load_' + index)) {
|
521 |
+
$('checkout-shipping-method-chronorelais-load_' + index).innerHTML = "";
|
522 |
+
}
|
523 |
+
},
|
524 |
+
|
525 |
+
complete: function(transport){
|
526 |
+
this.loadWaiting = false;
|
527 |
+
|
528 |
+
if (transport && transport.responseText){
|
529 |
+
try{
|
530 |
+
response = eval('(' + transport.responseText + ')');
|
531 |
+
}
|
532 |
+
catch (e) {
|
533 |
+
response = {};
|
534 |
+
}
|
535 |
+
}
|
536 |
+
|
537 |
+
if (response.error) {
|
538 |
+
alert(response.message);
|
539 |
+
if($('mappostalcodebtn' + multiindex)) { $('mappostalcodebtn' + multiindex).show(); }
|
540 |
+
if($('postalcode-please-wait' + multiindex)) { $('postalcode-please-wait' + multiindex).hide(); }
|
541 |
+
return false;
|
542 |
+
}
|
543 |
+
|
544 |
+
if (response.update_section) {
|
545 |
+
$(response.update_section.name).update(response.update_section.html);
|
546 |
+
response.update_section.html.evalScripts();
|
547 |
+
|
548 |
+
if(response.relaypoints) {
|
549 |
+
if(response.relaypoints.length>0) {
|
550 |
+
var relayaddress = "";
|
551 |
+
gmarkers = [];
|
552 |
+
addressrelais = [];
|
553 |
+
relaylatan = [];
|
554 |
+
next_pt = 0;
|
555 |
+
bounds = new GLatLngBounds();
|
556 |
+
for(var s=0; s<response.relaypoints.length; s++) {
|
557 |
+
next_pt = s+1;
|
558 |
+
relayaddress = response.relaypoints[s].adresse1;
|
559 |
+
if(response.relaypoints[s].codePostal)
|
560 |
+
relayaddress += " "+response.relaypoints[s].codePostal;
|
561 |
+
if(response.relaypoints[s].localite)
|
562 |
+
relayaddress += " "+response.relaypoints[s].localite;
|
563 |
+
loadRelayMap(relayaddress, response.relaypoints[s], next_pt, 'chronomap' + multiindex);
|
564 |
+
}
|
565 |
+
}
|
566 |
+
}
|
567 |
+
}
|
568 |
+
}
|
569 |
+
}
|