2026 Executive BenchmarkMid-Market Enterprise Modernization: How leaders across unify Commerce, Odoo ERP & AI in 90 days.
MAGENTO COMMERCE

Add Multiple images in magento products

Here are the step to Add Multiple images in magento products. First Go to appcodecoreMageCatalogModelConvertAdapterProduct.php Open Product.php file and find this Code … $addedFile...

Akshar Group Technologies
Dec 25, 2020
1 min read
Verified Source

Here are the step to Add Multiple images in magento products.

First Go to appcodecoreMageCatalogModelConvertAdapterProduct.php Open Product.php file and find this Code …

php
<script>
$addedFilesCorrespondence = $mediaGalleryBackendModel -> addImagesWithDifferentMediaAttributes(
$product,
$arrayToMassAdd, Mage::getBaseDir('media') . DS . 'import',
false,
false
);
</script>
After this put this code in File
php
<script>
if (isset($importData['media_gallery']) && !empty($importData['media_gallery'])) {
$x = explode(';', $importData['media_gallery']);
foreach ($x as $file) {
$imagesToAdd[] = array('file' =>; trim($file));
}

$mediaGalleryBackendModel -> addImagesWithDifferentMediaAttributes(
$product,
$imagesToAdd, Mage::getBaseDir('media') . DS . 'import',
false,
false
);
}
</script>

And Save file. Than open your Product.csv file and Put media_gallery' Name in one Column and before images like e.g : /s/e/second_image.png, /t/h/third_image.png,/f/o/fourth_image.png . After this updload your csv File.
Share this playbook
LET'S BUILD WHAT'S NEXT

What's Holding Your Business Back?

Tell us where you want to go, what's getting in the way, and we'll help you figure out the technology to get there.

No sales pitch. Confidential strategic advisory.