Reading list Switch to dark mode

    Magento SOAP API

    Updated 9 October 2012

    Magento SOAP API – Magento is best e-commerce tool no doubt and SOAP integration in magento is “Cherry in the cake” .Magento provides a very simple SOAP API integration .

    1 – Go to Magento Admin -> web services ->role and add a simple rule over there lets say “WebKul”

    2 – Go to Magento Admin -> web services ->user and add a user with the detailed info most important fact is to set the permission of user to all instead of custom

    3 – Create a Php file outside the magento and add the sample code.

    $devClient = new Soapclient('http://192.168.1.61/magento/index.php/api/?wsdl'); 
    $devSession = $devClient->login('apiuser', 'apipassword'); 
    $productList = $devClient->call($devSession, 'catalog_product.list'); 
    foreach ($productList as $product){ 
    $theProduct = array(); 
    $theProduct['product'] = $product; 
    $theProduct['attributeSet'] = current($devClient->call($devSession, 'product_attribute_set.list')); 
    $theProduct['info'] = $devClient->call($devSession, 'catalog_product.info', $product['sku']); 
    $theProduct['related'] = $devClient->call($devSession, 'catalog_product_link.list', array('related', $product['sku'])); 
    $theProduct['up_sell'] = $devClient->call($devSession, 'catalog_product_link.list', array('up_sell', $product['sku'])); 
    $theProduct['cross_sell'] = $devClient->call($devSession, 'catalog_product_link.list', array('cross_sell', $product['sku'])); 
    $theProduct['grouped'] = $devClient->call($devSession, 'catalog_product_link.list', array('grouped', $product['sku'])); 
    $theProduct['images'] = $devClient->call($devSession, 'catalog_product_attribute_media.list', $product['sku']); 
    $theProduct['tierprice'] = $devClient->call($devSession, 'product_tier_price.info', $product['sku']); 
    $theProduct['stock'] = $devClient->call($devSession, 'product_stock.list', $product['sku']);
    $allProducts[] = $theProduct; 
    }
    echo '$allProducts:' . print_r($allProducts, true) . '';

     

    Searching for an experienced
    Magento Company ?
    Find out More
    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home