2017-01-22 1 views
1

Kann mit SOAP Magento API 1.9 immer nur eine Attributoption festgelegt werden? Ich habe versucht, mehrere Optionen unter Verwendung von XML zu setzen, aber keinen Erfolg. Kann jemand helfen?Festlegen der Attributoption in der Magento SOAP-API XML

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> 
 
    <soapenv:Header/> 
 
    <soapenv:Body> 
 
     <urn:catalogProductAttributeAddOption soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
 
     <sessionId xsi:type="xsd:string">8e72f087a574773ba0dc017e8268d268</sessionId> 
 
     <attribute xsi:type="xsd:string">215</attribute> 
 
     <data xsi:type="urn:catalogProductAttributeOptionEntityToAdd"> 
 
      <!--You may enter the following 3 items in any order--> 
 
      <label soapenc:arrayType="urn:catalogProductAttributeOptionLabelEntity[3]" xsi:type="urn:catalogProductAttributeOptionLabelArray"> 
 
      <item xsi:type="ns1:catalogProductAttributeOptionLabelEntity"> 
 
        <store_id xsi:type="xsd:string">0</store_id> 
 
        <value xsi:type="xsd:string">steel6</value> 
 
       </item> 
 
       <item xsi:type="ns1:catalogProductAttributeOptionLabelEntity"> 
 
        <store_id xsi:type="xsd:string">0</store_id> 
 
        <value xsi:type="xsd:string">steel1</value> 
 
       </item> 
 
       <item xsi:type="ns1:catalogProductAttributeOptionLabelEntity"> 
 
        <store_id xsi:type="xsd:string">0</store_id> 
 
        <value xsi:type="xsd:string">steel2</value> 
 
       </item> 
 
      </label> 
 
      <order xsi:type="xsd:int">0</order> 
 
      <is_default xsi:type="xsd:int">0</is_default> 
 
     </data> 
 
     </urn:catalogProductAttributeAddOption> 
 
    </soapenv:Body> 
 
</soapenv:Envelope>

Antwort

0

Ich habe endlich eine Antwort auf meine obige Frage, Magento API „catalogProductAttributeAddOption“ verwendet wird, nur eine Option zu einer Zeit eingestellt, jedoch kann API erweitert werden, um mehr einstellen Optionen.

So API gesetzt Option

wäre

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> 
 
    <soapenv:Header/> 
 
    <soapenv:Body> 
 
     <urn:catalogProductAttributeAddOption soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
 
     <sessionId xsi:type="xsd:string">8e72f087a574773ba0dc017e8268d268</sessionId> 
 
     <attribute xsi:type="xsd:string">215</attribute> 
 
     <data xsi:type="urn:catalogProductAttributeOptionEntityToAdd"> 
 
      <!--You may enter the following 3 items in any order--> 
 
      <label soapenc:arrayType="urn:catalogProductAttributeOptionLabelEntity[1]" xsi:type="urn:catalogProductAttributeOptionLabelArray"> 
 
      <item xsi:type="ns1:catalogProductAttributeOptionLabelEntity"> 
 
        <store_id xsi:type="xsd:string">0</store_id> 
 
        <value xsi:type="xsd:string">steel1</value> 
 
       </item> 
 
      </label> 
 
      <order xsi:type="xsd:int">0</order> 
 
      <is_default xsi:type="xsd:int">0</is_default> 
 
     </data> 
 
     </urn:catalogProductAttributeAddOption> 
 
    </soapenv:Body> 
 
</soapenv:Envelope>

Verwandte Themen