Jump to content

Recommended Posts

hi all,

 

I am using "cash on delivery with fee pay" module for payment method with my prestashop version 1.5.4.1. when i am going to choose this payment method it redirect to next page but it shows the "No template was found for this module" error.i tried slow it but i can't if anyone have idea to solve this problem help me to solve it.

 

validation.php code:-

 

<?php

 

include(dirname(__FILE__).'/../../config/config.inc.php');

include(dirname(__FILE__).'/../../header.php');

include(dirname(__FILE__).'/cashondeliverywithfee.php');

 

$cashOnDelivery = new CashOnDeliveryWithFee();

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');

 

/* Validate order */

if (Tools::getValue('confirm'))

{

$customer = new Customer(intval($cart->id_customer));

$total = floatval(number_format($cart->getOrderTotal(true, 3), 2, '.', ''));

$cashOnDelivery->validateOrderCOD(intval($cart->id), _PS_OS_PREPARATION_, $total, $cashOnDelivery->displayName);

$order = new Order(intval($cashOnDelivery->currentOrder));

Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id_cart='.intval($cart->id).'&id_module='.intval($cashOnDelivery->id).'&id_order='.intval($cashOnDelivery->currentOrder));

}

else

{

/* or ask for confirmation */

 

$CODfee = $cashOnDelivery->getCostValidated($cart);

$cartcost = $cart->getOrderTotal(true, 3);

$total = $CODfee + $cartcost;

 

$smarty->assign(array(

'currency' => new Currency(intval($cart->id_currency)),

'total' => number_format(floatval( $total ), 2, '.', ''),

//'this_path_ssl' => (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/cashondeliverywithfee/'

'this_path_ssl' => Tools::getHttpHost(true, true).__PS_BASE_URI__.'modules/cashondeliverywithfee/'

));

 

$smarty->assign('this_path', __PS_BASE_URI__.'modules/cashondeliverywithfee/');

echo Module::display(__FILE__, 'validation.tpl');

}

 

include(dirname(__FILE__).'/../../footer.php');

?>

Share this post


Link to post
Share on other sites

does the validation.tpl file exist in the root dir of this module?

Share this post


Link to post
Share on other sites

Set up with the new version of MVC. Validation in root is deprecated as of prestashop 1.5 so put the validation in views/templates/front/ directory. 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More