From the Magento checkout success page I need to get the following data to add to a tracking pixels script.
$orderObj = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId()); // get the last order object
$customerType;
$productCategories;
$orderId = $orderObj->getIncrementId();
$orderRevenue = number_format($orderObj->getBaseGrandTotal(),2);
I have successfully gotten $orderId
& $orderRevenue
but how can I get $customerType
& $productCategories
?
I thought I could use something like $orderObj->_data['customer_group_id']
to help me get the $customerType
.
UPDATE
I was able to get $customerType
with:
$customerId = $orderObj->getCustomerGroupId();
$customerType = Mage::getSingleton('customer/group')->load($ross)->getData('customer_group_code');
Now just to figure out how to get$productCategories;
?