2016-04-29 2 views

Antwort

0

Dies ist keine vollständige Lösung für Sie, aber es ist definitiv ein Ausgangspunkt für Sie. Luck Gut

$productData = array(
    'additional_attributes' => array(
     'single_data' => array(
      array(
       'key' => 'ean', 
       'value' => 'value', 
      ), 
     ), 
    ), 
); 
$productId = '1000000'; 

$soap = new SoapConnection('1','2','3'); 
echo $soap->_catalogProductUpdate($productId,$productData); 


class SoapConnection 
{ 
    protected $soap_client; 
    protected $session_id; 

    function __construct($soap_host, $api_user, $api_pass) 
    { 
     try{ 
      echo "Connecting to $soap_host\n"; 
      $this->soap_client = new SoapClient($soap_host, array('trace' =>true, 
       'connection_timeout' => 30, 
       'cache_wsdl' => WSDL_CACHE_NONE, 
       'keep_alive' => false 
       )); 
      $this->session_id = $this->soap_client->login($api_user, $api_pass); 
      echo "Connected with session id ".$this->session_id."\n"; 
      return true; 
     } catch (SoapFault $e) { 
      echo "Soap Exception connecting to $soap_host: ". $e->getMessage(). "\n"; 
      var_dump($this->soap_client->__getLastRequest()); var_dump($this->soap_client->__getLastResponse()); 
      return false; 
     } 
    } 

    function _catalogProductUpdate($sku, $args) 
    { 
     try 
     { 
      return $this->soap_client->catalogProductUpdate($this->session_id, $sku, $args); 
     } catch (SoapFault $e) { 
      echo "Soap Exception _catalogProductUpdate: ". $e->getMessage(). "\n"; 
      return false; 
     } 
    } 
} 

EDIT:

hier ist, wie eine csv zu lesen:

$file = fopen("my file path .csv","r"); 

while($row = fgetcsv($file)) 
{ 
    $row[0];//column1 
    $row[1];//column2 etc etc etc 
} 
fclose($file); 
+0

Dank, das ist Arbeit für die manuelle Aktualisierung für jeden ean, aber ich versuchte es aus csv zu importieren, aber es dosent Arbeit, wie kann ich es lesen, die ean und sku von der csv von fgetcsv Funktion? Entschuldigung, aber ich bin nicht Profi in PHP .. – Szer0P

+0

Hinzugefügt in einer CSV-Read-Schleife für Sie, passen Sie einfach Ihre Spalten und Sie sollten alle eingestellt werden – GoatHater

Verwandte Themen