While creating downloadable products in Magento 2, there’s an important setting that determines how customers access the downloadable files: “Links Purchased Separately.”
This setting defines whether customers can purchase individual links or only as a complete bundle.

If you enable this option by checking the box, each downloadable link will be treated as a separate item. This allows customers to select and purchase only the specific files they want.
This option can be useful when you are selling a digital product like a course, media content or a software module.
If you’re selling an entire course as a downloadable product and want to give customers the option to buy just one specific lesson instead of the whole course, this feature is helpful.
As a Magento developer, you may often need to retrieve the exact downloadable options selected by a customer for a particular order item via code. This becomes essential in scenarios such as:
- Displaying downloadable links in the customer’s order history
- Indicating which downloadable files were purchased
- Including this information in PDF invoices
- Developing backend or frontend features that rely on this data
- Adding downloadable link titles in order confirmation emails
How to Get Selected Downloadable Product Options from Order Items in Magento 2?
Integrate the below solution to get access to this option.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); if($_item->getProduct()->getTypeId() == 'downloadable'){ $purchased = $objectManager->create('Magento\Downloadable\Model\Link\PurchasedFactory')->create()->load($_item->getId(), 'order_item_id'); $purchasedItemCollectionFactory = $objectManager->create('Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory'); $purchasedItems = $purchasedItemCollectionFactory->create() ->addFieldToFilter('order_item_id', $_item->getId()); foreach ($purchasedItems as $purchasedItem) { $downloadableItems[] = [ 'link_title' => $purchased->getLinkSectionTitle(), 'option_title' => $purchasedItem->getLinkTitle() ]; } }
Here, $_items is an object of the Sales Order Item.
The above code populates the $downloadableItems array with titles of each downloadable file linked to the order item.
Simply, use this solution to get selected downloadable product options from order items in Magento 2.