• 13-06-2018, 18:24:41
    #1
    Üyeliği durduruldu
    Arkadaşlar selamlar

    n11 apisinde bir yerde işin içinden çıkamadım .

    Alıntı
    'stockItems' =>
    [
    'stockItem' =>
    [
    'quantity' => 100,
    'sellerStockCode' => $anaaurunurunkodu,
    'attributes' =>['attribute' =>['name' => 'Renk','value' =>'Yeşil']],
    'optionPrice' => $q7_fiyat
    ]
    ]
    Şu kısımda renk adetini birden fazla yapmaya çalışıyorum ancak hangi yöntemi denediysem çıkamadım işin içinden. Ücretli veya ücretsiz yardımcı olabilecek birileri varmıdır ?
  • 13-06-2018, 19:08:40
    #2
    Merhaba. Şu sekilde denediniz mi?


    'attributes' =>['attribute' =>['name' => 'Renk', 'value' =>'Yeşil', 'value'=> 'Mor']],
  • 13-06-2018, 21:13:46
    #3
    Üyeliği durduruldu
    WebilisimNET adlı üyeden alıntı: mesajı görüntüle
    Merhaba. Şu sekilde denediniz mi?


    'attributes' =>['attribute' =>['name' => 'Renk', 'value' =>'Yeşil', 'value'=> 'Mor']],
    evet hocam denedim , yine olmadı.
  • 13-06-2018, 21:23:37
    #4
    Merttug adlı üyeden alıntı: mesajı görüntüle
    evet hocam denedim , yine olmadı.
    Merhaba.
    Normalde tek renk yapınca kabul ediyor mu?
  • 13-06-2018, 21:29:43
    #5
    Üyeliği durduruldu
    WebilisimNET adlı üyeden alıntı: mesajı görüntüle
    Merhaba.
    Normalde tek renk yapınca kabul ediyor mu?
    Evet tek renk yapınca kabul ediyor

    Çıktısı da şu şekilde ;

    Alıntı
    object(stdClass)#3 (2) { ["result"]=> object(stdClass)#4 (1) { ["status"]=> string(7) "success" } ["product"]=> object(stdClass)#5 (11) { ["id"]=> int(263277798) ["productSellerCode"]=> string(6) "783652" ["title"]=> string(47) "Huawei P Smart Kılıf Zore Crash Silikon Kapak" ["subtitle"]=> string(47) "Huawei P Smart Kılıf Zore Crash Silikon Kapak" ["price"]=> string(5) "24.90" ["displayPrice"]=> string(5) "24.90" ["saleStatus"]=> int(2) ["approvalStatus"]=> int(1) ["stockItems"]=> object(stdClass)#6 (1) { ["stockItem"]=> object(stdClass)#7 (12) { ["sellerStockCode"]=> string(6) "783652" ["optionPrice"]=> string(5) "24.90" ["currencyAmount"]=> string(5) "24.90" ["displayPrice"]=> string(5) "24.90" ["gtin"]=> string(0) "" ["mpn"]=> string(0) "" ["oem"]=> string(0) "" ["bundle"]=> bool(false) ["id"]=> int(126457676799) ["version"]=> int(0) ["quantity"]=> int(100) ["attributes"]=> object(stdClass)#8 (1) { ["attribute"]=> object(stdClass)#9 (2) { ["name"]=> string(4) "Renk" ["value"]=> string(3) "Mor" } } } } ["currencyAmount"]=> string(5) "24.90" ["currencyType"]=> int(1) } }
  • 13-06-2018, 22:09:37
    #6
    Şu şekilde deneyin birde,

    'stockItems' =>
    [
    'stockItem' =>
    [
    'quantity' => 100,
    'sellerStockCode' => $anaaurunurunkodu,
    'attributes' =>['attribute' =>['name' => 'Renk','value' =>'Yeşil']],
    'attributes' =>['attribute' =>['name' => 'Renk','value' =>'Mor']],
    'optionPrice' => $q7_fiyat
    ]
    ]
  • 13-06-2018, 22:16:50
    #7
    Üyeliği durduruldu
    WebilisimNET adlı üyeden alıntı: mesajı görüntüle
    Şu şekilde deneyin birde,

    'stockItems' =>
    [
    'stockItem' =>
    [
    'quantity' => 100,
    'sellerStockCode' => $anaaurunurunkodu,
    'attributes' =>['attribute' =>['name' => 'Renk','value' =>'Yeşil']],
    'attributes' =>['attribute' =>['name' => 'Renk','value' =>'Mor']],
    'optionPrice' => $q7_fiyat
    ]
    ]

    http://prntscr.com/jum6az

    Aynı üstadım

    Sondakini alıyor kayde.
  • 13-06-2018, 22:57:48
    #8
    Merttug adlı üyeden alıntı: mesajı görüntüle
    http://prntscr.com/jum6az

    Aynı üstadım

    Sondakini alıyor kayde.
    Şöyle deneyin bir de


    'attributes' =>['attribute' =>['name' => 'Renk', 'value' =>'Yeşil', 'name' => 'Renk 2', 'value' =>'Yeşil']],
  • 13-06-2018, 23:29:53
    #9
    Üyeliği durduruldu
    WebilisimNET adlı üyeden alıntı: mesajı görüntüle
    Şöyle deneyin bir de


    'attributes' =>['attribute' =>['name' => 'Renk', 'value' =>'Yeşil', 'name' => 'Renk 2', 'value' =>'Yeşil']],
    Aynısı üstadım

    dosya şu şekilde ;


    Alıntı
    <?php

    include "n11sinifi.php";
    include "../system/ayar.php";
    $q3_urunAdi=$_POST["q3_urunAdi"];
    $anaaurunurunkodu = rand(0,900000);
    $q4_altBaslik=$_POST["q4_altBaslik"];
    if($q4_altBaslik==""){
    $q4_altBaslik=$q3_urunAdi;
    }
    $aciklama=$_POST["metin"];
    $q7_fiyat=$_POST["q7_fiyat"];
    $kategorisec=$_POST["kategorisec"];
    $ilkresim=$_POST["q12_ekranKoruyucu12"];

    $ilkrenktablosu=$_POST["ilkrenktablosu"];
    $ikincirenktablosu=$_POST["ikincirenktablosu"];
    $ucuncurenktablosu=$_POST["ucuncurenktablosu"];
    $dorduncurenktablosu=$_POST["dorduncurenktablosu"];
    $besincirenktablosu=$_POST["besincirenktablosu"];

    function kisalt($par, $uzunluk = 50)
    {
    if( $uzunluk < strlen($par) )
    {
    $par = mb_substr($par, 0, $uzunluk, "UTF-8");
    }

    return $par;
    }


    $n11Params = ['appKey' => '****',
    'appSecret' => '***'];
    $n11 = new N11($n11Params);

    $saveProduct = $n11->SaveProduct(
    [
    'productSellerCode' => $anaaurunurunkodu,
    'title' => $q3_urunAdi,
    'subtitle' => $q4_altBaslik,
    'description' => $aciklama,
    'attributes' =>
    [

    'attribute' =>
    [
    'name' => 'Renk',
    'value' =>'Yeşil'
    ],
    ],
    'category' =>
    [
    'id' => $kategorisec
    ],
    'price' => $q7_fiyat,
    'currencyType' => 'TL',
    'images' =>
    [
    'image' =>
    [
    'url' => $ilkresim,
    'order' => 1
    ]
    ],
    'saleStartDate' => '',
    'saleEndDate' => '',
    'productionDate' => '',
    'expirationDate' => '',
    'productCondition' => '1',
    'preparingDay' => '3',
    'discount' => 0,
    'shipmentTemplate' => 'kilifkutusu',
    'stockItems' =>
    [
    'stockItem' =>
    [
    'quantity' => 100,
    'sellerStockCode' => $anaaurunurunkodu,
    'attributes' =>['attribute' =>['name' => 'Renk', 'value' =>'Yeşil', 'name' => 'Renk 2', 'value' =>'Yeşil']],


    'optionPrice' => $q7_fiyat
    ]
    ]
    ]
    );
    var_dump($saveProduct);


    $hatakodu = $saveProduct->result->errorMessage;
    if($hatakodu==""){
    echo "Eklenme Başarılı";
    }else {
    echo $hatavarmi="N11 E aktarım sağlanamadı. Hata Kodu :".$hatakodu;
    }
    ?>