Magento get guest and logged in customers name, email and order number/reference number at checkout page

StackOverflow https://stackoverflow.com/questions/14595460

  •  06-03-2022
  •  | 
  •  

質問

I am trying to get the customer's name, email, and order number to pass to a payment gateway once the customer hits the place order button. So far I have managed to get the total using

$total = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();

I tried using

Mage::getSingleton('customer/session')->getCustomer();

$email = $customer->getEmail();  

$firstname = $customer->getFirstname(); 

$lastname= $customer->getLastname(); 

but they don't seem to return a value. I know this because I echo the variables after, and none of them work but the $total. Help would be greatly appreciated.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top