MondialRelay_Pointsrelais - Version 1.0.4

Version Notes

correction de la création d'etiquettes
correction de la redirection https

Download this release

Release Info

Developer Magento Core Team
Extension MondialRelay_Pointsrelais
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.4

app/code/community/MondialRelay/Pointsrelais/Model/Carrier/Pointsrelais.php CHANGED
@@ -1,168 +1,176 @@
1
- <?php
2
- class MondialRelay_Pointsrelais_Model_Carrier_Pointsrelais extends Mage_Shipping_Model_Carrier_Abstract
3
- {
4
- protected $_code = 'pointsrelais';
5
-
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!$this->getConfigFlag('active')) {
9
- return false;
10
- }
11
-
12
- // Permet de désactiver le module pour le multi-shipping
13
-
14
- if (Mage::getSingleton('checkout/session')->getQuote()->getIsMultiShipping())
15
- {
16
- return false;
17
- }
18
-
19
- if (!$request->getConditionName()) {
20
- $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
21
- }
22
-
23
- $result = Mage::getModel('shipping/rate_result');
24
-
25
- $rates = $this->getRate($request);
26
-
27
- foreach($rates as $rate)
28
- {
29
- if (!empty($rate) && $rate['price'] >= 0)
30
- {
31
-
32
- /*---------------------------------------- Liste des points relais -----------------------------------------*/
33
-
34
- // On met en place les paramètres de la requète
35
- $params = array(
36
- 'Enseigne' => $this->getConfigData('enseigne'),
37
- 'Pays' => $request->_data['dest_country_id'],
38
- 'CP' => $request->_data['dest_postcode'],
39
- );
40
-
41
- //On crée le code de sécurité
42
- $code = implode("",$params);
43
- $code .= $this->getConfigData('cle');
44
-
45
- //On le rajoute aux paramètres
46
- $params["Security"] = strtoupper(md5($code));
47
-
48
- // On se connecte
49
- $client = new SoapClient("http://www.mondialrelay.fr/WebService/Web_Services.asmx?WSDL");
50
-
51
- // Et on effectue la requète
52
- $points_relais = $client->WSI2_RecherchePointRelais($params)->WSI2_RecherchePointRelaisResult;
53
-
54
-
55
- // On créé une méthode de livraison par point relais
56
- foreach( $points_relais as $point_relais ) {
57
- if ( is_object($point_relais) ) {
58
-
59
- $method = Mage::getModel('shipping/rate_result_method');
60
-
61
- $method->setCarrier('pointsrelais');
62
- $method->setCarrierTitle($this->getConfigData('title'));
63
-
64
- $methodTitle = $point_relais->LgAdr1 . ' - ' . $point_relais->Ville . ' <a href="#" onclick="PointsRelais.showInfo(\'' . $point_relais->Num . '\'); return false;">Détails</a> - <span style="display:none;" id="pays">' . $request->_data['dest_country_id'] . '</span>';
65
- $method->setMethod($point_relais->Num);
66
- $method->setMethodTitle($methodTitle);
67
-
68
- $price = $rate['price'];
69
-
70
- $method->setPrice($this->getFinalPriceWithHandlingFee($price));
71
- $method->setCost($rate['cost']);
72
-
73
- $result->append($method);
74
- }
75
- }
76
- }
77
- }
78
-
79
- return $result;
80
- }
81
-
82
- public function getRate(Mage_Shipping_Model_Rate_Request $request)
83
- {
84
- return Mage::getResourceModel('pointsrelais/carrier_pointsrelais')->getRate($request);
85
- }
86
-
87
- public function getCode($type, $code='')
88
- {
89
- $codes = array(
90
-
91
- 'condition_name'=>array(
92
- 'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
93
- 'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
94
- 'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
95
- ),
96
-
97
- 'condition_name_short'=>array(
98
- 'package_weight' => Mage::helper('shipping')->__('Poids'),
99
- 'package_value' => Mage::helper('shipping')->__('Valeur du panier'),
100
- 'package_qty' => Mage::helper('shipping')->__('Nombre d\'articles'),
101
- ),
102
-
103
- );
104
-
105
- if (!isset($codes[$type])) {
106
- throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code type: %s', $type));
107
- }
108
-
109
- if (''===$code) {
110
- return $codes[$type];
111
- }
112
-
113
- if (!isset($codes[$type][$code])) {
114
- throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code for type %s: %s', $type, $code));
115
- }
116
-
117
- return $codes[$type][$code];
118
- }
119
-
120
- public function getAllowedMethods()
121
- {
122
- return array('pointsrelais'=>$this->getConfigData('name'));
123
- }
124
-
125
- public function isTrackingAvailable()
126
- {
127
- return true;
128
- }
129
-
130
- public function getTrackingInfo($tracking_number)
131
- {
132
- $tracking_result = $this->getTracking($tracking_number);
133
-
134
- if ($tracking_result instanceof Mage_Shipping_Model_Tracking_Result)
135
- {
136
- if ($trackings = $tracking_result->getAllTrackings())
137
- {
138
- return $trackings[0];
139
- }
140
- }
141
- elseif (is_string($tracking_result) && !empty($tracking_result))
142
- {
143
- return $tracking_result;
144
- }
145
-
146
- return false;
147
- }
148
-
149
- protected function getTracking($tracking_number)
150
- {
151
- $key = '<' . $this->getConfigData('marque') .'>' . $tracking_number . '<' . $this->getConfigData('cle') . '>';
152
- $key = md5($key);
153
-
154
- $tracking_url = 'http://www.mondialrelay.fr/lg_fr/espaces/url/popup_exp_details.aspx?cmrq=' . strtoupper($this->getConfigData('marque')) .'&nexp=' . strtoupper($tracking_number) . '&crc=' . strtoupper($key) ;
155
-
156
- $tracking_result = Mage::getModel('shipping/tracking_result');
157
-
158
- $tracking_status = Mage::getModel('shipping/tracking_result_status');
159
- $tracking_status->setCarrier($this->_code)
160
- ->setCarrierTitle($this->getConfigData('title'))
161
- ->setTracking($tracking_number)
162
- ->setUrl($tracking_url);
163
- $tracking_result->append($tracking_status);
164
-
165
- return $tracking_result;
166
- }
167
-
 
 
 
 
 
 
 
 
168
  }
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_Carrier_Pointsrelais extends Mage_Shipping_Model_Carrier_Abstract
3
+ {
4
+ protected $_code = 'pointsrelais';
5
+
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!$this->getConfigFlag('active')) {
9
+ return false;
10
+ }
11
+
12
+ // Permet de désactiver le module pour le multi-shipping
13
+
14
+ if (Mage::getSingleton('checkout/session')->getQuote()->getIsMultiShipping())
15
+ {
16
+ return false;
17
+ }
18
+
19
+ if (!$request->getConditionName()) {
20
+ $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
21
+ }
22
+
23
+ $result = Mage::getModel('shipping/rate_result');
24
+
25
+ $rates = $this->getRate($request);
26
+ $cartTmp = $request->_data['package_value_with_discount'];
27
+ $weghtTmp = $request->_data['package_weight'];
28
+
29
+ foreach($rates as $rate)
30
+ {
31
+ if (!empty($rate) && $rate['price'] >= 0)
32
+ {
33
+
34
+ /*---------------------------------------- Liste des points relais -----------------------------------------*/
35
+
36
+ // On met en place les paramètres de la requète
37
+ $params = array(
38
+ 'Enseigne' => $this->getConfigData('enseigne'),
39
+ 'Pays' => $request->_data['dest_country_id'],
40
+ 'CP' => $request->_data['dest_postcode'],
41
+ );
42
+
43
+ //On crée le code de sécurité
44
+ $code = implode("",$params);
45
+ $code .= $this->getConfigData('cle');
46
+
47
+ //On le rajoute aux paramètres
48
+ $params["Security"] = strtoupper(md5($code));
49
+
50
+ // On se connecte
51
+ $client = new SoapClient("http://www.mondialrelay.fr/WebService/Web_Services.asmx?WSDL");
52
+
53
+ // Et on effectue la requète
54
+ $points_relais = $client->WSI2_RecherchePointRelais($params)->WSI2_RecherchePointRelaisResult;
55
+
56
+
57
+ // On cr�e une m�thode de livraison par point relais
58
+ foreach( $points_relais as $point_relais ) {
59
+ if ( is_object($point_relais) && trim($point_relais->Num) != '' ) {
60
+
61
+ $method = Mage::getModel('shipping/rate_result_method');
62
+
63
+ $method->setCarrier('pointsrelais');
64
+ $method->setCarrierTitle($this->getConfigData('title'));
65
+
66
+ $methodTitle = $point_relais->LgAdr1 . ' - ' . $point_relais->Ville . ' <a href="#" onclick="PointsRelais.showInfo(\'' . $point_relais->Num . '\'); return false;">Détails</a> - <span style="display:none;" id="pays">' . $request->_data['dest_country_id'] . '</span>';
67
+ $method->setMethod($point_relais->Num);
68
+ $method->setMethodTitle($methodTitle);
69
+
70
+ // if($cartTmp > 34 && $weghtTmp > 0.101){
71
+ // $price = $rate['price'] = 0;
72
+ // $rate['cost'] = 0;
73
+ // $method->setPrice($price);
74
+ // $method->setCost($rate['cost']);
75
+ // }else{
76
+ $price = $rate['price'];
77
+ $method->setPrice($this->getFinalPriceWithHandlingFee($price));
78
+ $method->setCost($rate['cost']);
79
+ // }
80
+
81
+ $result->append($method);
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ return $result;
88
+ }
89
+
90
+ public function getRate(Mage_Shipping_Model_Rate_Request $request)
91
+ {
92
+ return Mage::getResourceModel('pointsrelais/carrier_pointsrelais')->getRate($request);
93
+ }
94
+
95
+ public function getCode($type, $code='')
96
+ {
97
+ $codes = array(
98
+
99
+ 'condition_name'=>array(
100
+ 'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
101
+ 'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
102
+ 'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
103
+ ),
104
+
105
+ 'condition_name_short'=>array(
106
+ 'package_weight' => Mage::helper('shipping')->__('Poids'),
107
+ 'package_value' => Mage::helper('shipping')->__('Valeur du panier'),
108
+ 'package_qty' => Mage::helper('shipping')->__('Nombre d\'articles'),
109
+ ),
110
+
111
+ );
112
+
113
+ if (!isset($codes[$type])) {
114
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code type: %s', $type));
115
+ }
116
+
117
+ if (''===$code) {
118
+ return $codes[$type];
119
+ }
120
+
121
+ if (!isset($codes[$type][$code])) {
122
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code for type %s: %s', $type, $code));
123
+ }
124
+
125
+ return $codes[$type][$code];
126
+ }
127
+
128
+ public function getAllowedMethods()
129
+ {
130
+ return array('pointsrelais'=>$this->getConfigData('name'));
131
+ }
132
+
133
+ public function isTrackingAvailable()
134
+ {
135
+ return true;
136
+ }
137
+
138
+ public function getTrackingInfo($tracking_number)
139
+ {
140
+ $tracking_result = $this->getTracking($tracking_number);
141
+
142
+ if ($tracking_result instanceof Mage_Shipping_Model_Tracking_Result)
143
+ {
144
+ if ($trackings = $tracking_result->getAllTrackings())
145
+ {
146
+ return $trackings[0];
147
+ }
148
+ }
149
+ elseif (is_string($tracking_result) && !empty($tracking_result))
150
+ {
151
+ return $tracking_result;
152
+ }
153
+
154
+ return false;
155
+ }
156
+
157
+ protected function getTracking($tracking_number)
158
+ {
159
+ $key = '<' . $this->getConfigData('marque_url') .'>' . $tracking_number . '<' . $this->getConfigData('cle_url') . '>';
160
+ $key = md5($key);
161
+
162
+ $tracking_url = 'http://www.mondialrelay.fr/lg_fr/espaces/url/popup_exp_details.aspx?cmrq=' . strtoupper($this->getConfigData('marque_url')) .'&nexp=' . strtoupper($tracking_number) . '&crc=' . strtoupper($key) ;
163
+
164
+ $tracking_result = Mage::getModel('shipping/tracking_result');
165
+
166
+ $tracking_status = Mage::getModel('shipping/tracking_result_status');
167
+ $tracking_status->setCarrier($this->_code)
168
+ ->setCarrierTitle($this->getConfigData('title'))
169
+ ->setTracking($tracking_number)
170
+ ->setUrl($tracking_url);
171
+ $tracking_result->append($tracking_status);
172
+
173
+ return $tracking_result;
174
+ }
175
+
176
  }
app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelais/Collection.php CHANGED
@@ -1,48 +1,48 @@
1
- <?php
2
- class MondialRelay_Pointsrelais_Model_Mysql4_Carrier_Pointsrelais_Collection extends Varien_Data_Collection_Db
3
- {
4
- protected $_shipTable;
5
- protected $_countryTable;
6
- protected $_regionTable;
7
-
8
- public function __construct()
9
- {
10
- parent::__construct(Mage::getSingleton('core/resource')->getConnection('shipping_read'));
11
-
12
- $this->_shipTable = Mage::getSingleton('core/resource')->getTableName('mondialrelay_pointsrelais');
13
-
14
- $this->_countryTable = Mage::getSingleton('core/resource')->getTableName('directory/country');
15
-
16
- $this->_regionTable = Mage::getSingleton('core/resource')->getTableName('directory/country_region');
17
-
18
- $this->_select->from(array("s" => $this->_shipTable))
19
- ->joinLeft(array("c" => $this->_countryTable), 'c.country_id = s.dest_country_id', 'iso3_code AS dest_country')
20
- ->joinLeft(array("r" => $this->_regionTable), 'r.region_id = s.dest_region_id', 'code AS dest_region')
21
- ->order(array("dest_country", "dest_region", "dest_zip"));
22
-
23
- $this->_setIdFieldName('id');
24
-
25
- return $this;
26
- }
27
-
28
- public function setWebsiteFilter($websiteId)
29
- {
30
- $this->_select->where("website_id = ?", $websiteId);
31
-
32
- return $this;
33
- }
34
-
35
- public function setConditionFilter($conditionName)
36
- {
37
- $this->_select->where("condition_name = ?", $conditionName);
38
-
39
- return $this;
40
- }
41
-
42
- public function setCountryFilter($countryId)
43
- {
44
- $this->_select->where("dest_country_id = ?", $countryId);
45
-
46
- return $this;
47
- }
48
  }
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_Mysql4_Carrier_Pointsrelais_Collection extends Varien_Data_Collection_Db
3
+ {
4
+ protected $_shipTable;
5
+ protected $_countryTable;
6
+ protected $_regionTable;
7
+
8
+ public function __construct()
9
+ {
10
+ parent::__construct(Mage::getSingleton('core/resource')->getConnection('shipping_read'));
11
+
12
+ $this->_shipTable = Mage::getSingleton('core/resource')->getTableName('mondialrelay_pointsrelais');
13
+
14
+ $this->_countryTable = Mage::getSingleton('core/resource')->getTableName('directory/country');
15
+
16
+ $this->_regionTable = Mage::getSingleton('core/resource')->getTableName('directory/country_region');
17
+
18
+ $this->_select->from(array("s" => $this->_shipTable))
19
+ ->joinLeft(array("c" => $this->_countryTable), 'c.country_id = s.dest_country_id', 'iso3_code AS dest_country')
20
+ ->joinLeft(array("r" => $this->_regionTable), 'r.region_id = s.dest_region_id', 'code AS dest_region')
21
+ ->order(array("dest_country", "dest_region", "dest_zip"));
22
+
23
+ $this->_setIdFieldName('id');
24
+
25
+ return $this;
26
+ }
27
+
28
+ public function setWebsiteFilter($websiteId)
29
+ {
30
+ $this->_select->where("website_id = ?", $websiteId);
31
+
32
+ return $this;
33
+ }
34
+
35
+ public function setConditionFilter($conditionName)
36
+ {
37
+ $this->_select->where("condition_name = ?", $conditionName);
38
+
39
+ return $this;
40
+ }
41
+
42
+ public function setCountryFilter($countryId)
43
+ {
44
+ $this->_select->where("dest_country_id = ?", $countryId);
45
+
46
+ return $this;
47
+ }
48
  }
app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Backend/Shipping/Pointsrelais.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
- class MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelais extends Mage_Core_Model_Config_Data
3
- {
4
- public function _afterSave()
5
- {
6
- Mage::getResourceModel('pointsrelais/carrier_pointsrelais')->uploadAndImport($this);
7
- }
8
- }
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelais extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function _afterSave()
5
+ {
6
+ Mage::getResourceModel('pointsrelais/carrier_pointsrelais')->uploadAndImport($this);
7
+ }
8
+ }
app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Source/Shipping/Pointsrelais.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- class MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelais
3
- {
4
- public function toOptionArray()
5
- {
6
- $tableRate = Mage::getSingleton('pointsrelais/carrier_pointsrelais');
7
- $arr = array();
8
-
9
- foreach ($tableRate->getCode('condition_name') as $k=>$v)
10
- {
11
- $arr[] = array('value'=>$k, 'label'=>$v);
12
- }
13
- return $arr;
14
- }
15
  }
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelais
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ $tableRate = Mage::getSingleton('pointsrelais/carrier_pointsrelais');
7
+ $arr = array();
8
+
9
+ foreach ($tableRate->getCode('condition_name') as $k=>$v)
10
+ {
11
+ $arr[] = array('value'=>$k, 'label'=>$v);
12
+ }
13
+ return $arr;
14
+ }
15
  }
app/code/community/MondialRelay/Pointsrelais/controllers/Sales/Order/ShipmentController.php CHANGED
@@ -69,37 +69,48 @@ class MondialRelay_Pointsrelais_Sales_Order_ShipmentController extends Mage_Admi
69
  {
70
  $adress[1] = '';
71
  }
 
 
 
 
72
  $params = array(
73
  'Enseigne' => $this->getConfigData('enseigne'),
74
  'ModeCol' => 'CCC',
75
  'ModeLiv' => '24R',
76
  'Expe_Langage' => 'FR',
77
- 'Expe_Ad1' => $this->getConfigData('adresse1_enseigne'),
78
- 'Expe_Ad3' => $this->getConfigData('adresse3_enseigne'),
79
- 'Expe_Ad4' => $this->getConfigData('adresse4_enseigne'),
80
- 'Expe_Ville' => $this->getConfigData('ville_enseigne'),
81
  'Expe_CP' => $this->getConfigData('cp_enseigne'),
82
- 'Expe_Pays' => $this->getConfigData('pays_enseigne'),
83
- 'Expe_Tel1' => $this->getConfigData('tel_enseigne'),
84
- 'Expe_Tel2' => $this->getConfigData('mobile_enseigne'),
85
  'Expe_Mail' => $this->getConfigData('mail_enseigne'),
86
  'Dest_Langage' => 'FR',
87
- 'Dest_Ad1' => $_order->getShippingAddress()->getFirstname() . ' ' . $_order->getShippingAddress()->getLastname(),
88
- 'Dest_Ad2' => $_order->getShippingAddress()->getCompagny(),
89
- 'Dest_Ad3' => $adress[0],
90
- 'Dest_Ad4' => $adress[1],
91
- 'Dest_Ville' => $_order->getShippingAddress()->getCity(),
92
  'Dest_CP' => $_order->getShippingAddress()->getPostcode(),
93
- 'Dest_Pays' => $_order->getShippingAddress()->getCountryId(),
94
- 'Dest_Tel1' => $_order->getShippingAddress()->getTelephone(),
95
  'Dest_Mail' => $_order->getCustomerEmail(),
96
- 'Poids' => $_order->getWeight()*1000,
97
  'NbColis' => '1',
98
  'CRT_Valeur' => '0',
99
  'LIV_Rel_Pays' => $_order->getShippingAddress()->getCountryId(),
100
  'LIV_Rel' => $_shippingMethod[1]
101
- );
102
  //On crée le code de sécurité
 
 
 
 
 
 
 
103
  $code = implode("",$params);
104
  $code .= $this->getConfigData('cle');
105
 
@@ -112,6 +123,7 @@ class MondialRelay_Pointsrelais_Sales_Order_ShipmentController extends Mage_Admi
112
  // Et on effectue la requète
113
  $expedition = $client->WSI2_CreationExpedition($params)->WSI2_CreationExpeditionResult;
114
 
 
115
  $track = Mage::getModel('sales/order_shipment_track')
116
  ->setNumber($expedition->ExpeditionNum)
117
  ->setCarrier('Mondial Relay')
@@ -134,7 +146,7 @@ class MondialRelay_Pointsrelais_Sales_Order_ShipmentController extends Mage_Admi
134
  $this->_saveShipment($shipment);
135
  $shipment->sendEmail(!empty($data['send_email']), $comment);
136
  $this->_getSession()->addSuccess($this->__('Shipment was successfully created.'));
137
- $this->_redirect('*/sales_order/view', array('order_id' => $shipment->getOrderId()));
138
  return;
139
  }
140
  else {
@@ -146,9 +158,21 @@ class MondialRelay_Pointsrelais_Sales_Order_ShipmentController extends Mage_Admi
146
  $this->_getSession()->addError($e->getMessage());
147
  }
148
  catch (Exception $e) {
149
- $this->_getSession()->addError($this->__('Can not save shipment.'));
150
  }
151
  $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
152
  }
153
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
69
  {
70
  $adress[1] = '';
71
  }
72
+ $package_weightTmp = $_order->getWeight()*1000;
73
+ if($package_weightTmp < 100){
74
+ $package_weightTmp = 100;
75
+ }
76
  $params = array(
77
  'Enseigne' => $this->getConfigData('enseigne'),
78
  'ModeCol' => 'CCC',
79
  'ModeLiv' => '24R',
80
  'Expe_Langage' => 'FR',
81
+ 'Expe_Ad1' => trim($this->removeaccents($this->getConfigData('adresse1_enseigne'))),
82
+ 'Expe_Ad3' => trim($this->removeaccents($this->getConfigData('adresse3_enseigne'))),
83
+ 'Expe_Ad4' => trim($this->removeaccents($this->getConfigData('adresse4_enseigne'))),
84
+ 'Expe_Ville' => trim($this->removeaccents($this->getConfigData('ville_enseigne'))),
85
  'Expe_CP' => $this->getConfigData('cp_enseigne'),
86
+ 'Expe_Pays' => trim($this->removeaccents($this->getConfigData('pays_enseigne'))),
87
+ 'Expe_Tel1' => '',
88
+ 'Expe_Tel2' => '',
89
  'Expe_Mail' => $this->getConfigData('mail_enseigne'),
90
  'Dest_Langage' => 'FR',
91
+ 'Dest_Ad1' => trim($this->removeaccents($_order->getShippingAddress()->getFirstname() . ' ' . $_order->getShippingAddress()->getLastname())),
92
+ 'Dest_Ad2' => trim($this->removeaccents($_order->getShippingAddress()->getCompagny())),
93
+ 'Dest_Ad3' => trim($this->removeaccents($adress[0])),
94
+ 'Dest_Ad4' => trim($this->removeaccents($adress[1])),
95
+ 'Dest_Ville' => trim($this->removeaccents($_order->getShippingAddress()->getCity())),
96
  'Dest_CP' => $_order->getShippingAddress()->getPostcode(),
97
+ 'Dest_Pays' => trim($this->removeaccents($_order->getShippingAddress()->getCountryId())),
98
+ 'Dest_Tel1' => '',
99
  'Dest_Mail' => $_order->getCustomerEmail(),
100
+ 'Poids' => $package_weightTmp,
101
  'NbColis' => '1',
102
  'CRT_Valeur' => '0',
103
  'LIV_Rel_Pays' => $_order->getShippingAddress()->getCountryId(),
104
  'LIV_Rel' => $_shippingMethod[1]
105
+ );//$_order->getWeight()*1000,
106
  //On crée le code de sécurité
107
+
108
+ $select = "";
109
+ foreach($params as $key => $value){
110
+ $select .= "\t".'<option value="'.$key.'">' . $value.'</option>'."\r\n";
111
+ }
112
+ Mage::Log('WSI2_CreationExpeditionResult$params : '.($select));
113
+
114
  $code = implode("",$params);
115
  $code .= $this->getConfigData('cle');
116
 
123
  // Et on effectue la requète
124
  $expedition = $client->WSI2_CreationExpedition($params)->WSI2_CreationExpeditionResult;
125
 
126
+ Mage::Log('WSI2_CreationExpeditionResult : '.($expedition->STAT));
127
  $track = Mage::getModel('sales/order_shipment_track')
128
  ->setNumber($expedition->ExpeditionNum)
129
  ->setCarrier('Mondial Relay')
146
  $this->_saveShipment($shipment);
147
  $shipment->sendEmail(!empty($data['send_email']), $comment);
148
  $this->_getSession()->addSuccess($this->__('Shipment was successfully created.'));
149
+ $this->_redirect('adminhtml/sales_order/view', array('order_id' => $shipment->getOrderId()));
150
  return;
151
  }
152
  else {
158
  $this->_getSession()->addError($e->getMessage());
159
  }
160
  catch (Exception $e) {
161
+ $this->_getSession()->addError($this->__('Can not save shipment: '.$e->getMessage()));
162
  }
163
  $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
164
  }
165
 
166
+ Function removeaccents($string){
167
+ $stringToReturn = str_replace(
168
+ array('�','�','�','�','�', '�', '�','�','�','�', '�','�','�','�', '�', '�','�','�','�','�', '�','�','�','�', '�','�', '�','�','�','�','�', '�', '�','�','�','�', '�','�','�','�', '�', '�','�','�','�','�', '�','�','�','�', '�','/','\xa8'),
169
+ 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);
170
+ // Remove all remaining other unknown characters
171
+ $stringToReturn = preg_replace('/[^a-zA-Z0-9\-]/', ' ', $stringToReturn);
172
+ $stringToReturn = preg_replace('/^[\-]+/', '', $stringToReturn);
173
+ $stringToReturn = preg_replace('/[\-]+$/', '', $stringToReturn);
174
+ $stringToReturn = preg_replace('/[\-]{2,}/', ' ', $stringToReturn);
175
+ return $stringToReturn;
176
+ }
177
+
178
  }
app/code/community/MondialRelay/Pointsrelais/etc/config.xml CHANGED
@@ -1,170 +1,176 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <MondialRelay_Pointsrelais>
5
- <version>1.0.2</version>
6
- <depends>
7
- <Mage_Adminhtml />
8
- <Mage_Shipping />
9
- </depends>
10
- </MondialRelay_Pointsrelais>
11
- </modules>
12
- <default>
13
- <carriers>
14
- <pointsrelais>
15
- <active>0</active>
16
- <sallowspecific>0</sallowspecific>
17
- <model>pointsrelais/carrier_pointsrelais</model>
18
- <title>Mondial Relay - Livraison en point relais</title>
19
- <specificerrmsg>L'expédition en Points Relais n'est pour le moment pas disponible. Si vous avez des questions concernant ce mode de livraison, merci de nous contacter.</specificerrmsg>
20
- <handling_type>F</handling_type>
21
- </pointsrelais>
22
- </carriers>
23
- </default>
24
- <global>
25
- <models>
26
- <pointsrelais>
27
- <class>MondialRelay_Pointsrelais_Model</class>
28
- <resourceModel>pointsrelais_mysql4</resourceModel>
29
- </pointsrelais>
30
- <pointsrelais_mysql4>
31
- <class>MondialRelay_Pointsrelais_Model_Mysql4</class>
32
- <entities>
33
- <pointsrelais>
34
- <table>mondialrelay_pointsrelais</table>
35
- </pointsrelais>
36
- </entities>
37
- </pointsrelais_mysql4>
38
- <adminhtml>
39
- <rewrite>
40
- <system_config_source_shipping_pointsrelais>MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelais</system_config_source_shipping_pointsrelais>
41
- </rewrite>
42
- <rewrite>
43
- <system_config_backend_shipping_pointsrelais>MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelais</system_config_backend_shipping_pointsrelais>
44
- </rewrite>
45
- </adminhtml>
46
- </models>
47
- <blocks>
48
- <pointsrelais>
49
- <class>MondialRelay_Pointsrelais_Block</class>
50
- </pointsrelais>
51
- <adminhtml>
52
- <rewrite>
53
- <system_config_form>MondialRelay_Pointsrelais_Block_System_Config_Form</system_config_form>
54
- <system_config_form_field_exportpointsrelais>MondialRelay_Pointsrelais_Block_System_Config_Form_Field_Exportpointsrelais</system_config_form_field_exportpointsrelais>
55
- <sales_order_shipment_view>MondialRelay_Pointsrelais_Block_Sales_Order_Shipment_View</sales_order_shipment_view>
56
- </rewrite>
57
- </adminhtml>
58
- </blocks>
59
- <resources>
60
- <pointsrelais_setup>
61
- <setup>
62
- <module>MondialRelay_Pointsrelais</module>
63
- </setup>
64
- <connection>
65
- <use>core_setup</use>
66
- </connection>
67
- </pointsrelais_setup>
68
- </resources>
69
- <helpers>
70
- <pointsrelais>
71
- <class>MondialRelay_Pointsrelais_Helper</class>
72
- </pointsrelais>
73
- </helpers>
74
- <rewrite>
75
- <mondialrelay_pointsrelais_sales_order_shipment>
76
- <from><![CDATA[#^/.*sales_order_shipment/#]]></from>
77
- <to>/pointsrelais/sales_order_shipment/</to>
78
- </mondialrelay_pointsrelais_sales_order_shipment>
79
- </rewrite>
80
- </global>
81
- <frontend>
82
- <events>
83
- <sales_convert_quote_address_to_order>
84
- <observers>
85
- <change_adress>
86
- <type>singleton</type>
87
- <class>MondialRelay_Pointsrelais_Model_Observer</class>
88
- <method>changeAddress</method>
89
- </change_adress>
90
- </observers>
91
- </sales_convert_quote_address_to_order>
92
- </events>
93
- <routers>
94
- <pointsrelais>
95
- <use>standard</use>
96
- <args>
97
- <module>MondialRelay_Pointsrelais</module>
98
- <frontName>pointsrelais</frontName>
99
- </args>
100
- </pointsrelais>
101
- </routers>
102
- <layout>
103
- <updates>
104
- <pointsrelais>
105
- <file>pointsrelais.xml</file>
106
- </pointsrelais>
107
- </updates>
108
- </layout>
109
- </frontend>
110
- <admin>
111
- <routers>
112
- <pointsrelais>
113
- <use>admin</use>
114
- <args>
115
- <module>MondialRelay_Pointsrelais</module>
116
- <frontName>pointsrelais</frontName>
117
- </args>
118
- </pointsrelais>
119
- </routers>
120
- </admin>
121
- <adminhtml>
122
- <menu>
123
- <sales translate="title" module="pointsrelais">
124
- <title>Sales</title>
125
- <sort_order>20</sort_order>
126
- <depends><module>Mage_Sales</module></depends>
127
- <children>
128
- <mondialrelay translate="title" module="sales">
129
- <title>Mondial Relay</title>
130
- <sort_order>31</sort_order>
131
- <children>
132
- <impression translate="title" module="sales">
133
- <title>Impression des étiquettes</title>
134
- <action>pointsrelais/sales_impression</action>
135
- <sort_order>10</sort_order>
136
- </impression>
137
- </children>
138
- </mondialrelay>
139
- </children>
140
- </sales>
141
- </menu>
142
- <acl>
143
- <resources>
144
- <admin>
145
- <children>
146
- <sales translate="title" module="sales">
147
- <title>Sales</title>
148
- <sort_order>20</sort_order>
149
- <children>
150
- <mondialrelay translate="title" module="sales">
151
- <title>Mondial Relay</title>
152
- <sort_order>31</sort_order>
153
- </mondialrelay>
154
- </children>
155
- </sales>
156
- </children>
157
- </admin>
158
- </resources>
159
- </acl>
160
- </adminhtml>
161
- <stores>
162
- <admin>
163
- <design>
164
- <theme>
165
- <default>mondialrelay</default>
166
- </theme>
167
- </design>
168
- </admin>
169
- </stores>
170
- </config>
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <MondialRelay_Pointsrelais>
5
+ <version>1.0.4</version>
6
+ <depends>
7
+ <Mage_Adminhtml />
8
+ <Mage_Shipping />
9
+ </depends>
10
+ </MondialRelay_Pointsrelais>
11
+ </modules>
12
+ <default>
13
+ <carriers>
14
+ <pointsrelais>
15
+ <active>0</active>
16
+ <sallowspecific>0</sallowspecific>
17
+ <model>pointsrelais/carrier_pointsrelais</model>
18
+ <title>Mondial Relay - Livraison en point relais</title>
19
+ <specificerrmsg>L'expédition en Points Relais n'est pour le moment pas disponible. Si vous avez des questions concernant ce mode de livraison, merci de nous contacter.</specificerrmsg>
20
+ <handling_type>F</handling_type>
21
+ </pointsrelais>
22
+ </carriers>
23
+ </default>
24
+ <global>
25
+ <models>
26
+ <pointsrelais>
27
+ <class>MondialRelay_Pointsrelais_Model</class>
28
+ <resourceModel>pointsrelais_mysql4</resourceModel>
29
+ </pointsrelais>
30
+ <pointsrelais_mysql4>
31
+ <class>MondialRelay_Pointsrelais_Model_Mysql4</class>
32
+ <entities>
33
+ <pointsrelais>
34
+ <table>mondialrelay_pointsrelais</table>
35
+ </pointsrelais>
36
+ </entities>
37
+ </pointsrelais_mysql4>
38
+ <adminhtml>
39
+ <rewrite>
40
+ <system_config_source_shipping_pointsrelais>MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelais</system_config_source_shipping_pointsrelais>
41
+ </rewrite>
42
+ <rewrite>
43
+ <system_config_backend_shipping_pointsrelais>MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelais</system_config_backend_shipping_pointsrelais>
44
+ </rewrite>
45
+ </adminhtml>
46
+ </models>
47
+ <blocks>
48
+ <pointsrelais>
49
+ <class>MondialRelay_Pointsrelais_Block</class>
50
+ </pointsrelais>
51
+ <adminhtml>
52
+ <rewrite>
53
+ <system_config_form>MondialRelay_Pointsrelais_Block_System_Config_Form</system_config_form>
54
+ <system_config_form_field_exportpointsrelais>MondialRelay_Pointsrelais_Block_System_Config_Form_Field_Exportpointsrelais</system_config_form_field_exportpointsrelais>
55
+ <sales_order_shipment_view>MondialRelay_Pointsrelais_Block_Sales_Order_Shipment_View</sales_order_shipment_view>
56
+ </rewrite>
57
+ </adminhtml>
58
+ </blocks>
59
+ <resources>
60
+ <pointsrelais_setup>
61
+ <setup>
62
+ <module>MondialRelay_Pointsrelais</module>
63
+ </setup>
64
+ <connection>
65
+ <use>core_setup</use>
66
+ </connection>
67
+ </pointsrelais_setup>
68
+ </resources>
69
+ <helpers>
70
+ <pointsrelais>
71
+ <class>MondialRelay_Pointsrelais_Helper</class>
72
+ </pointsrelais>
73
+ </helpers>
74
+ <rewrite>
75
+ <mondialrelay_pointsrelais_sales_order_shipment>
76
+ <from><![CDATA[#^/.*sales_order_shipment/save/#]]></from>
77
+ <to>/pointsrelais/sales_order_shipment/save/</to>
78
+ </mondialrelay_pointsrelais_sales_order_shipment>
79
+ </rewrite>
80
+ </global>
81
+ <frontend>
82
+ <events>
83
+ <sales_convert_quote_address_to_order>
84
+ <observers>
85
+ <change_adress>
86
+ <type>singleton</type>
87
+ <class>MondialRelay_Pointsrelais_Model_Observer</class>
88
+ <method>changeAddress</method>
89
+ </change_adress>
90
+ </observers>
91
+ </sales_convert_quote_address_to_order>
92
+ </events>
93
+ <routers>
94
+ <pointsrelais>
95
+ <use>standard</use>
96
+ <args>
97
+ <module>MondialRelay_Pointsrelais</module>
98
+ <frontName>pointsrelais</frontName>
99
+ </args>
100
+ </pointsrelais>
101
+ </routers>
102
+ <layout>
103
+ <updates>
104
+ <pointsrelais>
105
+ <file>pointsrelais.xml</file>
106
+ </pointsrelais>
107
+ </updates>
108
+ </layout>
109
+ </frontend>
110
+ <admin>
111
+ <routers>
112
+ <pointsrelais>
113
+ <use>admin</use>
114
+ <args>
115
+ <module>MondialRelay_Pointsrelais</module>
116
+ <frontName>pointsrelais</frontName>
117
+ </args>
118
+ </pointsrelais>
119
+ </routers>
120
+ </admin>
121
+ <adminhtml>
122
+ <menu>
123
+ <sales translate="title" module="pointsrelais">
124
+ <title>Sales</title>
125
+ <sort_order>20</sort_order>
126
+ <depends><module>Mage_Sales</module></depends>
127
+ <children>
128
+ <mondialrelay translate="title" module="sales">
129
+ <title>Mondial Relay</title>
130
+ <sort_order>31</sort_order>
131
+ <children>
132
+ <impression translate="title" module="sales">
133
+ <title>Impression des étiquettes</title>
134
+ <action>pointsrelais/sales_impression</action>
135
+ <sort_order>10</sort_order>
136
+ </impression>
137
+ </children>
138
+ </mondialrelay>
139
+ </children>
140
+ </sales>
141
+ </menu>
142
+ <acl>
143
+ <resources>
144
+ <admin>
145
+ <children>
146
+ <sales translate="title" module="sales">
147
+ <title>Sales</title>
148
+ <sort_order>20</sort_order>
149
+ <children>
150
+ <mondialrelay translate="title" module="sales">
151
+ <title>Mondial Relay</title>
152
+ <sort_order>31</sort_order>
153
+ <children>
154
+ <impression translate="title" module="sales">
155
+ <title>Impression des étiquettes</title>
156
+ <sort_order>10</sort_order>
157
+ </impression>
158
+ </children>
159
+ </mondialrelay>
160
+ </children>
161
+ </sales>
162
+ </children>
163
+ </admin>
164
+ </resources>
165
+ </acl>
166
+ </adminhtml>
167
+ <stores>
168
+ <admin>
169
+ <design>
170
+ <theme>
171
+ <default>mondialrelay</default>
172
+ </theme>
173
+ </design>
174
+ </admin>
175
+ </stores>
176
+ </config>
app/code/community/MondialRelay/Pointsrelais/etc/system.xml CHANGED
@@ -1,226 +1,242 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <sections>
4
- <carriers>
5
- <groups>
6
- <pointsrelais translate="label" module="shipping">
7
- <label>Mondial Relay</label>
8
- <frontend_type>text</frontend_type>
9
- <sort_order>1</sort_order>
10
- <show_in_default>1</show_in_default>
11
- <show_in_website>1</show_in_website>
12
- <show_in_store>1</show_in_store>
13
- <fields>
14
- <active translate="label">
15
- <label>Enabled</label>
16
- <frontend_type>select</frontend_type>
17
- <source_model>adminhtml/system_config_source_yesno</source_model>
18
- <sort_order>1</sort_order>
19
- <show_in_default>1</show_in_default>
20
- <show_in_website>1</show_in_website>
21
- <show_in_store>1</show_in_store>
22
- </active>
23
- <enseigne translate="label">
24
- <label>Enseigne</label>
25
- <frontend_type>text</frontend_type>
26
- <sort_order>3</sort_order>
27
- <show_in_default>1</show_in_default>
28
- <show_in_website>1</show_in_website>
29
- <show_in_store>1</show_in_store>
30
- </enseigne>
31
- <marque translate="label">
32
- <label>Référence de marque</label>
33
- <frontend_type>text</frontend_type>
34
- <sort_order>3</sort_order>
35
- <show_in_default>1</show_in_default>
36
- <show_in_website>1</show_in_website>
37
- <show_in_store>1</show_in_store>
38
- </marque>
39
- <cle translate="label">
40
- <label>Clé</label>
41
- <frontend_type>text</frontend_type>
42
- <sort_order>4</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
- </cle>
47
- <adresse1_enseigne translate="label">
48
- <label>Nom de l'expéditeur</label>
49
- <comment>Sans accent svp...</comment>
50
- <frontend_type>text</frontend_type>
51
- <sort_order>5</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
- </adresse1_enseigne>
56
- <adresse3_enseigne translate="label">
57
- <label>Adresse de l'expéditeur</label>
58
- <frontend_type>text</frontend_type>
59
- <sort_order>6</sort_order>
60
- <show_in_default>1</show_in_default>
61
- <show_in_website>1</show_in_website>
62
- <show_in_store>1</show_in_store>
63
- </adresse3_enseigne>
64
- <adresse4_enseigne translate="label">
65
- <label>Complément d'adresse</label>
66
- <frontend_type>text</frontend_type>
67
- <sort_order>7</sort_order>
68
- <show_in_default>1</show_in_default>
69
- <show_in_website>1</show_in_website>
70
- <show_in_store>1</show_in_store>
71
- </adresse4_enseigne>
72
- <adresse4_enseigne translate="label">
73
- <label>Complément d'adresse</label>
74
- <frontend_type>text</frontend_type>
75
- <sort_order>8</sort_order>
76
- <show_in_default>1</show_in_default>
77
- <show_in_website>1</show_in_website>
78
- <show_in_store>1</show_in_store>
79
- </adresse4_enseigne>
80
- <cp_enseigne translate="label">
81
- <label>Code postal</label>
82
- <frontend_type>text</frontend_type>
83
- <sort_order>9</sort_order>
84
- <show_in_default>1</show_in_default>
85
- <show_in_website>1</show_in_website>
86
- <show_in_store>1</show_in_store>
87
- </cp_enseigne>
88
- <ville_enseigne translate="label">
89
- <label>Ville de l'expéditeur</label>
90
- <frontend_type>text</frontend_type>
91
- <sort_order>10</sort_order>
92
- <show_in_default>1</show_in_default>
93
- <show_in_website>1</show_in_website>
94
- <show_in_store>1</show_in_store>
95
- </ville_enseigne>
96
- <pays_enseigne translate="label">
97
- <label>Code Pays de l'expéditeur</label>
98
- <comment>FR, BE, etc...</comment>
99
- <frontend_type>text</frontend_type>
100
- <sort_order>11</sort_order>
101
- <show_in_default>1</show_in_default>
102
- <show_in_website>1</show_in_website>
103
- <show_in_store>1</show_in_store>
104
- </pays_enseigne>
105
- <tel_enseigne translate="label">
106
- <label>Téléphone</label>
107
- <frontend_type>text</frontend_type>
108
- <sort_order>12</sort_order>
109
- <show_in_default>1</show_in_default>
110
- <show_in_website>1</show_in_website>
111
- <show_in_store>1</show_in_store>
112
- </tel_enseigne>
113
- <mobile_enseigne translate="label">
114
- <label>Mobile</label>
115
- <comment>Facultatif</comment>
116
- <frontend_type>text</frontend_type>
117
- <sort_order>13</sort_order>
118
- <show_in_default>1</show_in_default>
119
- <show_in_website>1</show_in_website>
120
- <show_in_store>1</show_in_store>
121
- </mobile_enseigne>
122
- <mail_enseigne translate="label">
123
- <label>E-mail</label>
124
- <comment>Facultatif</comment>
125
- <frontend_type>text</frontend_type>
126
- <sort_order>14</sort_order>
127
- <show_in_default>1</show_in_default>
128
- <show_in_website>1</show_in_website>
129
- <show_in_store>1</show_in_store>
130
- </mail_enseigne>
131
- <handling_type translate="label">
132
- <label>Calculate Handling Fee</label>
133
- <frontend_type>select</frontend_type>
134
- <source_model>shipping/source_handlingType</source_model>
135
- <sort_order>20</sort_order>
136
- <show_in_default>1</show_in_default>
137
- <show_in_website>1</show_in_website>
138
- <show_in_store>0</show_in_store>
139
- </handling_type>
140
- <handling_fee translate="label">
141
- <label>Handling Fee</label>
142
- <frontend_type>text</frontend_type>
143
- <sort_order>21</sort_order>
144
- <show_in_default>1</show_in_default>
145
- <show_in_website>1</show_in_website>
146
- <show_in_store>1</show_in_store>
147
- </handling_fee>
148
- <import translate="label">
149
- <label>Import</label>
150
- <comment>Vous permet d'importer le fichier de configuration des prix de livraison</comment>
151
- <frontend_type>import</frontend_type>
152
- <backend_model>adminhtml/system_config_backend_shipping_pointsrelais</backend_model>
153
- <sort_order>22</sort_order>
154
- <show_in_default>0</show_in_default>
155
- <show_in_website>1</show_in_website>
156
- <show_in_store>0</show_in_store>
157
- </import>
158
- <export translate="label">
159
- <label>Export</label>
160
- <comment>Vous permet d'exporter le fichier de configuration des prix de livraison</comment>
161
- <frontend_type>export_pointsrelais</frontend_type>
162
- <sort_order>23</sort_order>
163
- <show_in_default>0</show_in_default>
164
- <show_in_website>1</show_in_website>
165
- <show_in_store>0</show_in_store>
166
- </export>
167
- <condition_name translate="label">
168
- <label>Condition</label>
169
- <frontend_type>select</frontend_type>
170
- <comment>Lors d'un changement de condition, enregistrez la modification, puis vérifier le fichier de configuration des prix de livraison.</comment>
171
- <source_model>adminhtml/system_config_source_shipping_pointsrelais</source_model>
172
- <sort_order>24</sort_order>
173
- <show_in_default>0</show_in_default>
174
- <show_in_website>1</show_in_website>
175
- <show_in_store>0</show_in_store>
176
- </condition_name>
177
- <sallowspecific translate="label">
178
- <label>Ship to applicable countries</label>
179
- <frontend_type>select</frontend_type>
180
- <sort_order>30</sort_order>
181
- <frontend_class>shipping-applicable-country</frontend_class>
182
- <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
183
- <show_in_default>1</show_in_default>
184
- <show_in_website>1</show_in_website>
185
- <show_in_store>1</show_in_store>
186
- </sallowspecific>
187
- <specificcountry translate="label">
188
- <label>Ship to Specific countries</label>
189
- <frontend_type>multiselect</frontend_type>
190
- <sort_order>31</sort_order>
191
- <source_model>adminhtml/system_config_source_country</source_model>
192
- <show_in_default>1</show_in_default>
193
- <show_in_website>1</show_in_website>
194
- <show_in_store>1</show_in_store>
195
- </specificcountry>
196
- <showmethod translate="label">
197
- <label>Show method if not applicable</label>
198
- <frontend_type>select</frontend_type>
199
- <sort_order>40</sort_order>
200
- <source_model>adminhtml/system_config_source_yesno</source_model>
201
- <show_in_default>1</show_in_default>
202
- <show_in_website>1</show_in_website>
203
- <show_in_store>1</show_in_store>
204
- </showmethod>
205
- <specificerrmsg translate="label">
206
- <label>Displayed Error Message</label>
207
- <frontend_type>textarea</frontend_type>
208
- <sort_order>41</sort_order>
209
- <show_in_default>1</show_in_default>
210
- <show_in_website>1</show_in_website>
211
- <show_in_store>1</show_in_store>
212
- </specificerrmsg>
213
- <sort_order translate="label">
214
- <label>Sort order</label>
215
- <frontend_type>text</frontend_type>
216
- <sort_order>100</sort_order>
217
- <show_in_default>1</show_in_default>
218
- <show_in_website>1</show_in_website>
219
- <show_in_store>1</show_in_store>
220
- </sort_order>
221
- </fields>
222
- </pointsrelais>
223
- </groups>
224
- </carriers>
225
- </sections>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <carriers>
5
+ <groups>
6
+ <pointsrelais translate="label" module="shipping">
7
+ <label>Mondial Relay</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>1</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>1</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ </active>
23
+ <enseigne translate="label">
24
+ <label>Enseigne</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>2</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </enseigne>
31
+ <marque translate="label">
32
+ <label>Référence de marque (Web service)</label>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>3</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ </marque>
39
+ <cle translate="label">
40
+ <label>Clé (Web service)</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>4</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
+ </cle>
47
+ <marque_url translate="label">
48
+ <label>Référence de marque (tracking)</label>
49
+ <frontend_type>text</frontend_type>
50
+ <sort_order>5</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ </marque_url>
55
+ <cle_url translate="label">
56
+ <label>Clé (tracking)</label>
57
+ <frontend_type>text</frontend_type>
58
+ <sort_order>6</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </cle_url>
63
+ <adresse1_enseigne translate="label">
64
+ <label>Nom de l'expéditeur</label>
65
+ <comment>Sans accent svp...</comment>
66
+ <frontend_type>text</frontend_type>
67
+ <sort_order>7</sort_order>
68
+ <show_in_default>1</show_in_default>
69
+ <show_in_website>1</show_in_website>
70
+ <show_in_store>1</show_in_store>
71
+ </adresse1_enseigne>
72
+ <adresse3_enseigne translate="label">
73
+ <label>Adresse de l'expéditeur</label>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>8</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ </adresse3_enseigne>
80
+ <adresse4_enseigne translate="label">
81
+ <label>Complément d'adresse</label>
82
+ <frontend_type>text</frontend_type>
83
+ <sort_order>9</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </adresse4_enseigne>
88
+ <adresse4_enseigne translate="label">
89
+ <label>Complément d'adresse</label>
90
+ <frontend_type>text</frontend_type>
91
+ <sort_order>10</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>
95
+ </adresse4_enseigne>
96
+ <cp_enseigne translate="label">
97
+ <label>Code postal</label>
98
+ <frontend_type>text</frontend_type>
99
+ <sort_order>11</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ </cp_enseigne>
104
+ <ville_enseigne translate="label">
105
+ <label>Ville de l'expéditeur</label>
106
+ <frontend_type>text</frontend_type>
107
+ <sort_order>12</sort_order>
108
+ <show_in_default>1</show_in_default>
109
+ <show_in_website>1</show_in_website>
110
+ <show_in_store>1</show_in_store>
111
+ </ville_enseigne>
112
+ <pays_enseigne translate="label">
113
+ <label>Code Pays de l'expéditeur</label>
114
+ <comment>FR, BE, etc...</comment>
115
+ <frontend_type>text</frontend_type>
116
+ <sort_order>13</sort_order>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>1</show_in_website>
119
+ <show_in_store>1</show_in_store>
120
+ </pays_enseigne>
121
+ <tel_enseigne translate="label">
122
+ <label>Téléphone</label>
123
+ <frontend_type>text</frontend_type>
124
+ <sort_order>14</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>1</show_in_website>
127
+ <show_in_store>1</show_in_store>
128
+ </tel_enseigne>
129
+ <mobile_enseigne translate="label">
130
+ <label>Mobile</label>
131
+ <comment>Facultatif</comment>
132
+ <frontend_type>text</frontend_type>
133
+ <sort_order>15</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>1</show_in_store>
137
+ </mobile_enseigne>
138
+ <mail_enseigne translate="label">
139
+ <label>E-mail</label>
140
+ <comment>Facultatif</comment>
141
+ <frontend_type>text</frontend_type>
142
+ <sort_order>16</sort_order>
143
+ <show_in_default>1</show_in_default>
144
+ <show_in_website>1</show_in_website>
145
+ <show_in_store>1</show_in_store>
146
+ </mail_enseigne>
147
+ <handling_type translate="label">
148
+ <label>Calculate Handling Fee</label>
149
+ <frontend_type>select</frontend_type>
150
+ <source_model>shipping/source_handlingType</source_model>
151
+ <sort_order>20</sort_order>
152
+ <show_in_default>1</show_in_default>
153
+ <show_in_website>1</show_in_website>
154
+ <show_in_store>0</show_in_store>
155
+ </handling_type>
156
+ <handling_fee translate="label">
157
+ <label>Handling Fee</label>
158
+ <frontend_type>text</frontend_type>
159
+ <sort_order>21</sort_order>
160
+ <show_in_default>1</show_in_default>
161
+ <show_in_website>1</show_in_website>
162
+ <show_in_store>1</show_in_store>
163
+ </handling_fee>
164
+ <import translate="label">
165
+ <label>Import</label>
166
+ <comment>Vous permet d'importer le fichier de configuration des prix de livraison</comment>
167
+ <frontend_type>import</frontend_type>
168
+ <backend_model>adminhtml/system_config_backend_shipping_pointsrelais</backend_model>
169
+ <sort_order>22</sort_order>
170
+ <show_in_default>0</show_in_default>
171
+ <show_in_website>1</show_in_website>
172
+ <show_in_store>0</show_in_store>
173
+ </import>
174
+ <export translate="label">
175
+ <label>Export</label>
176
+ <comment>Vous permet d'exporter le fichier de configuration des prix de livraison</comment>
177
+ <frontend_type>export_pointsrelais</frontend_type>
178
+ <sort_order>23</sort_order>
179
+ <show_in_default>0</show_in_default>
180
+ <show_in_website>1</show_in_website>
181
+ <show_in_store>0</show_in_store>
182
+ </export>
183
+ <condition_name translate="label">
184
+ <label>Condition</label>
185
+ <frontend_type>select</frontend_type>
186
+ <comment>Lors d'un changement de condition, enregistrez la modification, puis vérifier le fichier de configuration des prix de livraison.</comment>
187
+ <source_model>adminhtml/system_config_source_shipping_pointsrelais</source_model>
188
+ <sort_order>24</sort_order>
189
+ <show_in_default>0</show_in_default>
190
+ <show_in_website>1</show_in_website>
191
+ <show_in_store>0</show_in_store>
192
+ </condition_name>
193
+ <sallowspecific translate="label">
194
+ <label>Ship to applicable countries</label>
195
+ <frontend_type>select</frontend_type>
196
+ <sort_order>30</sort_order>
197
+ <frontend_class>shipping-applicable-country</frontend_class>
198
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
199
+ <show_in_default>1</show_in_default>
200
+ <show_in_website>1</show_in_website>
201
+ <show_in_store>1</show_in_store>
202
+ </sallowspecific>
203
+ <specificcountry translate="label">
204
+ <label>Ship to Specific countries</label>
205
+ <frontend_type>multiselect</frontend_type>
206
+ <sort_order>31</sort_order>
207
+ <source_model>adminhtml/system_config_source_country</source_model>
208
+ <show_in_default>1</show_in_default>
209
+ <show_in_website>1</show_in_website>
210
+ <show_in_store>1</show_in_store>
211
+ </specificcountry>
212
+ <showmethod translate="label">
213
+ <label>Show method if not applicable</label>
214
+ <frontend_type>select</frontend_type>
215
+ <sort_order>40</sort_order>
216
+ <source_model>adminhtml/system_config_source_yesno</source_model>
217
+ <show_in_default>1</show_in_default>
218
+ <show_in_website>1</show_in_website>
219
+ <show_in_store>1</show_in_store>
220
+ </showmethod>
221
+ <specificerrmsg translate="label">
222
+ <label>Displayed Error Message</label>
223
+ <frontend_type>textarea</frontend_type>
224
+ <sort_order>41</sort_order>
225
+ <show_in_default>1</show_in_default>
226
+ <show_in_website>1</show_in_website>
227
+ <show_in_store>1</show_in_store>
228
+ </specificerrmsg>
229
+ <sort_order translate="label">
230
+ <label>Sort order</label>
231
+ <frontend_type>text</frontend_type>
232
+ <sort_order>100</sort_order>
233
+ <show_in_default>1</show_in_default>
234
+ <show_in_website>1</show_in_website>
235
+ <show_in_store>1</show_in_store>
236
+ </sort_order>
237
+ </fields>
238
+ </pointsrelais>
239
+ </groups>
240
+ </carriers>
241
+ </sections>
242
  </config>
app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/mysql4-update-1.0.4.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+ $storesData = $installer->getConnection()->fetchAll("
6
+ SELECT
7
+ DISTINCT (s.website_id)
8
+ FROM
9
+ {$installer->getTable('core/store')} as s,
10
+ {$this->getTable('mondialrelay_pointsrelais')} as mr
11
+ WHERE
12
+ s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelais')})
13
+ ");
14
+
15
+ foreach ($storesData as $storeData) {
16
+ $websiteId = $storeData['website_id'];
17
+ $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelais')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
18
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 0.5000, 4.2000, 4.2000),
19
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 1.0000, 4.2000, 4.2000),
20
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 2.0000, 5.5000, 5.5000),
21
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 3.0000, 6.2000, 6.2000),
22
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 5.0000, 7.5000, 7.5000),
23
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 7.0000, 9.6000, 9.6000),
24
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 10.0000, 11.9500, 11.9500),
25
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 15.0000, 14.3500, 14.3500),
26
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 20.0000, 17.9500, 17.9500),
27
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 0.5000, 4.2000, 4.2000),
28
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 1.0000, 4.8000, 4.8000),
29
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 2.0000, 5.5000, 5.5000),
30
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 3.0000, 6.2000, 6.2000),
31
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 5.0000, 7.5000, 7.5000),
32
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 7.0000, 9.6000, 9.6000),
33
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 10.0000, 11.9500, 11.9500),
34
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 15.0000, 14.3500, 14.3500),
35
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 20.0000, 17.9500, 17.9500);
36
+ ";
37
+ $installer->run($query);
38
+ }
39
+
40
+ $installer->endSetup();
app/design/adminhtml/default/mondialrelay/template/sales/order/shipment/create/form.phtml DELETED
@@ -1,87 +0,0 @@
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_default
22
- * @package Mage
23
- * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">
28
- <?php echo $this->getBlockHtml('formkey')?>
29
- <?php $_order = $this->getShipment()->getOrder() ?>
30
- <?php $_shippingMethod = explode("_",$_order->getShippingMethod()); ?>
31
- <?php echo $this->getChildHtml('order_info') ?>
32
-
33
-
34
- <div class="box-left">
35
- <!--Billing Address-->
36
- <div class="entry-edit">
37
- <div class="entry-edit-head">
38
- <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
39
- </div>
40
- <fieldset>
41
- <div><?php echo $this->getPaymentHtml() ?></div>
42
- <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
43
- </fieldset>
44
- </div>
45
- </div>
46
- <div class="box-right">
47
- <!--Shipping Address-->
48
- <div class="entry-edit">
49
- <div class="entry-edit-head">
50
- <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping Information') ?></h4>
51
- </div>
52
- <fieldset>
53
- <div>
54
- <strong><?php echo $_order->getShippingDescription() ?></strong>
55
- <?php echo $this->helper('sales')->__('Total Shipping Charges'); ?>:
56
-
57
- <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
58
- <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
59
- <?php else: ?>
60
- <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
61
- <?php endif; ?>
62
- <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
63
-
64
- <?php echo $_excl; ?>
65
- <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
66
- (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
67
- <?php endif; ?>
68
- </div>
69
- <?php if ($_shippingMethod[0] == 'pointsrelais') : ?>
70
- <div><?php echo $this->helper('pointsrelais')->__('Le numéro de tracking sera ajouté automatiquement'); ?></div>
71
- <?php else: ?>
72
- <div><?php echo $this->getChildHtml('shipment_tracking') ?></div>
73
- <?php endif; ?>
74
- </fieldset>
75
- </div>
76
- </div>
77
- <div class="clear"></div>
78
-
79
- <div class="entry-edit">
80
- <div class="entry-edit-head">
81
- <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items to Ship') ?></h4>
82
- </div>
83
- </div>
84
- <div id="ship_items_container">
85
- <?php echo $this->getItemsHtml() ?>
86
- </div>
87
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/pointsrelais/info.phtml CHANGED
@@ -4,7 +4,9 @@
4
  $detail_pointrelais = $this->getDetailPointRelais();
5
 
6
  ?>
 
7
  <div id="backgroundLighbox" style="height: <?php echo $this->getRequest()->getPost('hauteur') ?>px; width: <?php echo $this->getRequest()->getPost('largeur') ?>px; " ></div>
 
8
  <div id="detailsPointRelais"">
9
  <div class="colonne-gauche">
10
  <h1><?php echo $this->__('Votre') ?> <span style="font-weight: bold;"><?php echo $this->__('Point Relais') ?></span></h1>
@@ -150,7 +152,14 @@ $detail_pointrelais = $this->getDetailPointRelais();
150
  $errors[] = $e->getMessage();
151
  }?>
152
  </table>
153
- </div><div class="fermer"><a href="#" onclick="PointsRelais.fermer(); return false;">Fermer</a></div>
 
 
 
 
154
  </div>
155
-
156
- </div>
 
 
 
4
  $detail_pointrelais = $this->getDetailPointRelais();
5
 
6
  ?>
7
+ <?php if ($this->getRequest()->getPost('popup_relais') != 1):?>
8
  <div id="backgroundLighbox" style="height: <?php echo $this->getRequest()->getPost('hauteur') ?>px; width: <?php echo $this->getRequest()->getPost('largeur') ?>px; " ></div>
9
+ <?php endif;?>
10
  <div id="detailsPointRelais"">
11
  <div class="colonne-gauche">
12
  <h1><?php echo $this->__('Votre') ?> <span style="font-weight: bold;"><?php echo $this->__('Point Relais') ?></span></h1>
152
  $errors[] = $e->getMessage();
153
  }?>
154
  </table>
155
+ <?php if ($this->getRequest()->getPost('popup_relais') == 1):?>
156
+ <div class="fermer"><a href="#" onclick="window.close(); return false;">Fermer</a></div>
157
+ <?php else:?>
158
+ <div class="fermer"><a href="#" onclick="PointsRelais.fermer(); return false;">Fermer</a></div>
159
+ <?php endif;?>
160
  </div>
161
+
162
+ <?php if ($this->getRequest()->getPost('popup_relais') == 1):?>
163
+ </body>
164
+ </html>
165
+ <?php endif;?>
app/etc/modules/MondialRelay_All.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <MondialRelay_Pointsrelais>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </MondialRelay_Pointsrelais>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/locale/fr_FR/MondialRelay_Pointsrelais.csv ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Point Relais","Point Relais"
2
+ "Plan d\'acc̬s au magasin","Plan d\'acc̬s au magasin"
3
+ "Horaires d\'ouverture","Horaires d\'ouverture"
4
+ "Lundi","Lundi"
5
+ "Mardi","Mardi"
6
+ "Mercredi","Mercredi"
7
+ "Jeudi","Jeudi"
8
+ "Vendredi","Vendredi"
9
+ "Samedi","Samedi"
10
+ "Dimanche","Dimanche"
11
+ "Fermer","Fermer"
12
+ "Le num̩ro de tracking sera ajout̩ automatiquement","Le num̩ro de tracking sera ajout̩ automatiquement"
13
+ "Impressions des ̩tiquettes Mondial Relay","Impressions des ̩tiquettes Mondial Relay"
14
+ Etiquette Mondial Relay","Etiquette Mondial Relay"
15
+ "Etiquettes","Etiquettes"
16
+ "Imprimer","Imprimer"
17
+ "Imprimer les ̩tiquettes","Imprimer les ̩tiquettes"
18
+ "D̩sol̩, une erreure est survenu lors de la r̩cup̩ration de l\'̩tiquetes. Merci de contacter Mondial Relay ou de r̩essayer plus tard","D̩sol̩, une erreure est survenu lors de la r̩cup̩ration de l\'̩tiquetes. Merci de contacter Mondial Relay ou de r̩essayer plus tard"
package.xml CHANGED
@@ -1,18 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MondialRelay_Pointsrelais</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
- <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Module de livraison Mondial Relay</summary>
10
- <description>Ce module permet de proposer dans votre magasin la livraison dans les points relais partenaires du r&#xE9;seau Mondial Relay.</description>
11
- <notes>Passage en production</notes>
12
- <authors><author><name>Nicolas Trossat</name><user>auto-converted</user><email>nicolas.trossat@boutik-circus.fr</email></author><author><name>Mondial Relay</name><user>auto-converted</user><email>phallynck@mondialrelay.fr</email></author></authors>
13
- <date>2009-11-26</date>
14
- <time>16:34:53</time>
15
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="mondialrelay"><dir name="template"><dir name="sales"><dir name="order"><dir name="shipment"><dir name="create"><file name="form.phtml" hash="157d5f868ccd35136d3bf613ce599bc6"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="pointsrelais.xml" hash="cecd44caa45a4124f3ed64a36137fd17"/></dir><dir name="template"><dir name="pointsrelais"><file name="baseurl.phtml" hash="ddbe6d60de42248171c32ac6279ae46d"/><file name="info.phtml" hash="024efd2edc54816d47a5c085e30121d6"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="iepointsrelais.css" hash="844941deecd4374838a4895a7175cb24"/><file name="pointsrelais.css" hash="229d09977ee2eac2e72dcb89bf8eb05c"/></dir><dir name="images"><dir name="mondialrelay"><file name="img_fermer.gif" hash="5901eaf779aa6fa3eac84d1dd9520113"/><file name="img_fleche.gif" hash="908f8a69124b7b16e3ec2caefc78d948"/><file name="logo_PR_01.gif" hash="7066eb60e2645b304d1b926d0a4c31e2"/></dir></dir><dir name="js"><file name="pointsrelais.js" hash="12f44226490155d81cdfc12b8871aa1a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MondialRelay_All.xml" hash="8257e76c52b260553f8ce663c2a8b3d1"/></dir></target><target name="magecommunity"><dir name="MondialRelay"><dir name="Pointsrelais"><dir name="Block"><dir name="Sales"><dir name="Order"><dir name="Shipment"><file name="View.php" hash="913bad19edb072f54a3037fa2a860e5e"/></dir></dir><dir name="Shipment"><file name="Grid.php" hash="5b2c413145a1d077bd7503ef8302a0a2"/></dir><file name="Impression.php" hash="0685fabf03cb81a76a643e2fbc7d90bd"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Exportpointsrelais.php" hash="e55ace0129fe156dbeb32a341d384d6a"/></dir></dir><file name="Form.php" hash="3964ae1c690e49d626ed362290fb68a2"/></dir></dir><file name="Info.php" hash="d24bd6bcffe1eae00144d320f595d40d"/></dir><dir name="controllers"><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="8864cf1acf33a9236816800f0c8cc313"/></dir><file name="ImpressionController.php" hash="3d4201841e0dfc10f96f5f4a77d5f214"/></dir><dir name="System"><file name="ConfigController.php" hash="495f6d405adf5fba5a32570a56b3770f"/></dir><file name="IndexController.php" hash="0b3068c6075d1ad50f32f802a91bdf38"/></dir><dir name="etc"><file name="config.xml" hash="e4e1465af133a2f846c9f11858f6fdfe"/><file name="system.xml" hash="fed92bbb0b575e65b70c3b807b3c88c8"/></dir><dir name="Helper"><file name="Data.php" hash="e81c10d80df89ecbd51715672c710d3e"/></dir><dir name="Model"><dir name="Carrier"><file name="Pointsrelais.php" hash="4604ce736ad5bcd1be1c05d3bf27089b"/></dir><dir name="Mysql4"><dir name="Carrier"><dir name="Pointsrelais"><file name="Collection.php" hash="7a2ea957ddfc9cf364dc7f1a8f1ac536"/></dir><file name="Pointsrelais.php" hash="c1d5c5f50611d060612ad557111152ce"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Shipping"><file name="Pointsrelais.php" hash="bf85a018bb5b57d5426f2b09dd6d297a"/></dir></dir><dir name="Source"><dir name="Shipping"><file name="Pointsrelais.php" hash="81937003a4af64bf69f8370976962b10"/></dir></dir></dir></dir><file name="Observer.php" hash="1538e54242450741dc7a64a74174584b"/></dir><dir name="sql"><dir name="pointsrelais_setup"><file name="mysql4-install-0.1.0.php" hash="fa83c2508cd25d29e122f7481ec11735"/><file name="mysql4-uninstall-0.1.0.php" hash="fe48b6326faa98cadaa69b3c54973b10"/></dir></dir></dir></dir></target></contents>
 
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MondialRelay_Pointsrelais</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Module de livraison Mondial Relay</summary>
10
+ <description>Module de livraison Mondial Relay</description>
11
+ <notes>correction de la cr&#xE9;ation d'etiquettes
12
+ correction de la redirection https</notes>
13
+ <authors><author><name>cyrille guillaud</name><user>auto-converted</user><email>cguillaud@cg-consulting.fr</email></author></authors>
14
+ <date>2010-04-01</date>
15
+ <time>00:40:23</time>
16
+ <contents><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="pointsrelais.css" hash="229d09977ee2eac2e72dcb89bf8eb05c"/></dir><dir name="images"><dir name="mondialrelay"><file name="img_fermer.gif" hash="5901eaf779aa6fa3eac84d1dd9520113"/><file name="img_fleche.gif" hash="908f8a69124b7b16e3ec2caefc78d948"/><file name="logo_PR_01.gif" hash="7066eb60e2645b304d1b926d0a4c31e2"/><file name="Thumbs.db" hash="51da41310be9652f9360715494dc6b03"/></dir></dir><dir name="js"><file name="pointsrelais.js" hash="8008e112e4dd2f468b5726c561a5f8b4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="pointsrelais.xml" hash="cecd44caa45a4124f3ed64a36137fd17"/></dir><dir name="template"><dir name="pointsrelais"><file name="baseurl.phtml" hash="ddbe6d60de42248171c32ac6279ae46d"/><file name="info.phtml" hash="bd616597f35a48a71bcd7bd1e4ad6575"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="MondialRelay_Pointsrelais.csv" hash="0397e023998b05e06539fe9cbc46633a"/></dir></target><target name="magecommunity"><dir name="MondialRelay"><dir name="Pointsrelais"><dir name="Block"><dir name="Sales"><dir name="Order"><dir name="Shipment"><file name="View.php" hash="913bad19edb072f54a3037fa2a860e5e"/></dir></dir><dir name="Shipment"><file name="Grid.php" hash="5b2c413145a1d077bd7503ef8302a0a2"/></dir><file name="Impression.php" hash="0685fabf03cb81a76a643e2fbc7d90bd"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Exportpointsrelais.php" hash="e55ace0129fe156dbeb32a341d384d6a"/></dir></dir><file name="Form.php" hash="3964ae1c690e49d626ed362290fb68a2"/></dir></dir><file name="Info.php" hash="d24bd6bcffe1eae00144d320f595d40d"/></dir><dir name="controllers"><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="562d1105e31f5d6cf100d74e2db1a03a"/></dir><file name="ImpressionController.php" hash="3d4201841e0dfc10f96f5f4a77d5f214"/></dir><dir name="System"><file name="ConfigController.php" hash="495f6d405adf5fba5a32570a56b3770f"/></dir><file name="IndexController.php" hash="0b3068c6075d1ad50f32f802a91bdf38"/></dir><dir name="etc"><file name="config.xml" hash="dd7232db3a8edc0b58cc1b32ef338f1c"/><file name="system.xml" hash="0d3db29ea0b056990b4d990e8351bd29"/></dir><dir name="Helper"><file name="Data.php" hash="e81c10d80df89ecbd51715672c710d3e"/></dir><dir name="Model"><dir name="Carrier"><file name="Pointsrelais.php" hash="0241fa09cb426ecc3c85813646f3dff6"/></dir><dir name="Mysql4"><dir name="Carrier"><dir name="Pointsrelais"><file name="Collection.php" hash="8c7735c2b69a53f234628b8ac0d946cd"/></dir><file name="Pointsrelais.php" hash="c1d5c5f50611d060612ad557111152ce"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Shipping"><file name="Pointsrelais.php" hash="39881a493e895b1921f27b3b144450ee"/></dir></dir><dir name="Source"><dir name="Shipping"><file name="Pointsrelais.php" hash="a75b6978fea52d78b0aabce1401cf9d3"/></dir></dir></dir></dir><file name="Observer.php" hash="1538e54242450741dc7a64a74174584b"/></dir><dir name="sql"><dir name="pointsrelais_setup"><file name="mysql4-install-0.1.0.php" hash="fa83c2508cd25d29e122f7481ec11735"/><file name="mysql4-uninstall-0.1.0.php" hash="fe48b6326faa98cadaa69b3c54973b10"/><file name="mysql4-update-1.0.4.php" hash="5c2027a8336b10aba6ec8cf4a2e2e9e0"/></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies/>
19
  </package>
skin/frontend/default/default/css/iepointsrelais.css DELETED
@@ -1,10 +0,0 @@
1
- /* Mise en place de la lightbox pour IE6 */
2
-
3
- #backgroundLighbox {
4
- position:absolute;
5
- }
6
-
7
- #detailsPointRelais {
8
- position: absolute;
9
- }
10
-
 
 
 
 
 
 
 
 
 
 
skin/frontend/default/default/images/mondialrelay/Thumbs.db ADDED
Binary file
skin/frontend/default/default/js/pointsrelais.js CHANGED
@@ -33,22 +33,52 @@ PointsRelais = {
33
 
34
  var hauteur = document.body.getHeight();
35
  var largeur = document.body.getWidth();
36
- new Ajax.Request( this.getUrl() ,
37
- {
38
- evalScripts : true,
39
- parameters : {Id_Relais: Id, Pays:$('pays').innerHTML, hauteur: hauteur, largeur: largeur},
40
- onCreate : function() {
41
- document.body.style.cursor = 'wait';
42
- PointsRelais.toggleLinkPointer('wait');
43
- },
44
- onSuccess : function(transport) {
45
- document.body.style.cursor = 'default';
46
- PointsRelais.toggleLinkPointer('pointer');
47
- PointsRelais.toggleSelectElements('hidden');
48
- $('PointRelais').update();
49
- $('PointRelais').update(transport.responseText);
 
 
 
 
 
 
 
 
50
  }
51
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  },
53
 
54
  //On ferme la lightbox
33
 
34
  var hauteur = document.body.getHeight();
35
  var largeur = document.body.getWidth();
36
+ var protocol = document.location.protocol || 'http:' ;
37
+
38
+ if (protocol != 'http:'){
39
+ //ouvrir popup
40
+ if ($('relai_post')){
41
+ $('Id_Relais').value = Id;
42
+ $('Pays').value = $('pays').innerHTML;
43
+ $('hauteur').value = hauteur;
44
+ $('largeur').value = largeur;
45
+ } else {
46
+ var form = new Element('form', { action: this.getUrl(), method: "post", name: "relai_post", id: "relai_post", target: "popup_relais", className: "no-display"});
47
+ var id_relais = new Element('input', { name: "Id_Relais", value:Id, id: "Id_Relais" });
48
+ var pays = new Element('input', { name: "Pays", value: $('pays').innerHTML, id: "Pays" });
49
+ var phauteur = new Element('input', { name: "hauteur", value: hauteur, id: "hauteur" });
50
+ var plargeur = new Element('input', { name: "largeur", value: largeur, id: "largeur" });
51
+ var popup_relais = new Element('input', { name: "popup_relais", value: 1, id: "popup_relais" });
52
+ form.insert(id_relais);
53
+ form.insert(pays);
54
+ form.insert(phauteur);
55
+ form.insert(plargeur);
56
+ form.insert(popup_relais);
57
+ document.body.insert(form);
58
  }
59
+
60
+ window.open(baseUrl+'blank-page', 'popup_relais',' width=900,height=450,scrollbars=no');
61
+ the_form = eval(document.forms['relai_post']);
62
+ the_form.submit();
63
+ } else {
64
+ //ouverture div
65
+ new Ajax.Request( this.getUrl() ,
66
+ {
67
+ evalScripts : true,
68
+ parameters : {Id_Relais: Id, Pays:$('pays').innerHTML, hauteur: hauteur, largeur: largeur},
69
+ onCreate : function() {
70
+ document.body.style.cursor = 'wait';
71
+ PointsRelais.toggleLinkPointer('wait');
72
+ },
73
+ onSuccess : function(transport) {
74
+ document.body.style.cursor = 'default';
75
+ PointsRelais.toggleLinkPointer('pointer');
76
+ PointsRelais.toggleSelectElements('hidden');
77
+ $('PointRelais').update();
78
+ $('PointRelais').update(transport.responseText);
79
+ }
80
+ });
81
+ }
82
  },
83
 
84
  //On ferme la lightbox