Looked all over the web and have only managed to pull through the api a custom field I’ve added for sales_order.info
using api v1 without any problems, however, I can’t seem to get it to pull through that value when calling a LIST of orders rather than a single order – seen nothing on the web specific to that call.
I’ve created my own module fine and have simply extended the Mage_Sales_Model_Order_Api
class and inside the info()
function I’ve simply added:
$customerId = $order->getCustomerId();
$customer = Mage::getModel('customer/customer')->load($customerId);
$result['sp_user_id'] = $customer->custom('extra_user_id');
$result['sp_client_id'] = $customer->custom('extra_client_id');
Works perfect when calling the sales_order.info
method, but on the list method I'm not getting those fields passed back to me afterwards.
EDITING AGAIN TO BUMP – Hopefully someone has an idea I am really struggling!
Best Answer
In your
config.xml
:Add your custom attributes in observer:
As a final stroke register your fields for APIv2 as well.
in you module's
wsdl.xml
:And
wsi.xml
: