Jump to content

Order ID on COD page


ruchit.devil

Recommended Posts

  • 3 weeks later...

to the Cash On Delivery confirmation page template file,

 

where you want to display it exactly?

 

i want to display the order id exactly after the customer add the product to the cart and choose the payment option as Cash On Delivery.

can you explain exactly where shall i put {Tools::getValue('id_order')}

Link to comment
Share on other sites

Hello, I got 2 questions:

 

1. how can I get id_order value on cashondelivery/views/templates/hook/confirmation.tpl ?

2. my order_conf.html email does not get the id_order number (it shows {id_order})

How can i pass the id_order to email template ?

 

//edit

ok point 2 was simple i added

'{id_order}' => $order->id,

to cashondelivery.php

 

PS 1.5.2

Edited by mentalspot (see edit history)
Link to comment
Share on other sites

  • 1 month later...

this should look like this:

it`s all around line 692

 

'{invoice_phone}' => ($invoice->phone) ? $invoice->phone : $invoice->phone_mobile,
				    '{invoice_other}' => $invoice->other,
				    '{order_name}' => $order->getUniqReference(),
				    '{id_order}' => $order->id,
				    '{date}' => Tools::displayDate(date('Y-m-d H:i:s'), (int)$order->id_lang, 1),
				    '{carrier}' => $virtual_product ? Tools::displayError('No carrier') : $carrier->name,
				    '{payment}' => Tools::substr($order->payment, 0, 32),

 

eventually find cashondeliveryplus module on google

Link to comment
Share on other sites

hi mentalspot,

 

i checked my cashondelivery.php file but my file has only few lines.

 

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

}

}

 

 

i couldn't find the codes which you mentioned.

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...