How to get IP address from order ID in Magento 2? Any solution?


You can order ip from


Best solution is:

echo $order->getRemoteIp(); echo $order->getXForwardedFor() ? ' (' . $order->getXForwardedFor() . ')' : '';

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.