-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getDestCity() method returns nothing in collectRates() method. #3789
Comments
Just a little adding : I just entered the checkout page and filled the information. In collectRates method (Magento 1.9.4) (with user city as Paris) : In collectRates method (Magento 2.0.1) (with user city as Paris) : |
Seeing the same issue on our end here too - getDestCity is null and never contains a value in the carrier request. An ajax request during checkout calls "rest/default/V1/guest-carts/KEY/estimate-shipping-methods
|
It should be noted that street level details are also not available. This data can be useful in the carrier request - an example of it's usage could be for logic that may need to handle PO Boxes differently. |
The checkout shipping method rates request is passing through the getEstimatedRates function which limits the fields available in the request. |
I tried to reproduce this issue, but everything works correct. Please give additional info or detailed steps for reproducing this issue. |
If you go to any enabled shipping method e.g. DHL or UPS, and look at the request object passed to collectRates when in the checkout on Guest Checkout - getDestCity(), getDestStreet() return null - they are not populated on the request object. |
Hi, we've created MAGETWO-52308 internal ticket regarding this issue |
I think this is the expected behavior, even more on a cart guest estimation When doing an estimation there's not city just zip code, region and country sample from 2.0.4 Estimate: When exactly do you expect to get that info? at what stage in the process |
Hi @cpartica, Cart estimation is understandable, as there is no city input field, however this issue is occurring during checkout too (during the shipping step), preventing us from providing live quoting in a shipping module. In our case we're using getDestCity() in our carrier "collectRates" method to present shipping methods based on a live quote. The estimate-shipping-methods call is made once the address details have been filled in, however the request does not include all inputs, such as postcode, city and street address. This results in the Carrier RateRequest object not containing these details. Our live quoting integration requires the city and postcode details, however as we are unable to get this data, we're unable to create a shipping method via a live quote It should be noted that street level details are also not available. While not used in our specific case, this data can be useful for some implementations - an example of it's usage could be for logic that may need to handle PO Boxes differently. |
Needs to be fixed ASAP, is affecting rollout of Magento 2 to clients. |
@ilol Illia--as shipping PM owner please investigate this ticket |
Hi has this bug been fixed yet? |
@webtonic , @wsakaren - at the very moment we are fixing it. |
Thanks! Appreciated! |
Where exactly do you plug-in to our checkout flow to get the live quotes? So if you're extending a block or anything that' son the main request for http://yourdomain/checkout you will never have access to that info To get live quoting for shipping you have to use knockout js models that subscribe themselves or extend current ones Not sure if you're using this aproach to get your quotes, but don't rely that the main request will have anyting, because all things in checkout are client-side now We have to modify @method string getDestCity() to @method string|null getDestCity() because this situation is possible Hope this answer helps |
A custom shipping carrier shouldn't require any block or front end modification at all, assuming it intends to only return shipping rates. If we ignore any custom shipping methods for a second and just look at core Magento 2 - consider the DHL carrier that is built in to Magento. In the Carrier.php in module-dhl:
As your built in DHL carrier is requiring these fields in the request, I would say this is a bug with core code at this point. In addition, any custom shipping rate carriers would fully expect the full shipping address fields to be available on the shipping rate request as they have been filled out by the customer and are often crucial to accurate shipping rates. These were available in Magento 1, so at this point it's a step backwards. Guest checkout: the fix required appears to be in Logged in customer checkout: the fix required appears to be in |
That's a better info and thank you for that, very valuable |
You need to fix it ASAP. Big issue. |
Hi guys. Which version of EE has this fix? Regards |
Magento checkout is broken for pretty much everywhere apart from basic US needs because of this. Is anyone using M2 outside the US? If so they must have flat rate shipping switched on.... |
i try in magento 2.1.2 check Magento\Quote\Model\Quote\Address\RateRequest $request and get $request->getDestCity(); |
@pratikmage, this fix available only for develop branch and is not available for Magento 2.0.x and 2.1.x. Backport will be published in Magento 2.1.5 version. |
HI @joni-jones Can you please provide the solution for now? What needs to be change? So for now we can put the fix. As our website is Live & facing this issue. We can't wait for version release. Hope u understand. |
HI @joni-jones pls check this module i fix it using this module. |
@shahankitb997, you can compare |
@pratikmage, this module similar to our fix, but uses deprecated |
Thanks @pratikmage |
@mikeweis - Any idea when MAGETWO-55117 will make it into a release? We keep having to manually patch after each upgrade. |
@jchesko, this fix should have been available in Magento 2.1.5 release but moved to 2.1.8. |
Hi. Is there a temporary fix for this? |
HI @Zach2212 pls check this module i fix it using this module. |
I've created a plugin that fixes this issue, by overriding Magento\Quote\Model\ShippingMethodManagement::estimateByAddressId(). You can have a look at the code here: http://pastebin.com/3GcesL2H |
Hello @joni-jones, do you know if the fix for this issue was released in Magento 2.1.8? |
Hi, @edudeleon, unfortunately, the fix moved again to 2.1.10. I notified our managers that fix should be delivered ASAP. |
This is actually in the release notes for 2.1.10, so perhaps it's finally happened! |
I have modified below file. now it is working fine. var payload;
|
As the title says, the
getDestCity()
method returns absolutely nothing if I use it insidecollectRates()
method.I tried like this :
$city
= $request->getDestCity();But it didn't worked (
$city
and$street
are empty, not$postCode
).I think it might be a bug because it worked perfectly fine on magento 1.9.
The text was updated successfully, but these errors were encountered: