Created
July 23, 2015 07:44
-
-
Save mcjwsk/b488f716f2d18fad3772 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 | |
set_time_limit(600); | |
define('MAGENTO_ROOT', getcwd()); | |
$compilerConfig = MAGENTO_ROOT . '/includes/config.php'; | |
if (file_exists($compilerConfig)) { | |
include $compilerConfig; | |
} | |
$mageFilename = MAGENTO_ROOT . '/app/Mage.php'; | |
if (!file_exists($mageFilename)) { | |
if (is_dir('downloader')) { | |
header("Location: downloader"); | |
} else { | |
echo $mageFilename . " was not found"; | |
} | |
exit; | |
} | |
require_once $mageFilename; | |
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(3)); | |
$collection = Mage::getModel('catalog/product')->getCollection(); | |
$data = array(); | |
foreach ($collection as $product) { | |
$data[] = array( | |
'sku' => $product->getSku(), | |
'price' => $product->getPrice(), | |
'special_price' => $product->getSpecialPrice(), | |
); | |
} | |
file_put_contents('product_price.json', json_encode($data)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment