Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Update validation.tpl #4

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cashondelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
1 change: 1 addition & 0 deletions controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
8 changes: 7 additions & 1 deletion views/templates/front/validation.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*}

{capture name=path}
<a href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Go back to the Checkout' mod='cashondelivery'}">{l s='Checkout' mod='cashondelivery'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Cash on delivery (COD) payment' mod='cashondelivery'}
<a href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}" title="{l s='Go back to the Checkout' mod='cashondelivery'}">{l s='Checkout' mod='cashondelivery'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Cash on delivery (COD) payment' mod='cashondelivery'}
{/capture}

{include file="$tpl_dir./breadcrumb.tpl"}
Expand All @@ -34,6 +34,11 @@
{assign var='current_step' value='payment'}
{include file="$tpl_dir./order-steps.tpl"}

{if $nbProducts <= 0}
<p class="alert alert-warning">
{l s='Your shopping cart is empty.' mod='cashondelivery'}
</p>
{else}
<h3>{l s='Cash on delivery (COD) payment' mod='cashondelivery'}</h3>

<form action="{$link->getModuleLink('cashondelivery', 'validation', [], true)|escape:'html'}" method="post">
Expand All @@ -58,3 +63,4 @@
<input type="submit" value="{l s='I confirm my order' mod='cashondelivery'}" class="exclusive_large" />
</p>
</form>
{/if}