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

Magento\Quote\Model\Quote\Address\RateRequest getDestRegionCode() return null #27932

Closed keke996 closed 3 years ago

keke996 commented 4 years ago

Summary (*)

I'm developing custom shipping method, different price for different address. When customer select/entered address, my carrier model use Magento\Quote\Model\Quote\Address\RateRequest getDestRegionCode() to get region. But sometimes ,getDestRegionCode return null. If address is been selecter and region is entered to input not select, getDestRegionCode() return null. I can't get full address.

Examples (*)

namespace Forkel\CustomShipping\Model\Carrier; . . . class Custom extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements \Magento\Shipping\Model\Carrier\CarrierInterface { . . . public function collectRates(RateRequest $request) { ' ' ' $destState = $request->getDestRegionCode(); ' ' ' } }

Proposed solution

I don't now how to get region reliably.

m2-assistant[bot] commented 4 years ago

Hi @keke996. 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.

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


keke996 commented 4 years ago

The web is run in magento CLI 2.3.3. I'm able to reproduce the issue on vanilla Magento instance following steps to reproduce.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions.