2

I'm adding a custom option (checkbox with 2 rows) programmatically to simple products (10.000+) after a import. All custom option values are the same.

Due to a memory issue it failed the first time (partially) and after setting a higher memory limit some products now have 2 custom options.

Is there a way get the amount of custom options through a collection and delete any second (or more) custom options so every product has only 1 custom option?

2

I just deleted all custom options programmatically by:

require_once '../app/Mage.php';
Mage::init();
Mage::getModel('catalog/product_option')->getCollection()->walk('delete');

and then run the code for adding custom options programmatically again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.