I'm using Mangeto 1.9.1
I'm trying to access the magento customer session outside magento in a php file in the root folder of the magento.
Here is my code:
<?php error_reporting(E_ALL | E_STRICT); $mageFilename = 'app/Mage.php'; require_once $mageFilename; $app = Mage::app('default'); Mage::app(); $customer_id = Mage::getSingleton('customer/session')->getId(); $GrandTotal = Mage::getModel('sales/quote')->loadByCustomer($customer_id)->getGrandTotal(); $HalfTotal = $GrandTotal / 2; echo "Grand: $GrandTotal<br>Half: $HalfTotal"; ?>
My magento is installed on a subdomain like beta.mymagento.com
But it seems it can not access the session. How i can fix it?
Thanks in advance!