kod çalışırsa bilgi verin çünkü denemsini yapmadım. çalışması lazım ama.
array(3) { [0]=> array(2) { ["id"]=> string(12) "126336291886" ["quantity"]=> string(2) "11" } [1]=> array(2) { ["id"]=> string(12) "125620429075" ["quantity"]=> string(1) "7" } [2]=> array(2) { ["id"]=> string(12) "125620429070" ["quantity"]=> string(2) "26" } }array oluşturdum fakat çalışmadı.
$n11 = new N11($n11Params);
include "baglanti.php";
$sor = "select * FROM oc_product where n11 !='0' order by product_id asc limit 3";
$query=mysql_query($sor);
$urunler = array();
while ($yazdir=mysql_fetch_array($query)) {
$urunler[] = array(
"id" => $yazdir['n11'],
"quantity" => $yazdir['quantity']
);
}
$guncelle = $n11->UpdateStockByStockId($urunler);
var_dump($guncelle ); public function UpdateStockByStockId($id, $quantity) {
$this->setUrl('https://api.n11.com/ws/ProductStockService.wsdl');
self::$_parameters['stockItems'] = ['stockItem' => array('id' => $id, 'quantity' => $quantity, 'version' => '1')];
return self::$_sclient->UpdateStockByStockId(self::$_parameters);
} <soapenv:Envelopexmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.n11.com/ws/schemas">
<soapenv:Header/>
<soapenv:Body>
<sch:UpdateStockByStockIdRequest>
<auth>
<appKey>***</appKey>
<appSecret>***</appSecret>
</auth>
<stockItems>
<!--1 ormorerepetitions:-->
<stockItem>
<id>122375331751</id>
<quantity>10</quantity>
<version>1</version>
<delist>1</delist>
</stockItem>
</stockItems>
</sch:UpdateStockByStockIdRequest>
</soapenv:Body>
</soapenv:Envelope>
ürünleri yukarıdaki gibi göndermem gerek. stockItems -> stockItem -> array(id, adet)
public function UpdateStockByStockId(array $stockItems = Array()) {
$this->setUrl('https://api.n11.com/ws/ProductStockService.wsdl');
self::$_parameters['stockItems'] = $stockItems;
return self::$_sclient->UpdateStockByStockId(self::$_parameters);
}$n11 = new N11($n11Params);
include "baglanti.php";
$sor = "select * FROM oc_product order by product_id asc limit 3";
$query=mysql_query($sor);
$stockItems = array();
while ($yazdir=mysql_fetch_array($query)) {
$stockItems[] = array("id" => $yazdir['n11'], "quantity" => $yazdir['quantity'], "version" => $yazdir['version']);
}
$guncelle = $n11->UpdateStockByStockId($stockItems);
var_dump($guncelle);bu şekilde çözdüm opencart toplu ürün güncellemesi için kullanabilirsiniz.