🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Get Product Options in Magento 2

By Sanjay JethvaUpdated on Mar 17, 2025 1 min read

Magento 2 supports the functionality for creating and assigning the custom options to the products. The process to add new custom product options is simple for any store owner.

Follow the steps given below for getting Product Options in Magento 2:

1. Generate Object Manager

$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();

2. Generate the Product

$product = $_objectManager->get('\Magento\Catalog\Model\Product')->load($id);

3. Custom Options

$customOptions = $_objectManager->get('Magento\Catalog\Model\Product\Option')->getProductOptionCollection($product);

4. Configurable Options

$productTypeInstance = $_objectManager->get('Magento\ConfigurableProduct\Model\Product\Type\Configurable');
$productAttributeOptions = $productTypeInstance->getConfigurableAttributesAsArray
($product);

5. Grouped Childs

$typeInstance = $_objectManager->get('Magento\GroupedProduct\Model\Product\Type\Grouped');$childs = $typeInstance->getAssociatedProducts($product);

6. Bundle Selection

$store_id = $_storeManager->getStore()->getId();
            $options = $_objectManager->get('Magento\Bundle\Model\Option')
         ->getResourceCollection()
                          ->setProductIdFilter($product->getId())
                          ->setPositionOrder();
         $options->joinValues($store_id);
$typeInstance = $_objectManager->get('Magento\Bundle\Model\Product\Type');
$selections = $typeInstance->getSelectionsCollection($typeInstance->getOptionsIds($product), $product);

Following these steps will enable Product Options in your Magento 2 Store.
If you have faced any issue while using this guide, do let us know by commenting below and we will help you out.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.