how to get all configurable product attribute like color,size,brand,shipping etc in soap api V2, I am totally new in this field. Thanks in advance. Here is my code where i have to fetch all the configurable attribute with label to my android application. I tried to copy the description module same in color module but its return the numeric digit rather than color text.

// Get products in category
require_once('../app/Mage.php');//Path to Magento umask(0);

    $proxy = new SoapClient('http://www.prash.com/index.php/api/v2_soap/?wsdl'); // TODO : change url
    $sessionId = $proxy->login('prash', 'prash123@'); // TODO : change login and pwd if necessary

    $products= $proxy->catalogCategoryAssignedProducts($sessionId,$categoryId);


  foreach ($products as $item) { 

    $product2 = Mage::getModel('catalog/product')->load($item->product_id);
    $productMediaConfig = Mage::getModel('catalog/product_media_config');
    $baseImageUrl = $productMediaConfig->getMediaUrl($product2->getImage());


           $baseImageUrl = $productMediaConfig->getMediaUrl($product2->getImage());


    $statusen= Mage_Catalog_Model_Product_Status::STATUS_ENABLED;


  //return array of products
  //echo "<pre>";
  //echo "</pre>";
  echo json_encode($itemDetails);
  echo "error";

Use below code instead of getColor() because getColor() will return the id of that color.


to get all attributes of front end try below code

$attributes = $product->getAttributes();

foreach ($attributes as $attribute) { 
echo $label=$attribute->getFrontendLabel();
echo $value = $attribute->getFrontend()->getValue($product);
  • Thanks for your reply. I got the value now, Could you please show me how can I will be able to get complete additional data like brand,size,color and shipping etc Dec 3 '16 at 10:05
  • @PrashantDas feel free to raise new question :) Dec 3 '16 at 10:07
  • @PrashantDas find your requirement in updated answer and welcome to magento community :) Dec 3 '16 at 10:21
  • thanks for your answer...but could you please tell where to place this line of code and in your answer ($product) will be ($product2) Dec 3 '16 at 10:53
  • @PrashantDas yes $product2. Actually your code is not optimized. Why you are loading product each time? you can load it in one go and play it with in foreach. And yes more important first try on your own, in case you stuck some where then raise question don't expect full code solution. Dec 3 '16 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.