News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Order Model CreateOrderHead issue

Started by eliotrayner, July 24, 2018, 14:31:34 PM

Previous topic - Next topic

eliotrayner

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

$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

$orderTable -> bindChecknStore($_orderData);

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


Now it works for me again,

regards
Eliot

Milbo

Thank you, yes that is the right pattern to use. I add it to the core
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

diri

Hi Milbo,

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

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

cu, diri