Ebatns将UPC和EAN麻烦变成

时间:2016-01-17 10:24:04

标签: php ebay

我试图将UPC和EAN信息发送到Variations.Variation.VariationProductListingDetails.UPC容器中,根据我发送的请求,一切都应该没问题。但是当我登入My Ebay>时,我看不到EAN(或#34;不适用")项目>修改变体

我使用Ebatns。

对于多变量列表我:

1)将BrandMPN信息发送到item.ProductListingDetails.BrandMPN容器中,并将它们正确显示到列表中

2)再次将BrandMPN信息发送到item.ItemSpecifics.NameValueList容器中,建议使用KB:https://ebaydts.com/eBayKBDetails?KBid=5061

3)不要将UPC和EAN信息发送到item.ProductListingDetails容器

4)将UPC和/或EAN发送到:item.variations.variation.VariationProductListingDetails.UPC和item.variations.variation.VariationProductListingDetails.EAN

虽然我在列表页面(我的品牌,EAN,UPC或"不适用"正确显示)中看到了信息,但我没有看到EANS或"不适用&#34 34;到我的列表变体详细信息。

这是我对多变量列表的请求:

[ProductListingDetails:protected] => ProductListingDetailsType Object
                 (
                     [ProductID:protected] => 
                     [IncludeStockPhotoURL:protected] => 
                     [IncludePrefilledItemInformation:protected] => 
                     [UseStockPhotoURLAsGallery:protected] => 
                     [StockPhotoURL:protected] => 
                     [Copyright:protected] => 
                     [ProductReferenceID:protected] => 
                     [DetailsURL:protected] => 
                     [ProductDetailsURL:protected] => 
                     [ReturnSearchResultOnDuplicates:protected] => 
                     [ListIfNoProduct:protected] => 
                     [ISBN:protected] => 
                     [UPC:protected] => 
                     [EAN:protected] => 
                     [BrandMPN:protected] => BrandMPNType Object
                         (
                             [Brand:protected] => Brand name
                             [MPN:protected] => Custom MPN
                             [_dataInValueArray:protected] => 
                             [_typeName:protected] => BrandMPNType
                             [_ns:protected] => 
                             [_nsURI:protected] => urn:ebay:apis:eBLBaseComponents
                             [_isArrayType:protected] => 
                             [_attributes] => Array
                                 (
                                 )

                             [attributeValues] => 
                             [value:protected] => 
                         )

                     [TicketListingDetails:protected] => 
                     [UseFirstProduct:protected] => 
                     [_dataInValueArray:protected] => 
                     [_typeName:protected] => ProductListingDetailsType
                     [_ns:protected] => 
                     [_nsURI:protected] => urn:ebay:apis:eBLBaseComponents
                     [_isArrayType:protected] => 
                     [_attributes] => Array
                         (
                         )

                     [attributeValues] => 
                     [value:protected] => 
                 )

 ............. other stuff ...............

 [ItemSpecifics:protected] => NameValueListArrayType Object
                 (
                     [NameValueList:protected] => Array
                         (
                             [0] => NameValueListType Object

 .................................

  [Variations:protected] => VariationsType Object
                 (
                     [Variation:protected] => Array
                         (
                             [0] => VariationType Object
                                 (
                                     [SKU:protected] => SKU_2
                                     [StartPrice:protected] => 69.33006
                                     [Quantity:protected] => 50
                                     [VariationSpecifics:protected] => NameValueListArrayType Object

 ................................

                                     [VariationProductListingDetails] => VariationProductListingDetails Object
                                         (
                                             [ProductID:protected] => 
                                             [IncludeStockPhotoURL:protected] => 
                                             [IncludePrefilledItemInformation:protected] => 
                                             [UseStockPhotoURLAsGallery:protected] => 
                                             [StockPhotoURL:protected] => 
                                             [Copyright:protected] => 
                                             [ProductReferenceID:protected] => 
                                             [DetailsURL:protected] => 
                                             [ProductDetailsURL:protected] => 
                                             [ReturnSearchResultOnDuplicates:protected] => 
                                             [ListIfNoProduct:protected] => 
                                             [ISBN:protected] => 
                                             [UPC:protected] => Non applicabile
                                             [EAN:protected] => Non applicabile
                                             [BrandMPN:protected] => 
                                             [TicketListingDetails:protected] => 
                                             [UseFirstProduct:protected] => 
                                             [_dataInValueArray:protected] => 
                                             [_typeName:protected] => ProductListingDetailsType
                                             [_ns:protected] => 
                                             [_nsURI:protected] => urn:ebay:apis:eBLBaseComponents
                                             [_isArrayType:protected] => 
                                             [_attributes] => Array
                                                 (
                                                 )

                                             [attributeValues] => 
                                             [value:protected] => 
                                         )

                                 )

这是我的VariationProductListingDetails类:

require_once 'EbatNs_ComplexType.php';

 /**
   * This type defines the <b>VariationProductListingDetails</b> container that is used to specify an EAN, an ISBN, or a UPC value to identify a specific product variation in a multi-variation listing. For multi-variation listings, the same product identifier type must be used for all product variations within the listing. For instance, if one product variation uses ISBNs, all product variations must use ISBN values.
   * 
  **/

 class VariationProductListingDetailsType extends EbatNs_ComplexType
 {
     /**
     * @var string
     **/
     protected $ISBN;

     /**
     * @var string
     **/
     protected $UPC;

     /**
     * @var string
     **/
     protected $EAN;


     /**
      * Class Constructor 
      **/
     function __construct()
     {
         parent::__construct('VariationProductListingDetailsType', 'urn:ebay:apis:eBLBaseComponents');
         if (!isset(self::$_elements[__CLASS__]))
         {
             self::$_elements[__CLASS__] = array_merge(self::$_elements[get_parent_class()],
             array(
                 'ISBN' =>
                 array(
                     'required' => false,
                     'type' => 'string',
                     'nsURI' => 'http://www.w3.org/2001/XMLSchema',
                     'array' => false,
                     'cardinality' => '0..1'
                 ),
                 'UPC' =>
                 array(
                     'required' => false,
                     'type' => 'string',
                     'nsURI' => 'http://www.w3.org/2001/XMLSchema',
                     'array' => false,
                     'cardinality' => '0..1'
                 ),
                 'EAN' =>
                 array(
                     'required' => false,
                     'type' => 'string',
                     'nsURI' => 'http://www.w3.org/2001/XMLSchema',
                     'array' => false,
                     'cardinality' => '0..1'
                 )));
         }
         $this->_attributes = array_merge($this->_attributes,
         array(
 ));
     }

     /**
      * @return string
      **/
     function getISBN()
     {
         return $this->ISBN;
     }

     /**
      * @return void
      **/
     function setISBN($value)
     {
         $this->ISBN = $value;
     }

     /**
      * @return string
      **/
     function getUPC()
     {
         return $this->UPC;
     }

     /**
      * @return void
      **/
     function setUPC($value)
     {
         $this->UPC = $value;
     }

     /**
      * @return string
      **/
     function getEAN()
     {
         return $this->EAN;
     }

     /**
      * @return void
      **/
     function setEAN($value)
     {
         $this->EAN = $value;
     }

 }

这就是我发出请求的方式:$ vt是VariationType

require_once 'EbatNs_ComplexType.php';

 /**
   * This type defines the <b>VariationProductListingDetails</b> container that is used to specify an EAN, an ISBN, or a UPC value to identify a specific product variation in a multi-variation listing. For multi-variation listings, the same product identifier type must be used for all product variations within the listing. For instance, if one product variation uses ISBNs, all product variations must use ISBN values.
   * 
  **/

 class VariationProductListingDetailsType extends EbatNs_ComplexType
 {
     /**
     * @var string
     **/
     protected $ISBN;

     /**
     * @var string
     **/
     protected $UPC;

     /**
     * @var string
     **/
     protected $EAN;


     /**
      * Class Constructor 
      **/
     function __construct()
     {
         parent::__construct('VariationProductListingDetailsType', 'urn:ebay:apis:eBLBaseComponents');
         if (!isset(self::$_elements[__CLASS__]))
         {
             self::$_elements[__CLASS__] = array_merge(self::$_elements[get_parent_class()],
             array(
                 'ISBN' =>
                 array(
                     'required' => false,
                     'type' => 'string',
                     'nsURI' => 'http://www.w3.org/2001/XMLSchema',
                     'array' => false,
                     'cardinality' => '0..1'
                 ),
                 'UPC' =>
                 array(
                     'required' => false,
                     'type' => 'string',
                     'nsURI' => 'http://www.w3.org/2001/XMLSchema',
                     'array' => false,
                     'cardinality' => '0..1'
                 ),
                 'EAN' =>
                 array(
                     'required' => false,
                     'type' => 'string',
                     'nsURI' => 'http://www.w3.org/2001/XMLSchema',
                     'array' => false,
                     'cardinality' => '0..1'
                 )));
         }
         $this->_attributes = array_merge($this->_attributes,
         array(
 ));
     }

     /**
      * @return string
      **/
     function getISBN()
     {
         return $this->ISBN;
     }

     /**
      * @return void
      **/
     function setISBN($value)
     {
         $this->ISBN = $value;
     }

     /**
      * @return string
      **/
     function getUPC()
     {
         return $this->UPC;
     }

     /**
      * @return void
      **/
     function setUPC($value)
     {
         $this->UPC = $value;
     }

     /**
      * @return string
      **/
     function getEAN()
     {
         return $this->EAN;
     }

     /**
      * @return void
      **/
     function setEAN($value)
     {
         $this->EAN = $value;
     }

 }

1 个答案:

答案 0 :(得分:0)

好的,我对此进行了整理:我使用的是AddItem而不是AddFixedPriceItem和旧版本的EbatNS,其中VariationProductListingDetails未正确声明