Delete a Order does not remove phoca invoice

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
mrtsilva
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 03 Jun 2011, 18:29

Delete a Order does not remove phoca invoice

Post by mrtsilva »

Hello again,

Normally, no order will be deleted but if for some reason you need this functionality do this.

administrator/components/com_virtuemart/classes/ps_order.php

Code: Select all

function delete_record( $record_id, &$d ) {
......
  $q = "DELETE FROM #__{vm}_shipping_label where order_id=$record_id";
  $db->query($q);

  // Start MOD DELETE PHOCA INFO
  $q = "DELETE FROM #__{vm}_delivery_item where order_id=$record_id";
  $db->query($q);
  $q = "DELETE FROM #__{vm}_deliveries where order_id=$record_id";
  $db->query($q);
  $q = "DELETE FROM #__{vm}_bills where order_id=$record_id";
  $db->query($q);
  // ENDt MOD DELETE PHOCA INFO

  return True;
....
}
Hope this can help someone and be integrated in a next version.
Bye.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Delete a Order does not remove phoca invoice

Post by Jan »

Hi, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply