Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. protected function _saveShipment($shipment)
  2. {
  3. $shipment->getOrder()->setIsInProcess(true);
  4. $transactionSave = Mage::getModel('core/resource_transaction')
  5. ->addObject($shipment)
  6. ->addObject($shipment->getOrder())
  7. ->save();
  8. return $this;
  9. }
  10.  
  11. /app/code/core/Mage/Sales/Model/Order
  12.  
  13. $this->_setState(self::STATE_COMPLETE, true, '', $userNotification);
  14.  
  15. protected function _checkState()
  16. {
  17. if (!$this->getId()) {
  18. return $this;
  19. }
  20.  
  21. $userNotification = $this->hasCustomerNoteNotify() ? $this->getCustomerNoteNotify() : null;
  22.  
  23. if (!$this->isCanceled()
  24. && !$this->canUnhold()
  25. && !$this->canInvoice()
  26. && !$this->canShip()) {
  27. if (0 == $this->getBaseGrandTotal() || $this->canCreditmemo()) {
  28. if ($this->getState() !== self::STATE_COMPLETE) {
  29. $this->_setState(self::STATE_COMPLETE, true, '', $userNotification);
  30. }
  31. }
  32. /**
  33. * Order can be closed just in case when we have refunded amount.
  34. * In case of "0" grand total order checking ForcedCanCreditmemo flag
  35. */
  36. elseif (floatval($this->getTotalRefunded()) || (!$this->getTotalRefunded()
  37. && $this->hasForcedCanCreditmemo())
  38. ) {
  39. if ($this->getState() !== self::STATE_CLOSED) {
  40. $this->_setState(self::STATE_CLOSED, true, '', $userNotification);
  41. }
  42. }
  43. }
  44.  
  45. if ($this->getState() == self::STATE_NEW && $this->getIsInProcess()) {
  46. $this->setState(self::STATE_PROCESSING, true, '', $userNotification);
  47. }
  48. return $this;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement