【问题标题】:How to call Magento Api method in another api class?如何在另一个 api 类中调用 Magento Api 方法?
【发布时间】:2018-01-12 20:32:53
【问题描述】:

我在 Magento 中创建了一个模块。我在其中创建Api.php。现在我想在其中调用另一个 api 方法。例如,在我的模块中,我有 2 个文件夹。产品和运输。现在我在mymodule/Shipping/Model/Api.php 中创建了一种方法,并且我想在mymodule/Product/Model/Api.php 中使用它。那么如何在我的产品 api 中导入该 api 类。

【问题讨论】:

    标签: api magento


    【解决方案1】:
    $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();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-11
      • 2022-01-23
      • 1970-01-01
      • 1970-01-01
      • 2020-12-08
      • 1970-01-01
      • 2016-05-19
      • 2013-04-20
      相关资源
      最近更新 更多