Magento add custom option in the left side filter

Magento add custom option in the left side filter

July 24, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento add custom option in the left side filter

Adding Custom Option Filters to Magento Product Listing Pages

In Magento, products can have custom options like size or color that are unique to each product and cannot be shared by attributes. If you want to add filters for these options on the product listing pages, follow this step-by-step guide.

Understanding Custom Options in Magento

Custom options allow you to create dropdowns, checkboxes, or radio buttons with various values for a single product. These are different from global attributes that can be shared across multiple products.

To access custom options for a product:

  1. Go to the Admin Panel.
  2. Browse to Catalog > Products.
  3. Click on a specific product.
  4. In the left sidebar, under “Custom Options”, you’ll see the option values and types.

Creating Custom Option Filters

Unfortunately, Magento does not support filtering products by custom options out-of-the-box. However, you can achieve this with some custom development or an extension like Amasty’s Layered Navigation extension (https://amasty.com/magento-2-layered-navigation.html).

For a basic solution, here are the steps to add custom option filters manually:

Step 1: Create an Attribute for Filtering

While your options are currently stored as product-level data, you’ll need a shared attribute to filter by. This is a workaround but necessary.

  1. Go to Catalog > Attributes.
  2. Click “Add New Attribute”.
  3. Set the following properties:
    • Attribute Code (e.g., custom_option_type)
    • Frontend Label (e.g., Option Type)
    • Input Type (Select)
    • Source Model: Catalog > Product > Custom Option Type
  4. Save and apply.

Step 2: Populate the New Attribute for Existing Products

You’ll need to update your existing products to use this new attribute. This can be done via a script or using the import/export functionality with a CSV file.

For example, you could create an upgrade script like this:

$productCollection = Mage::getModel('catalog/product')->getCollection();
foreach ($productCollection as $product) {
    if ($optionType = $product->getCustomOptionByCode('option_type')) {
        $product->setData('custom_option_type', $optionType);
        $product->save();
    }
}

Step 3: Add the New Filter

Now, you need to add your new attribute as a filter in the layered navigation.

  1. Go to Catalog > Attributes.
  2. Click on your newly created attribute (e.g., custom_option_type).
  3. In the “Storefront Properties” section:
    • Visibility: Searchable, Filtersable
    • Use in Layered Navigation: Yes

Conclusion

Adding filters for custom product options in Magento requires some creativity and manual intervention. While it’s not a built-in feature, with these steps you can create a functional filter system that improves the user experience on your site.

Remember, this is a basic solution. For more robust functionality like filtering across multiple stores or advanced display settings, consider using an extension or customizing the layered navigation template files directly.

For further reading on Magento development best practices and extensions, visit our blog at https://laravelcompany.com/magento-development-blog.

Catalog Extensions Admin CLI

Our network