Author Topic: Order item status update  (Read 5477 times)

manelzaera

  • Beginner
  • *
  • Posts: 3
Order item status update
« on: March 15, 2006, 12:00:33 pm »
Hi,

We have developed a new workflow in VirtueMart that creates orders with a unique item (due to workflow requirements). Then, we monitorize the order status to see when it changes. I realized that when order status changes order item status doesn't.

Then I changed ps_order.order_status_update(). Before if (ENABLE_DOWNLOADS == '1') you can insert this:

Code: [Select]

$q = "SELECT order_item_id FROM #__{vm}_order_item WHERE order_id=".$d['order_id'];
$db->query($q);
$dbu = new ps_DB;
while ($db->next_record()) {
$item_id = $db->f("order_item_id");
$q  = "UPDATE #__{vm}_order_item SET order_status='".$d["order_status"]."'"
. "\n, mdate='" . $timestamp . "' "
. "\n WHERE order_item_id=".$item_id;
$dbu->query( $q );
}

Then status for order items will match status for their orders.

active8

  • Jr. Member
  • **
  • Posts: 56
Re: Order item status update
« Reply #1 on: June 15, 2006, 15:40:00 pm »
what file needs editing here then???

 ::)

jaguar

  • Guest
Re: Order item status update
« Reply #2 on: June 26, 2006, 17:17:12 pm »
what file needs editing here then???

 ::)

the file is:

/administrator/components/com_virtuemart/classes/ps_order.php

Pablo

jaguar

  • Guest
Re: Order item status update
« Reply #3 on: June 26, 2006, 17:27:02 pm »
I need to update the order status to allow downloading of a purchased file.

Is it enought to call the function with an array conitaing only the following?

Code: [Select]
$d["order_status"]="C"
Other than calling 'order_status_update' should something else be done?

Pablo