How to update bundle product options using Magento 2 import

- Magento 2, Our extensions

Magento 2 Development; Magento 2 tutorial

What if you have numerous bundle products on your Magento 2 website and need to update them regularly? What if updates should impact only particular bundle product options? Well, you’ve come to the right place. Below, you will learn how to update bundle product options using Magento 2 import. Although the default Magento 2 import tool doesn’t let you update bundle products and choose the specific options that should be adjusted, you can rely on the Improved Import & Export Magento 2 module to achieve this goal.  

Same titles — no update!

Bundle product options may have the same titles, resulting in the inability to update them upon import. If option names are the same, your import solution may not know which particular option you want to update, and which one should stay untouched. 

Therefore, it is necessary to add IDs to enable updates for option titles and other attributes inside the bundle_values attribute. And it’s how Improved Import & Export lets you solve the issue.

How to update bundle product options using Magento 2 import

With the Improved Import & Export extension, you can update bundle product options using the option_id and selection_id attributes. But where to look for them?
You can easily get these IDs by exporting your bundle products via the Improved Import & Export module. The corresponding attributes are available right in the export file.

Alternatively, you can find the option_id and selection_id attributes and their values (the IDs you are looking for) in your Magento 2 Database.

Let’s look at a tiny example, to illustrate how everything works. Suppose you have the following bundle:

how to import new bundle product options to magento 2

As you can see, it contains two selections. The default quantity of each selection is 1. Let’s assume we need to update the Option Title for the bundle and the Quantity for the first selection.
After exporting this bundle using Improved Import & Export, we got the following option IDs and selection IDs in the bundle_values column:

how to import new bundle product options to magento 2

  • option_id=25 – the option ID for both selections is 25;
  • selection_id=49 – the selection ID for the first selection is 49;
  • selection_id=50 – the selection ID for the second selection is 50.

Now, it is possible to change values and transfer the edited data back to update bundle product options using Magento 2 import.

how to import new bundle product options to magento 2

As you can see, the image above contains a new Option Title – Bundle Option One1 Update instead of Bundle Option One1 (we got this Option Title after the export). Also, it has a new quantity for the first selection – default_qty=90 instead of default_qty=1. Please, pay attention to the fact that the option and selection IDs for the first selection (the one that we want to update) remain the same – option_id=25 and selection_id=49.

Now, you need to import the file following the standard Magento 2 bundle product import. As a result, you will successfully update the following bundle product as expected:

how to import new bundle product options to magento 2

You can see, that we have the new Option title and quantity for the first selection. In addition to that, the Improved Import & Export extension offers dozens of outstanding features that can dramatically improve your data transfers for bundle products and all the core entities. 

First of all, the extension supports a bunch of file formats, such as CSV, XML, JSON, XLSX, etc. It means that you no longer need to convert files to CSV before importing them to your e-commerce website. Along with that, you can use multiple file sources, such as Dropbox or Google Drive, to import your updates. 

The extension also lets you create cron-based schedules to import and export bundle products and other entities automatically. And if you deal with third-party attributes that Magento 2 doesn’t support, the Improved Import & Export extension provides the ability to use mapping to match unsupported names to the ones used in Magento.  

Last but not least, our module can transfer data from Google Sheets or run API-based import and export processes. Follow this link to learn more about its outstanding features: 

Get Improved Import & Export Magento 2 Extension

Also, check our Magento 2 Cookbook for more useful tips.