// MERGE with 1.4 r7770

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7776 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-07-28 09:20:57 +00:00
parent df255f66c1
commit a875fecb20
968 changed files with 26082 additions and 3937 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>upscarrier</name>
<displayName><![CDATA[UPS Carrier]]></displayName>
<version><![CDATA[1.1]]></version>
<version><![CDATA[1.2]]></version>
<description><![CDATA[Offer your customers, different delivery methods with UPS]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab>
-2
View File
@@ -142,5 +142,3 @@ $_MODULE['<{upscarrier}prestashop>upscarrier_902b0d55fddef6f8d651fe1035b7d4bd']
$_MODULE['<{upscarrier}prestashop>upscarrier_bbb1730944c8f495534aa125411687af'] = 'UPS Webservice scheint heruntergefahren zu sein, warten Sie bitte ein paar Minuten und versuchen Sie es erneut';
$_MODULE['<{upscarrier}prestashop>upscarrier_da603f01f9ef4785e2aed2b3a2619e99'] = 'UPS Webservice hat die Zeit überschritten.';
$_MODULE['<{upscarrier}prestashop>upscarrier_755549828deba234f771ea065e24c115'] = 'Konnte keine Verbindung zu UPS.com herstellen';
?>
+5 -1
View File
@@ -11,6 +11,8 @@ $_MODULE['<{upscarrier}prestashop>upscarrier_f795d6b3e974858bb6720cfc2b4d22d6']
$_MODULE['<{upscarrier}prestashop>upscarrier_fe4ee8226f826b73619fc422ca5b7382'] = 'Mot de passe UPS';
$_MODULE['<{upscarrier}prestashop>upscarrier_5e20501e9384bef70cc36012e20c49a1'] = 'MyUps ID';
$_MODULE['<{upscarrier}prestashop>upscarrier_70620de307a173fe781d1a9a575346cb'] = 'Clé API UPS';
$_MODULE['<{upscarrier}prestashop>upscarrier_20449d3f0b6c6b9265a5cd2a470a6451'] = 'Poids du colis';
$_MODULE['<{upscarrier}prestashop>upscarrier_bfc00de34bc04366e7fee516adf7dca5'] = 'Frais supplémentaire';
$_MODULE['<{upscarrier}prestashop>upscarrier_3d2c007374b08d6999fa43e037d54b53'] = 'Méthode de ramassage';
$_MODULE['<{upscarrier}prestashop>upscarrier_ead6e6f6c0c0be25f6275464f2ae0d3c'] = 'Type de colis';
$_MODULE['<{upscarrier}prestashop>upscarrier_885d2a3462e6b8b6ab763b95a0ce3a63'] = 'Zones tarifaires';
@@ -60,6 +62,8 @@ $_MODULE['<{upscarrier}prestashop>upscarrier_32b02316cc0c3e871dd2ba4451abbb23']
$_MODULE['<{upscarrier}prestashop>upscarrier_c4906d203203052c2119c2c27e7cef65'] = 'Votre identifiant MyUps ID';
$_MODULE['<{upscarrier}prestashop>upscarrier_e75761482891a9ad8c6a1339dd143119'] = 'Votre UPS API Key';
$_MODULE['<{upscarrier}prestashop>upscarrier_bdfcb5fba4c72a81163a0b403a25338d'] = 'Cliquez ici pour obtenir votre UPS API Key';
$_MODULE['<{upscarrier}prestashop>upscarrier_db06a2900c66a3a2cb78fe3a470f1b85'] = 'Poids du colis';
$_MODULE['<{upscarrier}prestashop>upscarrier_0274f749472f365e7d48a501e14793e6'] = 'Frais supplémentaire';
$_MODULE['<{upscarrier}prestashop>upscarrier_83ad4fdaf06650e6d9d7ca18f82fb975'] = 'Configuration de localisation';
$_MODULE['<{upscarrier}prestashop>upscarrier_f489118ea95c746d648d36bb50c226f0'] = 'Unité de poids';
$_MODULE['<{upscarrier}prestashop>upscarrier_659c95668841b7d6602ead454b28d4ba'] = 'L\'unité de poids de votre magasin (ex: kg ou lbs)';
@@ -87,7 +91,7 @@ $_MODULE['<{upscarrier}prestashop>upscarrier_da42caf26ef85de3d7e48e16ca60b891']
$_MODULE['<{upscarrier}prestashop>upscarrier_8d2ee0603dfce09b57d60db628cde269'] = 'Choisissez le type de paquet ...';
$_MODULE['<{upscarrier}prestashop>upscarrier_795de10b1bdcb843b3703c63ad577fc6'] = 'Choisissez dans la liste des types de paquet celui par défaut.';
$_MODULE['<{upscarrier}prestashop>upscarrier_8d6bd50f3fe3ee2f4513066c25e5fb4a'] = 'Mode de calcul';
$_MODULE['<{upscarrier}prestashop>upscarrier_37fa4a1a7af70286d9067ac63555cbf4'] = 'Utilisation du mode de calcul : \"Tous les articles dans un seul paquet\" utilisera automatiquement la taille des emballages par défaut, le type d\'emballage et de livraison. Les configurations spécifiques pour les catégories ou un produit ne seront pas utilisées.';
$_MODULE['<{upscarrier}prestashop>upscarrier_3169c5057093f8e6c2750f1949a0900d'] = 'Utiliser la méthode de calcul \"Tous les produits dans un colis\" utilisera automatiquement la taille de colis, le type de colis et les services de livraison par défaut. Les configurations spécifiques des catégories et des produits ne seront pas pris en compte.';
$_MODULE['<{upscarrier}prestashop>upscarrier_5cdd307ba6e260beb4801c0c10e22a3a'] = 'Service de livraison';
$_MODULE['<{upscarrier}prestashop>upscarrier_78945de8de090e90045d299651a68a9b'] = 'Disponible';
$_MODULE['<{upscarrier}prestashop>upscarrier_2d25c72c1b18e562f6654fff8e11711e'] = 'Non disponible';
+36
View File
@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;
+36 -13
View File
@@ -45,12 +45,16 @@ class UpsCarrier extends CarrierModule
private $_weightUnitList = array('KG' => 'KGS', 'KGS' => 'KGS', 'LBS' => 'LBS', 'LB' => 'LBS');
private $_moduleName = 'upscarrier';
/*
** Construct Method
**
*/
public function __construct()
{
set_time_limit(0);
$this->name = 'upscarrier';
$this->tab = 'shipping_logistics';
$this->version = '1.1';
$this->version = '1.2';
$this->author = 'PrestaShop';
$this->limited_countries = array('us');
@@ -96,6 +100,8 @@ class UpsCarrier extends CarrierModule
'UPS_CARRIER_PASSWORD' => $this->l('UPS Password'),
'UPS_CARRIER_SHIPPER_ID' => $this->l('MyUps ID'),
'UPS_CARRIER_API_KEY' => $this->l('UPS API Key'),
'UPS_CARRIER_PACKAGING_WEIGHT' => $this->l('Packaging weight'),
'UPS_CARRIER_HANDLING_FEE' => $this->l('Handling fee'),
'UPS_CARRIER_PICKUP_TYPE' => $this->l('UPS Pickup Type'),
'UPS_CARRIER_PACKAGING_TYPE' => $this->l('UPS Packaging Type'),
'UPS_CARRIER_RATE_SERVICE_GROUP' => $this->l('UPS Rate Service Group'),
@@ -421,6 +427,7 @@ class UpsCarrier extends CarrierModule
private function _displayFormGeneral()
{
global $cookie;
$configCurrency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
$html = '<script>
$(document).ready(function() {
@@ -462,6 +469,17 @@ class UpsCarrier extends CarrierModule
<input type="text" size="20" name="ups_carrier_api_key" value="'.Tools::getValue('ups_carrier_api_key', Configuration::get('UPS_CARRIER_API_KEY')).'" />
<p><a href="https://www.ups.com/upsdeveloperkit" target="_blank">' . $this->l('Please click here to get your UPS API Key.') . '</a></p>
</div>
<br /><br />
<label>'.$this->l('Packaging Weight').' : </label>
<div class="margin-form">
<input type="text" size="5" name="ups_carrier_packaging_weight" value="'.Tools::getValue('ups_carrier_packaging_weight', Configuration::get('UPS_CARRIER_PACKAGING_WEIGHT')).'" />
'.Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')).'
</div>
<label>'.$this->l('Handling Fee').' : </label>
<div class="margin-form">
<input type="text" size="5" name="ups_carrier_handling_fee" value="'.Tools::getValue('ups_carrier_handling_fee', Configuration::get('UPS_CARRIER_HANDLING_FEE')).'" />
'.$configCurrency->sign.'
</div>
</fieldset>
<fieldset style="border: 0px;">
@@ -575,7 +593,7 @@ class UpsCarrier extends CarrierModule
foreach($this->_calculModeList as $kcalculmode => $vcalculmode)
$html .= '<option value="'.$kcalculmode.'" '.($kcalculmode == (Tools::getValue('ups_carrier_calcul_mode', Configuration::get('UPS_CARRIER_CALCUL_MODE'))) ? 'selected="selected"' : '').'>'.$vcalculmode.'</option>';
$html .= '</select>
<p>' . $this->l('Using the calcul mode "All items in one package" will automatically use default packaging size, packaging type and delivery services. Specific configurations for categories or product won\'t be used.') . '</p>
<p>' . $this->l('Using the calcul mode "All items in one package" will automatically use default packaging size, packaging type and delivery services. Specifics configurations for categories or product won\'t be used.') . '</p>
</div>';
if (Configuration::get('UPS_CARRIER_RATE_SERVICE_GROUP'))
@@ -660,6 +678,8 @@ class UpsCarrier extends CarrierModule
Configuration::updateValue('UPS_CARRIER_PASSWORD', Tools::getValue('ups_carrier_password'));
Configuration::updateValue('UPS_CARRIER_SHIPPER_ID', Tools::getValue('ups_carrier_shipper_id'));
Configuration::updateValue('UPS_CARRIER_API_KEY', Tools::getValue('ups_carrier_api_key'));
Configuration::updateValue('UPS_CARRIER_PACKAGING_WEIGHT', Tools::getValue('ups_carrier_packaging_weight'));
Configuration::updateValue('UPS_CARRIER_HANDLING_FEE', Tools::getValue('ups_carrier_handling_fee'));
Configuration::updateValue('UPS_CARRIER_PICKUP_TYPE', Tools::getValue('ups_carrier_pickup_type'));
Configuration::updateValue('UPS_CARRIER_PACKAGING_TYPE', Tools::getValue('ups_carrier_packaging_type'));
Configuration::updateValue('UPS_CARRIER_ADDRESS1', Tools::getValue('ups_carrier_address1'));
@@ -687,6 +707,8 @@ class UpsCarrier extends CarrierModule
Configuration::updateValue('UPS_CARRIER_PASSWORD', Tools::getValue('ups_carrier_password')) AND
Configuration::updateValue('UPS_CARRIER_SHIPPER_ID', Tools::getValue('ups_carrier_shipper_id')) AND
Configuration::updateValue('UPS_CARRIER_API_KEY', Tools::getValue('ups_carrier_api_key')) AND
Configuration::updateValue('UPS_CARRIER_PACKAGING_WEIGHT', Tools::getValue('ups_carrier_packaging_weight')) AND
Configuration::updateValue('UPS_CARRIER_HANDLING_FEE', Tools::getValue('ups_carrier_handling_fee')) AND
Configuration::updateValue('UPS_CARRIER_PICKUP_TYPE', Tools::getValue('ups_carrier_pickup_type')) AND
Configuration::updateValue('UPS_CARRIER_PACKAGING_TYPE', Tools::getValue('ups_carrier_packaging_type')) AND
Configuration::updateValue('UPS_CARRIER_POSTAL_CODE', Tools::getValue('ups_carrier_postal_code')) AND
@@ -1348,7 +1370,7 @@ class UpsCarrier extends CarrierModule
foreach ($wsParams as $k => $v)
if ($k != 'products')
$paramHash .= '/'.$v;
return md5($productHash.$paramHash);
return md5($productHash.$paramHash.Configuration::get('UPS_CARRIER_CALCUL_MODE'));
}
public function getOrderShippingCostCache($wsParams)
@@ -1460,6 +1482,7 @@ class UpsCarrier extends CarrierModule
if ($product['weight'])
$weight += ($product['weight'] * $product['quantity']);
}
$weight += Tools::getValue('ups_carrier_packaging_weight', Configuration::get('UPS_CARRIER_PACKAGING_WEIGHT'));
// Get service in adequation with carrier and check if available
$serviceSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'ups_rate_service_code` WHERE `active` = 1 AND `id_carrier` = '.(int)($this->id_carrier));
@@ -1469,10 +1492,10 @@ class UpsCarrier extends CarrierModule
$wsParams['service'] = $serviceSelected['code'];
$wsParams['package_list'] = array();
$wsParams['package_list'][] = array(
'width' => ($width > 0 ? $width : 1),
'height' => ($height > 0 ? $height : 1),
'depth' => ($depth > 0 ? $depth : 1),
'weight' => ($weight > 0 ? $weight : 1),
'width' => ($width > 0 ? $width : 7),
'height' => ($height > 0 ? $height : 3),
'depth' => ($depth > 0 ? $depth : 5),
'weight' => ($weight > 0 ? $weight : 0.5),
'packaging_type' => Configuration::get('UPS_CARRIER_PACKAGING_TYPE'),
);
}
@@ -1493,10 +1516,10 @@ class UpsCarrier extends CarrierModule
$wsParams['service'] = $serviceSelected['code'];
for ($qty = 0; $qty < $product['quantity']; $qty++)
$wsParams['package_list'][] = array(
'width' => ($product['width'] ? $product['width'] : 1),
'height' => ($product['height'] ? $product['height'] : 1),
'depth' => ($product['depth'] ? $product['depth'] : 1),
'weight' => ($product['weight'] ? $product['weight'] : 1),
'width' => ($product['width'] ? $product['width'] : 7),
'height' => ($product['height'] ? $product['height'] : 3),
'depth' => ($product['depth'] ? $product['depth'] : 5),
'weight' => ($product['weight'] ? $product['weight'] : 0.5),
'packaging_type' => ($config['packaging_type_code'] ? $config['packaging_type_code'] : Configuration::get('UPS_CARRIER_PACKAGING_TYPE')),
);
@@ -1514,7 +1537,7 @@ class UpsCarrier extends CarrierModule
// If webservice return a cost, we add it, else, we return the original shipping cost
$result = $this->getUpsShippingCost($wsParams);
if ($result['connect'] && $result['cost'] > 0)
return ($cost + $result['cost']);
return ($cost + $result['cost'] + Tools::getValue('ups_carrier_handling_fee', Configuration::get('UPS_CARRIER_HANDLING_FEE')));
return false;
}