Skip to content

Instantly share code, notes, and snippets.

@peterjaap
Created June 14, 2013 08:16
Show Gist options
  • Save peterjaap/5780298 to your computer and use it in GitHub Desktop.
Save peterjaap/5780298 to your computer and use it in GitHub Desktop.
Fire a Magento event from CLI
<?php
require 'app/Mage.php';
error_reporting(E_ALL | E_STRICT);
ini_set('html_errors', 1);
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
$orderId = $_GET['order_id'];
Mage::app('');
try {
$order = Mage::getModel('sales/order')->load($orderId);
Mage::log($order->getData());
Mage::dispatchEvent('sales_order_payment_pay', array('order' => $order));
} catch(Exception $e)
{
echo "exception<br/>$e";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment