The question:
I’m working on a Magento 2 website for a friend and I’ve now realised that for the 500+ products he’s manually added, they’re simple products with virtual options? I told him to set the products up as configurable products so I’m not quite sure what’s happened (see below image). Is there a way of converting all of these virtual products to a type that will allow for an address to be entered during checkout?
The Solutions:
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
Method 1
You can do it only direct in DB. For example with query
update catalog_product_entity set type_id = 'simple' where type_id = 'virtual';
But beware, this query converts all virtual products to simple. (better to create db backup before start)
Method 2
Maybe this helps somebody who looks it up.
If you create product configurations and dont add weight to the generated products they will be virtual. If you add weight they will be simple products.
If you want to change a single virtual product to a simple product, give the product a weight in the backend and change it to “this product has weight“.
However if you want to change all virtual products at once you could add a weight to all selected products at once by using the “update attributes” option under “products->catalog“. Meanwhile you cant set the “this product has weight” option. So you probably have to do that in the DB or per product.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0