Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mokanfar/f12ded0d582fc0554a7f233764cad5f8 to your computer and use it in GitHub Desktop.
Save mokanfar/f12ded0d582fc0554a7f233764cad5f8 to your computer and use it in GitHub Desktop.
<?php
require_once 'app/Mage.php';
Mage::app();
//to overwrite limit but you need first to increase your memory limit
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*') // select all attributes
->setPageSize(5000) // limit number of results returned
->setCurPage(1); // set the offset (useful for pagination)
// we iterate through the list of products to get attribute values
foreach ($collection as $product) {
//customer group id 1 price as follows:
$product->setCustomerGroupId(1);
echo $product->getSku();
echo ',';
echo (float) $product->getFinalPrice(); //get price as cast to float
echo '<br />';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment