Author Topic: Order Model CreateOrderHead issue  (Read 159 times)

eliotrayner

  • Beginner
  • *
  • Posts: 4
Order Model CreateOrderHead issue
« on: July 24, 2018, 14:31:34 pm »
Hi Guys

I use the Orders model to create orders from a plugin.

I have been using CreateOrderHead() successfully for a while until it seems it broke in 3.2.14?

administrator\components\com_virtuemart\models\orders.php around line 2508

Code: [Select]
$orderTable -> bindChecknStore($_orderData);

$db = JFactory::getDBO();
$_orderID = $db->insertid();

$_orderID doesn't return a virtuemart_order_id.

I updated administrator\components\com_virtuemart\models\orders.php around line 2508 to

Code: [Select]
$orderTable -> bindChecknStore($_orderData);

$db = JFactory::getDBO();
$_orderID = $orderTable->virtuemart_order_id;

Now it works for me again,

regards
Eliot

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9607
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Order Model CreateOrderHead issue
« Reply #1 on: July 24, 2018, 19:11:30 pm »
Thank you, yes that is the right pattern to use. I add it to the core
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

diri

  • Beginner
  • *
  • Posts: 37
Re: Order Model CreateOrderHead issue
« Reply #2 on: July 26, 2018, 14:51:50 pm »
Hi Milbo,

little typo:
$_orderID = $orderTable->virtuemart_order_id;;

$_orderID = $orderTable->virtuemart_order_id;
might be better.

cu, diri