Last active
October 12, 2015 13:58
-
-
Save mschultheiss83/4037376 to your computer and use it in GitHub Desktop.
Magento - Quick n Dirty - Test Scripts
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 | |
/** | |
* Magento Test File | |
* | |
*/ | |
error_reporting(E_ALL); | |
define('MAGENTO', realpath(dirname(__FILE__))); | |
require_once MAGENTO . '/app/Mage.php'; | |
umask(0); | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
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 | |
/** | |
* Created by tripuls. | |
* User: m.schultheiss | |
* Date: 07.05.14 | |
* Time: 08:47 | |
*/ | |
/** | |
* Magento Test File | |
* | |
*/ | |
error_reporting( E_ALL ); | |
define( 'MAGENTO', realpath( dirname( __FILE__ ) ) ); | |
require_once MAGENTO . '/app/Mage.php'; | |
umask( 0 ); | |
Mage::app()->setCurrentStore( Mage_Core_Model_App::ADMIN_STORE_ID ); | |
$product = Mage::getModel( 'catalog/product' )->loadByAttribute( 'sku', 'AD43-10-04' ); | |
$_helper = Mage::helper( 'catalog/output' ); | |
if ( $product->getImage() ) { | |
$img = Mage::helper( 'catalog/image' )->init( $product, 'image' ); | |
$imgUrl = $_helper->productAttribute( $product, $img, 'image' ); | |
Zend_Debug::dump( $imgUrl ); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment