magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

Order information thorugh order repository #27982

Closed VZeroCool closed 3 years ago

VZeroCool commented 4 years ago

Preconditions (*)

  1. Magento 2.3.3 CE, Apache2
  2. MySQL, AWS Ec2 instance, PHPstorm with magento extension

Steps to reproduce (*)

  1. Retrieve order information from order Id using repository (Magento\Sales\Api\OrderRepositoryInterface)
  2. Try to get shipping address like, $this->orderRepository->get($orderId)->getShippingAddress()
  3. No suggestion as there's no shippingAddress method in repo

Expected result (*)

  1. If method is not there it should not return shipping address from repo.

Actual result (*)

  1. Its returning shippingAdress without any error but PHPStorm (Magento plugin) not suggesting method.

Solid confusion going on........

m2-assistant[bot] commented 4 years ago

Hi @VZeroCool. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@VZeroCool do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


VZeroCool commented 4 years ago

As this is at code level I cant check in instance you are going to provide.

m2-assistant[bot] commented 3 years ago

Hi @engcom-Alfa. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Alfa commented 3 years ago

Hi @VZeroCool . Thank you for your report. It is expected behavior. If you do the following:

$this->orderRepository->get($orderId) - it returns order object and order has this method: \Magento\Sales\Model\Order::getShippingAddress

Also, you can following this scenario ( it is the same):

1) $order = $this->orderRepository->get($orderId) 2) $address = $order->getShippingAddress()

Actual Result: :heavy_check_mark: Its returns shipping Address

So, we have to close it. Thanks!