Custom product options in Magento products ordered report

Custom product options in Magento products ordered report

October 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Custom product options in Magento products ordered report

Customizing Magento Product Ordered Reports for Custom Options

As an e-commerce developer working with Magento, you might find that the built-in “Products Ordered” report doesn’t quite meet your needs. By default, this report only includes basic product information like SKU and name. However, if you’ve added custom options to your products, you’ll want these details reflected in the reports as well.

Understanding the Current Grid Setup

The current grid setup for the “Products Ordered” report is found in app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php. This file contains an array of columns defined like this:

$this->addColumn('sku', array(
    'header'    => Mage::helper('reports')->__('Product Sku'),
    'sortable'  => false,
    'index'     => 'sku'
));

Here, we’re adding a column for the product’s SKU with a header of “Product Sku”, which isn’t sortable and is indexed by the ‘sku’ field in the database.

Adding Custom Options to the Grid

To include custom options in your reports, you’ll need to follow these steps:

  1. Identify the Custom Option ID: First, find or create the custom option attribute that you want to display in the report. Let’s say this has an attribute code like ‘my_custom_option’.

  2. Add the New Column: Open app/code/core/Mage/Adminhtml/Block/Report/Product/Ordered/Grid.php and add a new column definition after your existing columns:

$this->addColumn('my_custom_option', array(
    'header'    => Mage::helper('reports')->__('My Custom Option'),
    'sortable'  => false,
    'index'     => 'my_custom_option'
));

Replace 'my_custom_option' with the actual attribute code of your custom option.

  1. Update the Indexer: After adding the column, Magento needs to index this new data field for it to appear in the reports. You can do this manually or create a cron job:
php shell/indexer.php --reindexall

Verifying the Changes

After making these modifications and re-indexing your database, you should see the “Products Ordered” report in the Magento admin panel with an additional column named “My Custom Option”. This new column will display the value of the custom option associated with each ordered product.

Remember to clear your cache as well:

php shell/cache.php --clear

Getting Professional Help

If you’re still having trouble or need more advanced customizations, consider reaching out to a professional Magento development agency like Laravel Company. We specialize in e-commerce solutions and can help you with complex data manipulation and reporting tasks.

Our expert developers can provide hands-on assistance, code reviews, and training sessions to ensure your Magento store is performing at its best. Don’t hesitate to reach out if you need additional support or guidance for your project.

Conclusion

In this post, we’ve shown you how to extend the “Products Ordered” report in Magento to include custom options. By following the steps outlined above, you can add any relevant product data to your reports and gain deeper insights into your sales.

Remember that while Magento is powerful out-of-the-box, it often requires customization to fully meet your business needs. With a little bit of knowledge about the platform’s architecture and some careful coding, you can make Magento work exactly how you want it to.

Happy coding!

Catalog Database Admin Orders

Our network