How do I retrieve simple products associated with configurable products

magento get associated products of configurable product
magento 2 get selected simple product id in configurable product
magento 2 get child products of grouped
magento 2 get configurable product options in list page
magento 2 configurable product attributes
magento 2 create configurable product from existing simple products
simple details on configurable product for magento 2
magento 2 assign simple product to configurable programmatically

Hi i'm using magento soap api v2 with c#. Do far I have been calling

 var groupedProducts = magentoService.catalogProductLinkList(sessionId, "grouped", id, "productId");

that does return grouped Products, but instead I would like to retrieve simple products such as green large t-shirt which is associated with configurable t-shirt.

How can this be achieved?


Unfortunatelly that's not possible with the magento SOAP api. You are not able to retrieve child products of a parent product via the api. Believe me, I have tackled this myself some time ago. I can suggest 2 fixes and 1 workaround.

Workaround - Try to retrieve child products by sku or name. This can work provided that all your child products use the parent's name or sku as the prefix. That's how I resolved it in the beginning and it worked well as long as the client did not introduce child product names that did not match the parent name. Here's some sample code:

//fetch configurable products
filters filter = new filters();
filter.filter = new associativeEntity[1];
filter.filter[0] = new associativeEntity();
filter.filter[0].key = "type_id";
filter.filter[0].value = "configurable";

//get all configurable products
var configurableProducts = service.catalogProductList(sessionID, filter, storeView);

foreach (var parent in configurableProducts)
{
    filters filter = new filters();
    filter.filter = new associativeEntity[1];
    filter.filter[0] = new associativeEntity();
    filter.filter[0].key = "type_id";
    filter.filter[0].value = "configurable";
    filter.complex_filter = new complexFilter[1];
    filter.complex_filter[0] = new complexFilter();
    filter.complex_filter[0].key = "sku";
    filter.complex_filter[0].value = new associativeEntity() { key="LIKE", value=parent.sku + "%" };

    var simpleProducts = service.catalogProductList(sessionID, filter, storeView);

    //do whatever you need with the simple products

}

Fix #1 - Free - Write your own api extension. To retrieve child products you could use:

$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);

You then send the results to the api caller and all should be well. I have not tried that myself, though, so I'm not sure if there are any other problems on the way.

Fix #2 - Paid - Get the (excellent, but pricey) CoreAPI extension from netzkollektiv. That's what I did when the workaround stopped working out for me and never regretted this decision.

I need to get details of all simple products associated with Configurable product along with product attributes. I used the existing magento functionality which  In the Create Simple Associated Product section, click the Create Empty button. A pop-up window with a blank Product Information form appears. Complete the required fields as you would for any simple product. Click the Save button to add the associated product.


I dont think what you are trying to do is possible with default magento SOAP api.

What you could do is create a custom api

eg.

How to setup custom api for Magento with SOAP V2?

http://www.magentocommerce.com/api/soap/create_your_own_api.html

Then create the logic to retrieve all the simple products associated with that configurable product.

$_product  = Mage::getModel('catalog/product')->load($id);
// check if it's a configurable product
if($_product->isConfigurable()){
   //load simple product ids
   $ids = $_product->getTypeInstance()->getUsedProductIds(); 
   OR
  $ids = Mage::getResourceModel('catalog/product_type_configurable')->load($_product);
}

To retrieve child products you could use: $childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product); You then send the results to the api caller and all should be well. The configurable product and simple products are correctly created but any simple product is associated to the configurable product. I use Magento 1.5.0.1 and also the extension “Simple configurable product”.


Please be aware that it should be

... new associativeEntity() { key="like", ...

and not

... new associativeEntity() { key="LIKE", ....

Upper case LIKE does not work.

They were wanting to show a grid while on a configurable products page of all the associated simple products. This is an easy way to quickly  The simple products must be in the same attribute set as the configurable products. Here is what can happen if they are not . chunk of data into fixed lengths chunks and then add a space and again add them all as a string


I found a Magento Extension on Github, which includes this functionallity.

Get configurable's subproducts informations in the same response.

https://github.com/Yameveo/Yameveo_ProductInfo

First, you export the configurable product, and examine the data structure. Find the attribute in the list and open in edit mode. shows multiple simple product variations that are associated with one configurable product. With this script code, you should take some notes to create simple, configurable, downloadable products as the following: To create the simple product, you need to pass the weight setting. To create the configurable product, it is required to combine between associated products current product.


The simple products associated with a configurable product cannot include custom variants or options, and must be based on the same attribute set that is used to  I have an issue when I add a new configurable product, then try to add associated products to this the associated products do not appear. Also if I go into edit the product it prompts to Select Configurable Attributes even though the type is already a configurable product. The attribute set is applicable to all product types.


Setting Configurable Products (Admin Side) Back to User Guides A However, each option represents a separate, simple product with a Here you will find a list of your products and you can also easily "associate" the  You can create a Configurable Product in Magento 2 through many variations and the Configurable Product differs from a Single product by a drop-down list of option for each variation. That means it is simple for you to track inventory for the product variation because an option is actually a simple product with a unique SKU.


What is the correct way to associate an existing simple product with an the standard filter grid to filter / find simple products to associated. Enhancement to Magento to allow simple product prices to be used instead of the default special-case configurable product prices - abcfyk/magento-configurable-simple