Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve associated products for configurable product with Magento SOAP API2?

Tags:

java

soap

magento

I'm trying to get all the associated products for a configurable product using the Magento SOAP API v2. The catalogProductLink call looks close, but doesn't handle configurable types. I don't see any other calls that contain the associated product and configurable type information for a product. How have others solved this issue?

I'm using Magento version 1.6 and the SOAP API V2 with Java.

like image 447
Monique Doten Avatar asked Aug 27 '12 18:08

Monique Doten


People also ask

Is product Association available by default in Magento 2?

And the desired functionality is available by default! As a store administrator, you can leverage the out-of-the-box functionality of Magento 2 to decide on which attribute the simple to configurable product association is based.

What B2B features are unavailable in Magento 2 by default?

As a store administrator, you can allow tier prices in the matrix grid as well as the display of product quantity. Thus, it’s a must-have B2B improvement unavailable in Magento 2 by default. Every wholesaler with configurable products can dramatically improve the lives of their customers but introducing the enhanced shopping experience.

What is Magento 2 configurable product matrix grid?

Magento 2 Configurable Product Matrix grid lets customers add multiple product options to the cart simultaneously, enabling Magento 2 quick order functionality. As a store administrator, you can allow tier prices in the matrix grid as well as the display of product quantity.

What does the improved configurable product extension do?

As you can see, the Improved Configurable Product extension also adds the ‘Available Qty’ column to the grid, informing your clients about the number of available configurable product options. Each option also includes a stock status and individual price. Furthermore, you can enable tier prices for the grid.


1 Answers

I looked deeper into this solution and realized that you may need to override the API model (Mage_Catalog_Model_Product_Api) to achieve the results you're looking for.

In the items function (around line 90), you can do something like this:

foreach ($collection as $product) {
    $childProductIds = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($product->getId());
    $result[] = array(
        'product_id' => $product->getId(),
        'sku'        => $product->getSku(),
        'name'       => $product->getName(),
        'set'        => $product->getAttributeSetId(),
        'type'       => $product->getTypeId(),
        'category_ids' => $product->getCategoryIds(),
        'website_ids'  => $product->getWebsiteIds(),
        'children'  => $childProductIds[0],
    );
}
like image 97
Mark1inLA Avatar answered Oct 03 '22 22:10

Mark1inLA