0

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

1 Answer 1

0

Ok.. the file which needs to be extended is

app\code\local\MyModule\Sales\Model\Api2\Order\Rest\Admin\V1.php

and rewrite tag has to be rewritten for this class.

Similarly for customer modifications will be required in

app\code\local\MyModule\Sales\Model\Api2\Order\Rest\Customer\V1.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.