Skip to content

Instantly share code, notes, and snippets.

@razbakov
Created December 2, 2011 13:58
Show Gist options
  • Save razbakov/1423322 to your computer and use it in GitHub Desktop.
Save razbakov/1423322 to your computer and use it in GitHub Desktop.
Order Code
<?php
$order = new Mage_Sales_Model_Order();
$incrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order->loadByIncrementId($incrementId);
/** @var $order Mage_Sales_Model_Order */
$cookieModel = Mage::getModel('core/cookie');
// Save order ad origin as order field
$params = $cookieModel->get('ad_origin');
if (false != $params) {
$order->setData('ad_origin', $params);
$order->save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment