1

i want to create configurable product.

see this

when i select attribute set how can i get related attribute to create configurable product?

i use this code to select attribute

jQuery('#attribute_set_id').on('change', function() {
    var a=(jQuery('#attribute_set_id').val());
    <?php     
        $html='';
        $att_id="<script>document.write(a)</script>";
        $attributes = Mage::getResourceModel('catalog/product_attribute_collection')->setAttributeSetFilter($att_id)->getItems();
        foreach ($attributes as $attribute)
        {
            if($attribute->getIsGlobal()==1 &&  $attribute->getIsVisible()==1 && $attribute->getIsConfigurable()==1 && $attribute->getFrontendInput()=='select' )
            {
                $id=$attribute->getId();
                $html.= $attribute->getFrontendLabel();
                $html.= "<input class='chk_attr validate-one-required' type=checkbox name=attribute[] value=$id >";
                $html.= '<br>';
            }
        }
    ?>
    jQuery('#check_fieldset_attr').html("<?php echo $html;?>");
});

but it not work properly.

0

i get all attribute by using this sript

<?php
    require_once('app/Mage.php');
    Mage::app();

    $aa=array(4,10,11,12,13,14,15,16,17,18,19,20);
    foreach($aa as $abc)
    {

    echo '<br><br><br>';
    echo $abc.'<br>';
    $attributes = Mage::getResourceModel('catalog/product_attribute_collection')->setAttributeSetFilter($abc)->getItems();
        foreach ($attributes as $attribute)
        {
            if($attribute->getIsGlobal()==1 &&  $attribute->getIsVisible()==1 && $attribute->getIsConfigurable()==1 && $attribute->getFrontendInput()=='select' )
            {
                $id=$attribute->getId();
                echo $attribute->getFrontendLabel();
                echo '<br>';
                }
            }
        }

    ?>

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.