呃我如何獲得客戶ID !!?這些都是我嘗試過的所有事情!你能看到我做錯了什麼嗎?如何獲得Magento客戶ID
//include_once "app/Mage.php";
require_once '/home/ab71714/public_html/app/Mage.php';
//Mage::app("default");
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
if($customer = Mage::getSingleton('customer/session')->isLoggedIn()) {
$customerData = Mage::getModel('customer/customer')->load($customer->getId())->getData();
print_r($customerData);
echo $customerData->getId();
}
//$customerData = Mage::getModel('customer/customer');
//$customerID = $customerData -> getId();
//$userinfo = $customerData->_origData; // fetch users info
$customerID=$customer -> getId();
//$customerID = $customerData->getEntityId();
//$customerID = $customerData[entity_id];
它沒有進入if語句!我登錄了,但我添加了一個else語句echo「not logged in」,這就是正在打印的內容。 – CaitlinHavener 2013-02-16 23:20:29
嘗試將商店ID從管理更改爲正確的客戶商店編號 – 2013-02-17 16:51:43