ismail0234/trendyol-php-api

Ürün bilgilerini güncelleme

Closed this issue · 2 comments

Merhaba, paket genel olarak çok iyi bunun için çok teşekkür ederim fakat ürün detayı güncellemeye ihtiyacım vardı ve eksikti şu şekilde bir düzenleme yaptım.

"IS/Pazaryeri/Trendyol/Services/ProductService.php" içerisine aşağıda bulunan fonksiyonu ekleyin.

/**
 * Ürün bilgilerini güncellemek için kullanılır. (Fiyat ve stok güncellemek için updatePriceAndInventory fonksiyonu kullanılmalıdır)
 *
 *
 * @param array $data
 * @return array
 * @throws TrendyolException
 */
public function updateProducts($data = array())
{
    $this->setApiUrl('https://api.trendyol.com/sapigw/suppliers/{supplierId}/v2/products');
    $this->setMethod("PUT");
    $query = array(
        'items'=> array( 
            'barcode'               => '',
            'title'                 => '',
            'productMainId'         => '',
            'brandId'               => '',
            'categoryId'            => '',
            'quantity'              => '',
            'stockCode'             => '',
            'dimensionalWeight'     => '',
            'description'           => '',
            'currencyType'          => '',
            'listPrice'             => '',
            'salePrice'             => '',
            'cargoCompanyId'        => '',
            'deliveryDuration'      => '',
            'images'                => '',
            'vatRate'               => '',
            'shipmentAddressId'     => '',
            'returningAddressId'    => '',
            'attributes'            => ''
        ),
    );

    return $this->getResponse($query, $data);
}

Daha sonra "IS/Pazaryeri/Trendyol/Helper/Request.php" içerisinden $this->method == 'POST' aramasını yaparak $this->method == 'POST' || $this->method == 'PUT' olarak değiştirin.

Merhaba,

Yaptığın düzenlemeleri commit atabilir misin?

Katkı için teşekkürler