Guest User

Untitled

a guest
Nov 22nd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. class Work_Rewrites_Model_Payment_Info extends Mage_Payment_Model_Info {
  2. public function getMethodInstance()
  3. {
  4. Mage::log("In rewrite payment info model");
  5. if (!$this->hasMethodInstance()) {
  6. if ($this->getMethod()) {
  7. $instance = Mage::helper('payment')->getMethodInstance($this->getMethod());
  8. if ($instance) {
  9. $instance->setInfoInstance($this);
  10. $this->setMethodInstance($instance);
  11. return $instance;
  12. }
  13. }
  14. //return false;
  15. Mage::throwException(Mage::helper('payment')->__('The requested Payment Method is not available.'));
  16. }
  17.  
  18. return $this->_getData('method_instance');
  19. }
  20. }
  21.  
  22. <config>
  23. <global>
  24. <models>
  25. <rewrites>
  26. <class>Work_Rewrites_Model</class>
  27. </rewrites>
  28. <payment>
  29. <rewrite>
  30. <info>Work_Rewrites_Model_Payment_Info</info>
  31. </rewrite>
  32. </payment>
  33. <models>
  34. <global>
  35. <config>
Add Comment
Please, Sign In to add comment