From 9cc46b03f94fbc1387692338e0baaa79cb4d38b5 Mon Sep 17 00:00:00 2001 From: fSerny Date: Thu, 31 May 2012 08:52:59 +0000 Subject: [PATCH] [+] MO : Adding CashOnDelivery Module :) --- modules/cashondelivery/cashondelivery.gif | Bin 0 -> 2391 bytes modules/cashondelivery/cashondelivery.jpg | Bin 0 -> 3009 bytes modules/cashondelivery/cashondelivery.php | 92 ++++++++++++++++++++++ modules/cashondelivery/config.xml | 12 +++ modules/cashondelivery/confirmation.tpl | 32 ++++++++ modules/cashondelivery/de.php | 23 ++++++ modules/cashondelivery/en.php | 4 + modules/cashondelivery/es.php | 23 ++++++ modules/cashondelivery/fr.php | 23 ++++++ modules/cashondelivery/index.php | 36 +++++++++ modules/cashondelivery/it.php | 23 ++++++ modules/cashondelivery/logo.gif | Bin 0 -> 425 bytes modules/cashondelivery/payment.tpl | 34 ++++++++ modules/cashondelivery/validation.php | 74 +++++++++++++++++ modules/cashondelivery/validation.tpl | 58 ++++++++++++++ 15 files changed, 434 insertions(+) create mode 100755 modules/cashondelivery/cashondelivery.gif create mode 100755 modules/cashondelivery/cashondelivery.jpg create mode 100755 modules/cashondelivery/cashondelivery.php create mode 100755 modules/cashondelivery/config.xml create mode 100755 modules/cashondelivery/confirmation.tpl create mode 100644 modules/cashondelivery/de.php create mode 100755 modules/cashondelivery/en.php create mode 100755 modules/cashondelivery/es.php create mode 100755 modules/cashondelivery/fr.php create mode 100755 modules/cashondelivery/index.php create mode 100644 modules/cashondelivery/it.php create mode 100755 modules/cashondelivery/logo.gif create mode 100755 modules/cashondelivery/payment.tpl create mode 100755 modules/cashondelivery/validation.php create mode 100755 modules/cashondelivery/validation.tpl diff --git a/modules/cashondelivery/cashondelivery.gif b/modules/cashondelivery/cashondelivery.gif new file mode 100755 index 0000000000000000000000000000000000000000..926ce1d7c56ef4e7bc8cb160f0c74a6cbf737e74 GIT binary patch literal 2391 zcmV-d38?l*Nk%w1VO9V!0EYko1Ox&F2m}cR0}BZQ3kwMk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PY+u^kv-2zcVE7KlNgBge%%c3X z%L;$)V&ACww|!l8^lsMoqLw{dm-EHmA^Px9@U)xGxRzregnI~;9xm5pQ!%obVV8)1 zcXvV410TTsvdDB2AC?rfYr=0O`-D&JS4PE97#EbUV}f^2vQthHDQOr&z^Kjgq*pZS zmQXwhW2!%L`%~irL=Jv!J7Z{FjKPgxwR4{m{Hl-s{RB z8q=9GMae2w-NUvvS|_(O<6JI(q8aC$U}sFABQ8~67i`|Ge5Usz0`0f_Gr-P+Zz_Hx z!!V7VRldu$-6(B5qHlitpq9VG?VP&M`lx8u&CL9=IKHaxi4QN^(`o6LdK~GBBFEYz z5gxrHq&ug!n*F@7X<vaqN>(}t;&n)%GPJwTpmx%hcukBwNB0Df{# zA0E!lzWu>{W;Omi74A($Nyi_yJY0U+o8+mL3=XG)!?yV*vO^Y@Y<(*T#?5%^*x6K! zkZRJRJQ4gf;JV~idr4(VW+SE>)mi zaaAD630||~Zoh41fIR#{SyTzB^iI<3Nsy<>p`67pYe#ntJM#EO<>F#5i`PdEf4NzV jKjRUbZX_JX7IV*5K*U0@x{|oFX|6326PBD +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 14265 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +class CashOnDelivery extends PaymentModule +{ + public function __construct() + { + $this->name = 'cashondelivery'; + $this->tab = 'payments_gateways'; + $this->version = '0.4'; + $this->author = 'PrestaShop'; + $this->need_instance = 1; + + $this->currencies = false; + + parent::__construct(); + + $this->displayName = $this->l('Cash on delivery (COD)'); + $this->description = $this->l('Accept cash on delivery payments'); + + /* For 1.4.3 and less compatibility */ + $updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT'); + if (!Configuration::get('PS_OS_PAYMENT')) + foreach ($updateConfig as $u) + if (!Configuration::get($u) && defined('_'.$u.'_')) + Configuration::updateValue($u, constant('_'.$u.'_')); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) + return false; + return true; + } + + public function hookPayment($params) + { + if (!$this->active) + return ; + + global $smarty; + + // Check if cart has product download + foreach ($params['cart']->getProducts() AS $product) + { + $pd = ProductDownload::getIdFromIdProduct((int)($product['id_product'])); + if ($pd AND Validate::isUnsignedInt($pd)) + return false; + } + + $smarty->assign(array( + 'this_path' => $this->_path, + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' + )); + return $this->display(__FILE__, 'payment.tpl'); + } + + public function hookPaymentReturn($params) + { + if (!$this->active) + return ; + + return $this->display(__FILE__, 'confirmation.tpl'); + } +} diff --git a/modules/cashondelivery/config.xml b/modules/cashondelivery/config.xml new file mode 100755 index 000000000..d214915a3 --- /dev/null +++ b/modules/cashondelivery/config.xml @@ -0,0 +1,12 @@ + + + cashondelivery + + + + + + 0 + 0 + + \ No newline at end of file diff --git a/modules/cashondelivery/confirmation.tpl b/modules/cashondelivery/confirmation.tpl new file mode 100755 index 000000000..cc3857a25 --- /dev/null +++ b/modules/cashondelivery/confirmation.tpl @@ -0,0 +1,32 @@ +{* +* 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='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 0000000000000000000000000000000000000000..a082499446067f528398020a42a7f6491bd6fa6f GIT binary patch literal 425 zcmV;a0apG;Nk%w1VGsZi0M!5hD1QQ{%a7NuO^CN@@ZiF3qc`i=qQr+O-MDD=(0A+1 zgHe|u|Mb^;u2j;ZSKYaJ`s~j7wPjnMJLtYg`}Xcj zl{28liT>Y|%9AnLtWS@-b91Ur&YM2oymI8QOYqQ(``m-z#eMAAvH$kn|Nr)^&6EG- zr1s^$A^8LW2LL<(EC2ui01yBW000KYK%Q_&QshX(g$3HWU;E6Dup3j-44VCMF#P4GT63Fan&NA_ck=4FNM28nqWY86vqo$N@4g zAR`AgH9y2Y6Fo8mDcKb&06aP|V-OPo0WK~n6(AN +* @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='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'}

+ +
+ +

+ {l s='Cash on delivery (COD) payment' mod='cashondelivery'} + {l s='You have chosen the cash on delivery method.' mod='cashondelivery'} +

+ {l s='The total amount of your order is' mod='cashondelivery'} + {convertPrice price=$total} + {if $use_taxes == 1} + {l s='(tax incl.)' mod='cashondelivery'} + {/if} +

+

+

+

+ {l s='Please confirm your order by clicking \'I confirm my order\'' mod='cashondelivery'}. +

+

+ {l s='Other payment methods' mod='cashondelivery'} + +

+