简体   繁体   English

使用REST API创建ID时如何获取magento产品ID

[英]How to get magento product id while creating id with REST API

How can I get product id while creaing it with REST API at some point in the code product id is passed to this method: 在将产品ID传递给此方法的某个时刻,如何在使用REST API创建产品ID的同时如何获得产品ID:

class Mage_Catalog_Model_Api2_Product_Rest_Admin_V1
...
    $this->_multicall($product->getId()); #line 172
...

Regards, 问候,

Ok I did it. 好吧,我做到了。 I have override Mage_Catalog_Model_Api2_Product_Rest_Admin_V1 with mine and in _create() before $this->_multicall($product->getId()); 我重写Mage_Catalog_Model_Api2_Product_Rest_Admin_V1与我和_create()之前$this->_multicall($product->getId()); I have added: 我已经添加了:

# Return magento product id in response
$this->getResponse()->setBody(json_encode(array(
    'magento_product_id' => $product->getId()
)));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM