Estimate Shipping (on cart page) for 4.30 - shipping provider warnings not displayed

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 anos atrás
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);

}


(P.S.  I reported this other bug(?) in the estimate shipping a few weeks ago, and there's no response
https://www.nopcommerce.com/en/boards/topic/82736/estimate-shipping-on-cart-page-for-430-every-keypress-in-zippostal-field-gets-rates )
3 anos atrás
New York wrote:

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


Thanks. Please find the work item here.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.