Bulk Update Customizable Product Options in Magento2

Today I had to bulk-update the Price and Max Characters in the tab Customizable Options for hundreds of simple products based on the title.

Magento2 Customizable Product Option

I knew that it could be done programmatically but I figured out that it can be done just by updating the table catalog_product_option and catalog_product_option_price. First I got a comma separated list of option_id’s based on a specific title.

With the comma separated list I was able to update the value of the Price and Max Characters as follows.

1. Price

2. Max Characters

Possible that you have to flush the cache ( php/magento cache:flush ) and re-index everything ( php/magento indexer:reindex ) to see the results.

Cannot gather stats! Warning!stat(): stat failed

Today I imported a couple of new products with uRapidFlow in Magento 2.1.2. I ran the import with the option Action on missing image file which was set to WARNING and update image field. It worked fine, but I accidentally forgot to upload the product images.

So basically uRapidFlow added non-existing product images to the database which broke the product edit form in the admin panel.

The temporarily solution was to manipulate ./vendor/magento/module-catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php in vendor around line 142,143.

I basically added is_readable to check if the file exists. Not great, but at least I was able to edit products again and proceed with a permanent fix.

Related issues:
https://github.com/magento/magento2/issues/5497