Get manufacturer attribute id

$attrLabel = ‘manufacturer’; $attr = $product->getResource()->getAttribute($attrLabel); $manufacturer_id = $attr->getSource()->getOptionId($manufacturer);

$attrLabel = 'manufacturer';
$attr = $product->getResource()->getAttribute($attrLabel);
$manufacturer_id = $attr->getSource()->getOptionId($manufacturer);

Share this Tutorial