Reply to comment

If you are running this as a standalone script, you will need to initialise the Magento environment first.

Put the following at the start of your PHP file:

==================

<?php

define("MAGE_BASE_DIR", '/path/to/magento');
require_once MAGE_BASE_DIR . '/app/Mage.php';

Mage::app(0);

==================

This should remove problems with the Mage class not being found.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <apache>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <perl>, <php>, <python>, <ruby>, <xml>. The supported tag styles are: <foo>, [foo].

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.