2

Hi i have a configurable product id and its selected options ids is there any way i can get the id of simple product of this configurable product which belongs to these options.

["config_product"]=>"754"
["super_attribute"]=>
      array(4) {
        [327]=>"2148"
        [551]=> "11474"
        [554]=> "11515"
        [628]=>"13239"
      }

I have this array i want to get simple product id of this configurable product which belongs to these super attributes.

1
  • Add your code which you have used for more information. Oct 4, 2016 at 5:07

1 Answer 1

2

I found an answer for this question if we send it params and parent product it will return the related associated product.

$product = $parent_config_product_object;
$params["super_attribute"]=>
      array(4) {
        [327]=>"2148"
        [551]=> "11474"
        [554]=> "11515"
        [628]=>"13239"
      }
    $childProduct = Mage::getModel('catalog/product_type_configurable')->getProductByAttributes($params['super_attribute'], $product);
        Mage::log($childProduct->getData());

Hope it will help someone else..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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