Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6105707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:59:59+00:00 2026-05-23T13:59:59+00:00

we want to export/import configurable products through the Magento-API in another system. What is

  • 0

we want to export/import configurable products through the Magento-API in another system. What is important for us, are the values of the configurable products like a T-Shirt which has 3 colors (red, green and blue).

We receive the configurable attributes with the following function:

public function options($productId, $store = null, $identifierType = null)
{
    $product = $this->_getProduct($productId, $store, $identifierType);

    if (!$product->getId()) {
        $this->_fault('not_exists');
    }

    $configurableAttributeCollection = $product->getTypeInstance()->getConfigurableAttributes();

    $result = array();
    foreach($configurableAttributeCollection as $attribute){
        $result[$attribute->getProductAttribute()->getAttributeCode()] = $attribute->getProductAttribute()->getFrontend()->getLabel();
        //Attr-Code:    $attribute->getProductAttribute()->getAttributeCode()
        //Attr-Label:   $attribute->getProductAttribute()->getFrontend()->getLabel()
        //Attr-Id:      $attribute->getProductAttribute()->getId()
    }


    return $result;
}

But how is it possible to get the options used in that product (e.a. blue, green, red if the configurable attribute is “color”) with the now available label/id from the configurable attribute which we got through the above function?

Answers are very appreciated!

Tim

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:59:59+00:00Added an answer on May 23, 2026 at 1:59 pm

    Since we couldn’t find a better solution, this is what I came up with:

    public function options($productId, $store = null, $identifierType = null)
    {
        $_product = $this->_getProduct($productId, $store, $identifierType);
    
        if (!$_product->getId()) {
            $this->_fault('not_exists');
        }
    
        //Load all simple products
        $products = array();
        $allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product);
        foreach ($allProducts as $product) {
            if ($product->isSaleable()) {
                $products[] = $product;
            } else {
                $products[] = $product;
            }
        }
    
        //Load all used configurable attributes
        $configurableAttributeCollection = $_product->getTypeInstance()->getConfigurableAttributes();
    
        $result = array();
        //Get combinations
        foreach ($products as $product) {
            $items = array();
            foreach($configurableAttributeCollection as $attribute) {
                $attrValue = $product->getResource()->getAttribute($attribute->getProductAttribute()->getAttributeCode())->getFrontend();
                $attrCode = $attribute->getProductAttribute()->getAttributeCode();
                $value = $attrValue->getValue($product);
                $items[$attrCode] = $value[0];
            }
            $result[] = $items;
        }
    
        return $result;
    }
    

    Hope this helps anybody.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app in which I have added Export/Import DB functionality... I want
I want to export the audio-media of a MOV-File with the QuickTime-API and save
I want to export a XtraGrid as an image. Pratically i need something like
I like OSGi, but the import/export restrictions and the lack of context class loader
A while back I wrote a silverlight user control which had a csv import/export
My Use Case: I want to import the large data from EC2 through SQOOP
EMF has support for XSD through Ecore to XSD import export capability, but I
In Visual Studio, there is an Import and Export settings wizard which you can
I want to export the certificate and private key from one machine to another
Possible Duplicate: Can I export and import Visual Studio 2010-extensions? I want to reinstall

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.