davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
350 stars 343 forks source link

How to add item specifics in AddFixedPriceItemRequest #98

Closed nirmalgoswami closed 7 years ago

nirmalgoswami commented 7 years ago

Hello,

I am trying to solve following error

Missing item feature Mark. Add Brand to this ad, enter a valid value and try again

Tried like this but no luck

$specific = new Types\BrandMPNType();
$specific->Brand = 'brand-name';
$item->ItemSpecifics->NameValueList[] = $specific;

Tried using NameValueListType and NameValueListArrayType but no luck

How to add brand name using item specifics ?

nirmalgoswami commented 7 years ago

Fixed !

Solution

$item->ItemSpecifics = new Types\NameValueListArrayType();
$specifies = new Types\NameValueListType();
$specifies->Name = 'Brand';
$specifies->Value[] = 'brand-name-here';
$item->ItemSpecifics->NameValueList[]=$specifies;