1

I want to display guest customer telephone number on success page.how can i do this?

1

you can get billing or shipping telephone by following code

$order=Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$order->getShippingAddress()->getTelephone();
$order->getBillingAddress()->getTelephone();

as you requested to update telephone

$billingAddress = Mage::getModel('sales/order_address')->load($order->getBillingAddress()->getId());

$billingAddress->setTelephone("value")->save();
  • now i want to update this number – imtiaz Feb 16 '17 at 9:48
  • @imtiaz did you post question on that? so i can post answer their – Qaisar Satti Feb 16 '17 at 10:01
  • @imtiaz added the solution here – Qaisar Satti Feb 16 '17 at 10:11
0

Please put below code in the success.phtml file:

$orderid = $this->escapeHtml($this->getOrderId());
$order=Mage::getModel('sales/order')->loadByIncrementId($orderid);
$customerTelephone = $order->getBillingAddress()->getTelephone();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.