Jump to content

cant get id_order - module bankwire based


Recommended Posts

So this modules is a copy of bankwire but with some changes. This is the file 
 
modulename / controllers / front / payment.php
 
I can't get the order id ! what I'm doing wrong?
 

<?php

class ModuleNamePaymentModuleFrontController extends ModuleFrontController
{
	public $ssl = true;

	public function initContent()
	{
		$this->display_column_left = false;
		parent::initContent();

		$cart = $this->context->cart;
		if (!$this->module->checkCurrency($cart))
			Tools::redirect('index.php?controller=order');

		$currency = $this->context->currency;
		$total = (float)$cart->getOrderTotal(true, Cart::BOTH);
		$mailVars = NULL;
		$customer = new Customer($cart->id_customer);

		$this->module->validateOrder($cart->id, 17, $total, 'Tarjeta de Crédito', NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);

		$this->context->smarty->assign(array(
			'id_order' => $id_order, // why this is NULL ? 
			'nbProducts' => $cart->nbProducts(),
			'cust_currency' => $cart->id_currency,
			'currencies' => $this->module->getCurrency((int)$cart->id_currency),
			'total' => $cart->getOrderTotal(true, Cart::BOTH),
			'this_path' => $this->module->getPathUri(),
			'this_path_bw' => $this->module->getPathUri(),
			'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/'
		));

		$this->setTemplate('payment_execution.tpl');
	}
}

please help!

Link to comment
Share on other sites

Solved : http://www.prestashop.com/forums/topic/192541-order-reference-in-15-uppercase-replace-with-number/page-2
 

<?php

/* -- */

   $query = new DbQuery();
   $query->select('id_order');
   $query->from('orders');
   $query->where('id_cart = ' . (int)$cart->id);
   $query->orderBy('id_order');

   $order = Db::getInstance()->getRow($query);
   $order = (int)$order['id_order'];

Link to comment
Share on other sites

  • 1 year later...

Estoy haciendo algo similar, pero yo necesito recuperar algunos datos personalizados de la tabla "ps_product_lang" 

¿Qué archivos hay que modificar? Entiendo que el script original solo se puede recuperar todas las columnas de la tabla "cart"

Link to comment
Share on other sites

×
×
  • Create New...