Кемеровские программисты php общаются здесь
-
Anonymous
Magento RestApi-OAuth требует много времени для добавления продукта
Сообщение
Anonymous »
Я использую следующий код для добавления продукта в magento через rest apiно добавление одного продукта занимает 10-20 секунд....
Код: Выделить всё
function saveProduct($data) {
$this->productData=json_encode($data);
try{
$oauthClient=new OAuth($this->consumerKey, $this->consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $this->authType);
$oauthClient->disableSSLChecks();
$oauthClient->enableDebug();
$oauthClient->setToken($this->token, $this->secret);
$oauthClient->fetch($this->resourceUrl, $this->productData, $this->oauthMethod, $this->headerType);
$this->responceInfo=$oauthClient->getLastResponseInfo();
$this->responce=$oauthClient->getLastResponse();
if(preg_match(PROD_ID_EXT_PTN,$this->responceInfo['headers_recv'],$m))
$this->productID=$m[1];
}
catch(OAuthException$e) {
$this->oauthError=$e;
}
}
мой файл пользовательского кода RestApi.php
Подробнее здесь:
https://stackoverflow.com/questions/217 ... dd-product
1722272923
Anonymous
Я использую следующий код для добавления продукта в magento через rest apiно добавление одного продукта занимает 10-20 секунд....
[code]function saveProduct($data) {
$this->productData=json_encode($data);
try{
$oauthClient=new OAuth($this->consumerKey, $this->consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $this->authType);
$oauthClient->disableSSLChecks();
$oauthClient->enableDebug();
$oauthClient->setToken($this->token, $this->secret);
$oauthClient->fetch($this->resourceUrl, $this->productData, $this->oauthMethod, $this->headerType);
$this->responceInfo=$oauthClient->getLastResponseInfo();
$this->responce=$oauthClient->getLastResponse();
if(preg_match(PROD_ID_EXT_PTN,$this->responceInfo['headers_recv'],$m))
$this->productID=$m[1];
}
catch(OAuthException$e) {
$this->oauthError=$e;
}
}
[/code]
мой файл пользовательского кода RestApi.php
Подробнее здесь: [url]https://stackoverflow.com/questions/21772515/magento-restapi-oauth-taking-long-time-to-add-product[/url]