Reading list Switch to dark mode

    Set Images of Magento Product Programmatically in Admin Store (In Multi Store Magento)

    Updated 29 February 2024

    $objProduct=10; // Id of product which you want to add image…

    $objprod=Mage::getModel('catalog/product')->load($objProduct);
    $objprod->addImageToMediaGallery($imagepath,array('image','small_image','thumbnail'),true,false);
    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
    //for Set it to all Store view
    $objprod->save();

    Searching for an experienced
    Magento Company ?
    Find out More
    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home