0

I have created custom table and display the values as grid in admin by UI component.In my custom table already I have SKU column .now I need attribute set id Name of the product in custom grid .how to get attribute setid by joining in collection.what are the tables needs to be joined to get attribute set_id name ?

2
1

In your Collection.php which you are using for the Grid add below function code

protected function _initSelect()
{
    parent::_initSelect();

    $this->getSelect()
        ->columns('eas.attribute_set_name')
        ->join(
            ['cpe' => $this->getTable('catalog_product_entity')],
            'main_table.sku = cpe.sku',
            []
        )->join(
            ['eas' => $this->getTable('eav_attribute_set')],
            'cpe.attribute_set_id = eas.attribute_set_id',
            []
        );
}
0

Not sure to really understand your issue. To give you a strict answer the attribute set is stored in the table eav_attribute_set where you can find the columns attribute_set_id and attribute_set_name

Now if what you try to do is add that value into a grid, we need more information and code about what you've done.

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.