Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited title
Link

Extending of Magento Unable to extend Orders Rest Api of Magento

deleted 872 characters in body
Source Link

I am trying to extend Orders rest api in magento. For e.g To create a new update method. For doing this, I have created a new class in the local copy: The file I am trying to override is : app\code\core\Mage\Sales\Model\Api2\Order.php

But when I try to access the new method then I get a "Resource method not implemented" error message. I believe, the rewrite does not work in this case.

Similarly, I attempted to rewrite products rest api but over there rewrite method works correctly.

Just for your reference, I have pasted the code for Update Orders Rest Api below.

  1. \app\code\local\MyModulename\Sales\Model\Api2\Order.php

    class MyModulename_Sales_Model_Api2_Order extends Mage_Sales_Model_Api2_Order {

      /**
      *class GetMyModulename_Sales_Model_Api2_Order ordersextends listMage_Sales_Model_Api2_Order
      *{
      
     * @return array
      */
     protected function _update(array $data)
         {
           echo 'in update function';
         }    
     }
    

    }

  2. \app\code\local\MyModulename\Sales\etc\api2.xml enter image description here

    sales/api2_order 1 1 1 1  
  3. app\code\local\MyModulename\Sales\etc\config.xml enter image description here

    0.1.0 MyModulename_Sales_Model_Api2_Order  

Please note, this module is in active mode.

Any help would be appreciated. Thanks

I am trying to extend Orders rest api in magento. For e.g To create a new update method. For doing this, I have created a new class in the local copy: The file I am trying to override is : app\code\core\Mage\Sales\Model\Api2\Order.php

But when I try to access the new method then I get a "Resource method not implemented" error message. I believe, the rewrite does not work in this case.

Similarly, I attempted to rewrite products rest api but over there rewrite method works correctly.

Just for your reference, I have pasted the code for Update Orders Rest Api below.

  1. \app\code\local\MyModulename\Sales\Model\Api2\Order.php

    class MyModulename_Sales_Model_Api2_Order extends Mage_Sales_Model_Api2_Order {

      /**
      * Get orders list
      *
      * @return array
      */
     protected function _update(array $data)
     {
       echo 'in update function';
     }
    

    }

  2. \app\code\local\MyModulename\Sales\etc\api2.xml

    sales/api2_order 1 1 1 1
  3. app\code\local\MyModulename\Sales\etc\config.xml

    0.1.0 MyModulename_Sales_Model_Api2_Order

Please note, this module is in active mode.

Any help would be appreciated. Thanks

I am trying to extend Orders rest api in magento. For e.g To create a new update method. For doing this, I have created a new class in the local copy: The file I am trying to override is : app\code\core\Mage\Sales\Model\Api2\Order.php

But when I try to access the new method then I get a "Resource method not implemented" error message. I believe, the rewrite does not work in this case.

Similarly, I attempted to rewrite products rest api but over there rewrite method works correctly.

Just for your reference, I have pasted the code for Update Orders Rest Api below.

  1. \app\code\local\MyModulename\Sales\Model\Api2\Order.php

     class MyModulename_Sales_Model_Api2_Order extends Mage_Sales_Model_Api2_Order
     {
     
         protected function _update(array $data)
         {
           echo 'in update function';
         }    
     }
    
  2. \app\code\local\MyModulename\Sales\etc\api2.xml enter image description here

     
  3. app\code\local\MyModulename\Sales\etc\config.xml enter image description here

     

Please note, this module is in active mode.

Any help would be appreciated. Thanks

Source Link

Extending of Magento Orders Rest Api

I am trying to extend Orders rest api in magento. For e.g To create a new update method. For doing this, I have created a new class in the local copy: The file I am trying to override is : app\code\core\Mage\Sales\Model\Api2\Order.php

But when I try to access the new method then I get a "Resource method not implemented" error message. I believe, the rewrite does not work in this case.

Similarly, I attempted to rewrite products rest api but over there rewrite method works correctly.

Just for your reference, I have pasted the code for Update Orders Rest Api below.

  1. \app\code\local\MyModulename\Sales\Model\Api2\Order.php

    class MyModulename_Sales_Model_Api2_Order extends Mage_Sales_Model_Api2_Order {

      /**
      * Get orders list
      *
      * @return array
      */
     protected function _update(array $data)
     {
       echo 'in update function';
     }
    

    }

  2. \app\code\local\MyModulename\Sales\etc\api2.xml

    sales/api2_order 1 1 1 1
  3. app\code\local\MyModulename\Sales\etc\config.xml

    0.1.0 MyModulename_Sales_Model_Api2_Order

Please note, this module is in active mode.

Any help would be appreciated. Thanks