1

We are just trying to run a little script that returns the customers that are signed up for price alerts and what products they are watching

I tried this code

require_once('app/Mage.php');

$customer_id = 76046;
//$customer_id = Mage::getSingleton('customer/session')->getCustomer()->getId();
$customer_price_alerts = Mage::getModel('productalert/price')
     ->getCollection()
     ->addFieldToFilter('customer_id', $customer_id);
foreach ( $customer_price_alerts as $alert )
{
 echo $alert->getProductId();
}

however get error

Call to a member function getModelInstance() on a non-object in /var/www/html/app/Mage.php on line 432

anyone?

cheers FireHorse

0

Add these lines at the start of file:

require_once('app/Mage.php');
umask(0);
Mage::app();
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.