Last active
August 29, 2015 13:58
-
-
Save razbakov/9970086 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* TecRepair Installator | |
* | |
* @category Kirchbergerknorr | |
* @package Kirchbergerknorr_TecRepair | |
* @author Aleksey Razbakov <[email protected]> | |
* @copyright Copyright (c) 2014 kirchbergerknorr GmbH (http://www.kirchbergerknorr.de) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
/* @var $installer Mage_Sales_Model_Entity_Setup */ | |
$installer = $this; | |
$product = Mage::getModel('catalog/product')->loadByAttribute('sku', 'product_sku'); | |
$image = $Mage::getBaseDir('media') . DS ."image.png"; | |
if (is_file($image)) | |
{ | |
$product->addImageToMediaGallery($image, array ('image', 'small_image', 'thumbnail'), false, false); | |
$product->save(); | |
} | |
$installer->endSetup(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment