+* @copyright 2007-2012 PrestaShop SA
+* @version Release: $Revision: 14011 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+{l s='Your order on' mod='cashondelivery'} {$shop_name} {l s='is complete.' mod='cashondelivery'}
+
+ {l s='You have chosen the cash on delivery method.' mod='cashondelivery'}
+
{l s='Your order will be sent very soon.' mod='cashondelivery'}
+
{l s='For any questions or for further information, please contact our' mod='cashondelivery'} {l s='customer support' mod='cashondelivery'}.
+
diff --git a/modules/cashondelivery/de.php b/modules/cashondelivery/de.php
new file mode 100644
index 000000000..1be491766
--- /dev/null
+++ b/modules/cashondelivery/de.php
@@ -0,0 +1,23 @@
+cashondelivery_1f9497d3e8bac9b50151416f04119cec'] = 'Nachnahme (COD)';
+$_MODULE['<{cashondelivery}prestashop>cashondelivery_7a3ef27eb0b1895ebf263ad7dd949fb6'] = 'Zahlungen per Nachnahme akzeptieren';
+$_MODULE['<{cashondelivery}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung von';
+$_MODULE['<{cashondelivery}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Sie haben die Nachnahme-Methode gewählt.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Ihre Bestellung wird sehr bald versandt werden.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren';
+$_MODULE['<{cashondelivery}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support';
+$_MODULE['<{cashondelivery}prestashop>payment_b7ada96a0da7ee7fb5371cca0b036d5c'] = 'Zahlung per Nachnahme (COD)';
+$_MODULE['<{cashondelivery}prestashop>payment_536dc7424180872c8c2488ae0286fb53'] = 'Sie bezahlen die Ware bei der Lieferung';
+$_MODULE['<{cashondelivery}prestashop>validation_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Versand';
+$_MODULE['<{cashondelivery}prestashop>validation_0c25b529b4d690c39b0831840d0ed01c'] = 'Bestellsumme';
+$_MODULE['<{cashondelivery}prestashop>validation_d538c5b86e9a71455ba27412f4e9ab51'] = 'Nachnahme-Zahlung (COD)';
+$_MODULE['<{cashondelivery}prestashop>validation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Sie haben die Nachnahme-Methode gewählt.';
+$_MODULE['<{cashondelivery}prestashop>validation_e2867a925cba382f1436d1834bb52a1c'] = 'Der Gesamtbetrag Ihrer Bestellung beträgt';
+$_MODULE['<{cashondelivery}prestashop>validation_1f87346a16cf80c372065de3c54c86d9'] = '(inkl. MwSt.)';
+$_MODULE['<{cashondelivery}prestashop>validation_0881a11f7af33bc1b43e437391129d66'] = 'Bitte bestätigen Sie Ihre Bestellung durch Klicken auf \\BESTELLEN\"\"';
+$_MODULE['<{cashondelivery}prestashop>validation_569fd05bdafa1712c4f6be5b153b8418'] = 'Andere Zahlungsmethoden';
+$_MODULE['<{cashondelivery}prestashop>validation_46b9e3665f187c739c55983f757ccda0'] = 'BESTELLEN';
diff --git a/modules/cashondelivery/en.php b/modules/cashondelivery/en.php
new file mode 100755
index 000000000..601358d4f
--- /dev/null
+++ b/modules/cashondelivery/en.php
@@ -0,0 +1,4 @@
+cashondelivery_1f9497d3e8bac9b50151416f04119cec'] = 'Pago contra reembolso';
+$_MODULE['<{cashondelivery}prestashop>cashondelivery_7a3ef27eb0b1895ebf263ad7dd949fb6'] = 'Aceptar pagos contra reembolso';
+$_MODULE['<{cashondelivery}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido en';
+$_MODULE['<{cashondelivery}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ha sido registrado.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Ha elegido pagar en el momento de la entrega.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Le enviaremos su pedido en breve plazo.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier pregunta, póngase en contacto con nuestro';
+$_MODULE['<{cashondelivery}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'servicio clientela';
+$_MODULE['<{cashondelivery}prestashop>payment_b7ada96a0da7ee7fb5371cca0b036d5c'] = 'Pagra contra reembolso';
+$_MODULE['<{cashondelivery}prestashop>payment_536dc7424180872c8c2488ae0286fb53'] = 'Usted paga la mercancía a la entrega';
+$_MODULE['<{cashondelivery}prestashop>validation_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'transporte';
+$_MODULE['<{cashondelivery}prestashop>validation_0c25b529b4d690c39b0831840d0ed01c'] = 'Suma del pedido';
+$_MODULE['<{cashondelivery}prestashop>validation_d538c5b86e9a71455ba27412f4e9ab51'] = 'Pago contra reembolso';
+$_MODULE['<{cashondelivery}prestashop>validation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Ha elegido el pago contra reembolso';
+$_MODULE['<{cashondelivery}prestashop>validation_e2867a925cba382f1436d1834bb52a1c'] = 'El importe total de su pedido es';
+$_MODULE['<{cashondelivery}prestashop>validation_1f87346a16cf80c372065de3c54c86d9'] = '(tasas incluídas)';
+$_MODULE['<{cashondelivery}prestashop>validation_0881a11f7af33bc1b43e437391129d66'] = 'Por favor acepte su pedido pulsando en \'confirmo mi pedido\'';
+$_MODULE['<{cashondelivery}prestashop>validation_569fd05bdafa1712c4f6be5b153b8418'] = 'Otros modos de pago';
+$_MODULE['<{cashondelivery}prestashop>validation_46b9e3665f187c739c55983f757ccda0'] = 'Confirmo mi pedido';
diff --git a/modules/cashondelivery/fr.php b/modules/cashondelivery/fr.php
new file mode 100755
index 000000000..dd8ec91a9
--- /dev/null
+++ b/modules/cashondelivery/fr.php
@@ -0,0 +1,23 @@
+cashondelivery_1f9497d3e8bac9b50151416f04119cec'] = 'Comptant à la livraison';
+$_MODULE['<{cashondelivery}prestashop>cashondelivery_7a3ef27eb0b1895ebf263ad7dd949fb6'] = 'Accepte le paiement lors de la livraison';
+$_MODULE['<{cashondelivery}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur';
+$_MODULE['<{cashondelivery}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'est bien enregistrée.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Vous avez choisi le paiement lors de la livraison.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Votre commande vous sera envoyée très prochainement.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question ou information complémentaire merci de contacter notre';
+$_MODULE['<{cashondelivery}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'support client';
+$_MODULE['<{cashondelivery}prestashop>payment_b7ada96a0da7ee7fb5371cca0b036d5c'] = 'Payer comptant à la livraison';
+$_MODULE['<{cashondelivery}prestashop>payment_536dc7424180872c8c2488ae0286fb53'] = 'Vous payez lors de la livraison de votre commande';
+$_MODULE['<{cashondelivery}prestashop>validation_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Frais d\'expédition';
+$_MODULE['<{cashondelivery}prestashop>validation_0c25b529b4d690c39b0831840d0ed01c'] = 'Récapitulatif de commande';
+$_MODULE['<{cashondelivery}prestashop>validation_d538c5b86e9a71455ba27412f4e9ab51'] = 'Paiement comptant à la livraison';
+$_MODULE['<{cashondelivery}prestashop>validation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Vous avez choisi de régler comptant lors de la livraison de la commande.';
+$_MODULE['<{cashondelivery}prestashop>validation_e2867a925cba382f1436d1834bb52a1c'] = 'Le montant total de votre commande s\'élève à';
+$_MODULE['<{cashondelivery}prestashop>validation_1f87346a16cf80c372065de3c54c86d9'] = 'TTC';
+$_MODULE['<{cashondelivery}prestashop>validation_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"';
+$_MODULE['<{cashondelivery}prestashop>validation_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement';
+$_MODULE['<{cashondelivery}prestashop>validation_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande';
diff --git a/modules/cashondelivery/index.php b/modules/cashondelivery/index.php
new file mode 100755
index 000000000..a85fb997d
--- /dev/null
+++ b/modules/cashondelivery/index.php
@@ -0,0 +1,36 @@
+
+* @copyright 2007-2012 PrestaShop SA
+* @version Release: $Revision: 14011 $
+* @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;
\ No newline at end of file
diff --git a/modules/cashondelivery/it.php b/modules/cashondelivery/it.php
new file mode 100644
index 000000000..d2c4ccaf1
--- /dev/null
+++ b/modules/cashondelivery/it.php
@@ -0,0 +1,23 @@
+cashondelivery_1f9497d3e8bac9b50151416f04119cec'] = 'Pagamento alla consegna (COD)';
+$_MODULE['<{cashondelivery}prestashop>cashondelivery_7a3ef27eb0b1895ebf263ad7dd949fb6'] = 'Accetta pagamenti COD (alla consegna)';
+$_MODULE['<{cashondelivery}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine sul';
+$_MODULE['<{cashondelivery}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completa.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Hai scelto la modalità di pagamento alla consegna.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Il tuo ordine verrà inviato al più presto.';
+$_MODULE['<{cashondelivery}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra';
+$_MODULE['<{cashondelivery}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti';
+$_MODULE['<{cashondelivery}prestashop>payment_b7ada96a0da7ee7fb5371cca0b036d5c'] = 'Paga in contanti alla consegna (COD)';
+$_MODULE['<{cashondelivery}prestashop>payment_536dc7424180872c8c2488ae0286fb53'] = 'Si paga per la merce al momento della consegna';
+$_MODULE['<{cashondelivery}prestashop>validation_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Spedizione';
+$_MODULE['<{cashondelivery}prestashop>validation_0c25b529b4d690c39b0831840d0ed01c'] = 'Riepilogo ordine';
+$_MODULE['<{cashondelivery}prestashop>validation_d538c5b86e9a71455ba27412f4e9ab51'] = 'Pagamento in contanti alla consegna (COD)';
+$_MODULE['<{cashondelivery}prestashop>validation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Hai scelto la modalità pagamento alla consegna.';
+$_MODULE['<{cashondelivery}prestashop>validation_e2867a925cba382f1436d1834bb52a1c'] = 'L\'importo totale del tuo ordine è';
+$_MODULE['<{cashondelivery}prestashop>validation_1f87346a16cf80c372065de3c54c86d9'] = '(Tasse incl.)';
+$_MODULE['<{cashondelivery}prestashop>validation_0881a11f7af33bc1b43e437391129d66'] = 'Si prega di confermare l\'ordine cliccando su \'confermo il mio ordine\'';
+$_MODULE['<{cashondelivery}prestashop>validation_569fd05bdafa1712c4f6be5b153b8418'] = 'Altri metodi di pagamento';
+$_MODULE['<{cashondelivery}prestashop>validation_46b9e3665f187c739c55983f757ccda0'] = 'Confermo il mio ordine';
diff --git a/modules/cashondelivery/logo.gif b/modules/cashondelivery/logo.gif
new file mode 100755
index 000000000..a08249944
Binary files /dev/null and b/modules/cashondelivery/logo.gif differ
diff --git a/modules/cashondelivery/payment.tpl b/modules/cashondelivery/payment.tpl
new file mode 100755
index 000000000..4ef09a2f4
--- /dev/null
+++ b/modules/cashondelivery/payment.tpl
@@ -0,0 +1,34 @@
+{*
+* 2007-2012 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 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/afl-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
+* @copyright 2007-2012 PrestaShop SA
+* @version Release: $Revision: 14011 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+
+
+
+
{l s='Pay with cash on delivery (COD)' mod='cashondelivery'}
+
{l s='You pay for the merchandise upon delivery' mod='cashondelivery'}
+
+
+
\ No newline at end of file
diff --git a/modules/cashondelivery/validation.php b/modules/cashondelivery/validation.php
new file mode 100755
index 000000000..074f73343
--- /dev/null
+++ b/modules/cashondelivery/validation.php
@@ -0,0 +1,74 @@
+
+* @copyright 2007-2012 PrestaShop SA
+* @version Release: $Revision: 14011 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+include(dirname(__FILE__).'/../../config/config.inc.php');
+include(dirname(__FILE__).'/../../header.php');
+include(dirname(__FILE__).'/cashondelivery.php');
+
+$cashOnDelivery = new CashOnDelivery();
+if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$cashOnDelivery->active)
+ Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1');
+
+// Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
+$authorized = false;
+foreach (Module::getPaymentModules() as $module)
+ if ($module['name'] == 'cashondelivery')
+ {
+ $authorized = true;
+ break;
+ }
+if (!$authorized)
+ die(Tools::displayError('This payment method is not available.'));
+
+$customer = new Customer((int)$cart->id_customer);
+
+if (!Validate::isLoadedObject($customer))
+ Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1');
+
+/* Validate order */
+if (Tools::getValue('confirm'))
+{
+ $customer = new Customer((int)$cart->id_customer);
+ $total = $cart->getOrderTotal(true, Cart::BOTH);
+ $cashOnDelivery->validateOrder((int)$cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $cashOnDelivery->displayName, NULL, array(), NULL, false, $customer->secure_key);
+ $order = new Order((int)$cashOnDelivery->currentOrder);
+ Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id_cart='.(int)($cart->id).'&id_module='.(int)$cashOnDelivery->id.'&id_order='.(int)$cashOnDelivery->currentOrder);
+}
+else
+{
+ /* or ask for confirmation */
+ $smarty->assign(array(
+ 'total' => $cart->getOrderTotal(true, Cart::BOTH),
+ 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/cashondelivery/'
+ ));
+
+ $smarty->assign('this_path', __PS_BASE_URI__.'modules/cashondelivery/');
+ $template = 'validation.tpl';
+ echo Module::display('cashondelivery', $template);
+}
+
+include(dirname(__FILE__).'/../../footer.php');
\ No newline at end of file
diff --git a/modules/cashondelivery/validation.tpl b/modules/cashondelivery/validation.tpl
new file mode 100755
index 000000000..cdce5d62e
--- /dev/null
+++ b/modules/cashondelivery/validation.tpl
@@ -0,0 +1,58 @@
+{*
+* 2007-2012 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 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/afl-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
+* @copyright 2007-2012 PrestaShop SA
+* @version Release: $Revision: 14011 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+{capture name=path}{l s='Shipping' mod='cashondelivery'}{/capture}
+{include file="$tpl_dir./breadcrumb.tpl"}
+
+{l s='Order summation' mod='cashondelivery'}
+
+{assign var='current_step' value='payment'}
+{include file="$tpl_dir./order-steps.tpl"}
+
+{l s='Cash on delivery (COD) payment' mod='cashondelivery'}
+
+