Skip to content
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

Estimate Shipping - shipping provider warnings not displayed #4943

Closed
holydk opened this issue Jul 23, 2020 · 3 comments
Closed

Estimate Shipping - shipping provider warnings not displayed #4943

holydk opened this issue Jul 23, 2020 · 3 comments

Comments

@holydk
Copy link
Contributor

holydk commented Jul 23, 2020

  1. nopCommerce version 4.30
  2. Expected behavior - error/warning messages from shipping providers should be displayed
  3. Actual behavior - if a shipping provider plugin returns any errors, they are ignored
  4. Steps to reproduce the problem
  • Select "Estimate Shipping" button on the cart page. The dialog pops up.
  • Enter address information
  • If the shipping provider plugin reports any errors (like UPS indicating invalid address, or Shipping Director's Error/ErrorExit rule returning a warning message like "call for shipping"), they are not displayed.

(Note that if you blank out the zip/postal code field, you do see an error message for "Zip / postal code is required", so the dialog does support the display of messages)

The code does not look right. Only when 'Success' is true does it enter the block where Warnings are set:

\Presentation\Nop.Web\Factories\ShoppingCartModelFactory.cs

public virtual EstimateShippingResultModel PrepareEstimateShippingResultModel(...)
...
var getShippingOptionResponse = _shippingService.GetShippingOptions(...);
if (getShippingOptionResponse.Success)
{
    if (getShippingOptionResponse.ShippingOptions.Any())
    {
        foreach (var shippingOption in getShippingOptionResponse.ShippingOptions)
        {...}
    }
    else
        foreach (var error in getShippingOptionResponse.Errors)
            model.Warnings.Add(error);
}

see also: https://www.nopcommerce.com/en/boards/topic/84921/estimate-shipping-on-cart-page-for-430-shipping-provider-warnings-not-displayed

@holydk holydk added this to the Version 4.40 milestone Jul 23, 2020
@holydk holydk self-assigned this Jul 23, 2020
@badijm
Copy link
Contributor

badijm commented Oct 13, 2020

Hi, I can work on this item, or it is for nop internal team?

@AndreiMaz
Copy link
Member

@badijm Please feel free to create a pull request

@holydk
Copy link
Contributor Author

holydk commented Oct 19, 2020

Closed #4943

@holydk holydk closed this as completed Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants