tags:

views:

251

answers:

1

I created one module in magento. I create Api.php in that. Now i want to call one another api method in that. For example in my module i have 2 folder. Product and Shipping. Now i create one method in mymodule/Shipping/Model/Api.php and that i want to use in mymodule/Product/Model/Api.php. So how can i import that api class in my product api.

A: 
$myShippingModel = Mage::getSingleton('shipping/api'); // The name here is based on mymodule/Shipping/etc/config.xml; alternatively you can call a model like so:
$myShippingModel = Mage::getSingleton('Mymodule_Shipping_Model_Api');
$myShippingModel->shippingApiMethodCall();
gabrielk