Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. if ($order->getInvoiceCollection()->count()) {
  2. $_invoices = $order->getInvoiceCollection();
  3.  
  4. if ($_invoices) {
  5. foreach ($_invoices as $invoice) {
  6. $invoice->delete();
  7. }
  8. }
  9. }
  10.  
  11. $items = $order->getAllItems();
  12. foreach ($items as $k => $item) {
  13. echo $item->getId() . "n";
  14. $item->setQtyInvoiced(0);
  15. $item->save();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement