0

Is there a way to add images to a product without loading the whole product? updateAttributes() is definitely fast when updating a product but when adding an image to a product, this function is needed:

$product->addImageToMediaGallery($_filepath, array('image', 'small_image', 'thumbnail'), true, false);
3
  • Which Magento version are you referring to ? Commented Jun 22, 2016 at 7:19
  • It's for Magento v1.x, v1.14.1.0 to be specific. Commented Jun 22, 2016 at 7:28
  • Is it the load or the save that is actually slowing you down? You should be able to just set the product ID on the model without loading it to add images, but saving may be slow if your indexers are set to on save
    – scrowler
    Commented Jun 22, 2016 at 7:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.