diff --git a/cashondelivery.php b/cashondelivery.php index 7124a72..254e84d 100755 --- a/cashondelivery.php +++ b/cashondelivery.php @@ -94,6 +94,15 @@ public function hookPaymentReturn($params) if (!$this->active) return ; + $this->smarty->assign(array( + 'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false), + 'id_order' => $params['objOrder']->id, + 'this_path' => $this->_path, + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' + )); + if (isset($params['objOrder']->reference) && !empty($params['objOrder']->reference)) + $this->smarty->assign('reference', $params['objOrder']->reference); + return $this->display(__FILE__, 'confirmation.tpl'); } } diff --git a/controllers/front/validation.php b/controllers/front/validation.php index cbbc822..289ad29 100644 --- a/controllers/front/validation.php +++ b/controllers/front/validation.php @@ -69,6 +69,7 @@ public function initContent() parent::initContent(); $this->context->smarty->assign(array( + 'nbProducts' => $this->context->cart->nbProducts(), 'total' => $this->context->cart->getOrderTotal(true, Cart::BOTH), 'this_path' => $this->module->getPathUri(),//keep for retro compat 'this_path_cod' => $this->module->getPathUri(), diff --git a/views/templates/front/validation.tpl b/views/templates/front/validation.tpl index dfe1e1f..703d07e 100755 --- a/views/templates/front/validation.tpl +++ b/views/templates/front/validation.tpl @@ -24,7 +24,7 @@ *} {capture name=path} - {l s='Checkout' mod='cashondelivery'} {l s='Cash on delivery (COD) payment' mod='cashondelivery'} + {l s='Checkout' mod='cashondelivery'} {l s='Cash on delivery (COD) payment' mod='cashondelivery'} {/capture} {include file="$tpl_dir./breadcrumb.tpl"} @@ -34,6 +34,11 @@ {assign var='current_step' value='payment'} {include file="$tpl_dir./order-steps.tpl"} +{if $nbProducts <= 0} +
+ {l s='Your shopping cart is empty.' mod='cashondelivery'} +
+{else}