Shipping cost is not calculating for the rules applied

1 week ago
Hi Team,

In my online store, I have created sipping methods and shipping rules for some of those.
But shipping cost is not calculated at the end when this shipping address is selected in checkout page.

For ex:
Some of the shipping methods;
1). 4 - 5 Days Air USA, Canada
2). 4 - 5 Days Air - West Europe ( BE, DE, FR, IR, IT, LI, LU, MC, NL, CH, ES, TR, UK )  
3). 4 - 5 Days Air - East Europe ( AL, AD, AT, BY, BA, BG, HR, CZ, DK, EE, FI, GR, HU, IS. LV, LT, MK, MT, MD, NO, PL, PT, RO, RU, SK, SI, SE, UA)  
4). 4 - 5 Days Air UAE  
5). 4 - 5 Days Air Middle East ( BH, BD, BT, CY, EG, IQ, JO, KW, LB, NP, OM, PK, PS, QA  SY, YE)  
6). 4 - 5 Days Air East Asia ( AU, AS, BN, KH, CN, CK, FJ, PF, GU, ID, JP, LA, MY, MH, FM, MN, MM, NC, NZ, PH, WS, SG, KR, VN)  
7). 4 - 5 Days Air South America ( AR, BO, BR, CL, CO, EC, SV, GF, JM, MX, PY, SC, LC, VC, UY )  
8). 2 - 3 Days Air India  
9). Ground (Local transport)  


Ex: Some of the shipping rules for shipping method 1).

1). 4 - 5 Days Air USA, Canada  

Rule 01;

Order weight from: 0.0000
Order weight to: 0.5000
Order subtotal from: 1.0000
Order subtotal to: 500.0000
Additional fixed cost: 29.0000
Rate per weight unit: 0.0000
Lower weight limit: 0.0000
Charge percentage (of subtotal): 0.0000

Rule 02;

Order weight from: 0.5000
Order weight to: 1.0000
Order subtotal from: 501.0000
Order subtotal to: 1000.0000
Additional fixed cost: 32.0000
Rate per weight unit: 0.0000
Lower weight limit: 0.0000
Charge percentage (of subtotal): 0.0000

Rule 03;

Order weight from: 1.0000
Order weight to: 20.0000
Order subtotal from: 1001.0000
Order subtotal to: 10000.0000
Additional fixed cost: 32.0000
Rate per weight unit: 11.0000
Lower weight limit: 1.0000
Charge percentage (of subtotal): 0.0000

Rule 4;

Order weight from: 20.0000
Order weight to: 30.0000
Order subtotal from: 10001.0000
Order subtotal to: 50000.0000
Additional fixed cost: 166.0000
Rate per weight unit: 18.5000
Lower weight limit: 20.0000
Charge percentage (of subtotal): 0.0000

Rule6;

Order weight from: 30.0000
Order weight to: 10000.0000
Order subtotal from: 50001.0000
Order subtotal to: 10000000.0000
Additional fixed cost: 312.0000
Rate per weight unit: 17.5000
Lower weight limit: 30.0000
Charge percentage (of subtotal): 0.0000

When I trying to ship a product ( price at $38.00) to USA, by selecting a US address, this shipping cost is not calculated in the checkout page

Sample Address that I am trying to send product;

47 W 13th St, New York, NY 10011, USA
New York,New York,10011
United States of America


What does it shows in the checkout page is;

4 - 5 Days Air USA, Canada ($0.00)

Could you please let me know why the cost is not calculated.
I really need this help to sort out the issue.

Best Regards,
Manula
1 week ago
Be sure you don't have any "free shipping" enabled:
- Shipping By Weight/Total method is Active (i.e. that you're not using another method by accident ;)
- Admin > Settings > Shipping Settings > Free shipping over 'X':
- Customer's role has "Free shipping" enabled.
- All products in the cart have their "Free shipping" checked.
- If any discount on shipping
1 week ago
[email protected] wrote:
Hi Team,

In my online store, I have created sipping methods and shipping rules for some of those.
But shipping cost is not calculated at the end when this shipping address is selected in checkout page.

For ex:
Some of the shipping methods;
1). 4 - 5 Days Air USA, Canada
2). 4 - 5 Days Air - West Europe ( BE, DE, FR, IR, IT, LI, LU, MC, NL, CH, ES, TR, UK )  
3). 4 - 5 Days Air - East Europe ( AL, AD, AT, BY, BA, BG, HR, CZ, DK, EE, FI, GR, HU, IS. LV, LT, MK, MT, MD, NO, PL, PT, RO, RU, SK, SI, SE, UA)  
4). 4 - 5 Days Air UAE  
5). 4 - 5 Days Air Middle East ( BH, BD, BT, CY, EG, IQ, JO, KW, LB, NP, OM, PK, PS, QA  SY, YE)  
6). 4 - 5 Days Air East Asia ( AU, AS, BN, KH, CN, CK, FJ, PF, GU, ID, JP, LA, MY, MH, FM, MN, MM, NC, NZ, PH, WS, SG, KR, VN)  
7). 4 - 5 Days Air South America ( AR, BO, BR, CL, CO, EC, SV, GF, JM, MX, PY, SC, LC, VC, UY )  
8). 2 - 3 Days Air India  
9). Ground (Local transport)  


Ex: Some of the shipping rules for shipping method 1).

1). 4 - 5 Days Air USA, Canada  

Rule 01;

Order weight from: 0.0000
Order weight to: 0.5000
Order subtotal from: 1.0000
Order subtotal to: 500.0000
Additional fixed cost: 29.0000
Rate per weight unit: 0.0000
Lower weight limit: 0.0000
Charge percentage (of subtotal): 0.0000

Rule 02;

Order weight from: 0.5000
Order weight to: 1.0000
Order subtotal from: 501.0000
Order subtotal to: 1000.0000
Additional fixed cost: 32.0000
Rate per weight unit: 0.0000
Lower weight limit: 0.0000
Charge percentage (of subtotal): 0.0000

Rule 03;

Order weight from: 1.0000
Order weight to: 20.0000
Order subtotal from: 1001.0000
Order subtotal to: 10000.0000
Additional fixed cost: 32.0000
Rate per weight unit: 11.0000
Lower weight limit: 1.0000
Charge percentage (of subtotal): 0.0000

Rule 4;

Order weight from: 20.0000
Order weight to: 30.0000
Order subtotal from: 10001.0000
Order subtotal to: 50000.0000
Additional fixed cost: 166.0000
Rate per weight unit: 18.5000
Lower weight limit: 20.0000
Charge percentage (of subtotal): 0.0000

Rule6;

Order weight from: 30.0000
Order weight to: 10000.0000
Order subtotal from: 50001.0000
Order subtotal to: 10000000.0000
Additional fixed cost: 312.0000
Rate per weight unit: 17.5000
Lower weight limit: 30.0000
Charge percentage (of subtotal): 0.0000

When I trying to ship a product ( price at $38.00) to USA, by selecting a US address, this shipping cost is not calculated in the checkout page

Sample Address that I am trying to send product;

47 W 13th St, New York, NY 10011, USA
New York,New York,10011
United States of America


What does it shows in the checkout page is;

4 - 5 Days Air USA, Canada ($0.00)

Could you please let me know why the cost is not calculated.
I really need this help to sort out the issue.

Best Regards,
Manula


Hi Manula,

The US shipping cost isn't calculated at checkout. Likely culprits: free shipping enabled (globally, for customer role, or product) or a mismatch between product weight/subtotal and shipping rule ranges.  

Check those and try a different product to isolate the issue.
1 week ago
Thanks for your replies.

Actually there is no any free shipping enabled in either product vise or shipping wise.

At first I only had the shipping method for USA and Canada, which is 4-5 Days Air USA, Canada.
And then, when I tried to calculate the cost with that shipping method and the rules that I applied, and the shipping cost were calculated accordingly.

Then I added other shipping methods for other countries.
4-5 Days European Region
4.5 Days Air UAE
4-5 Days Air East Asia  etc..

And also I added shipping restrictions to each.
Suddenly when I exceeded the shipping methods for more than 10 methods( and shipping restrictions also added according to that), I got an error.
I could not be able to save the country restrictions for exceeding shipping methods.
The Application was broken. What the error said was, it was an known error and NopCommerce Support team would work on that etc..

Then I removed some of the shipping methods until it get reduced to six methods remained, then only I could be able to save the country restrictions for all shipping methods .

And then, again I tried to calculate shipping cost by selecting one shipping method ( ex : 4 -5 Days Air USA, Canada ) , that is the point where I got the issue, that the cost was not calculated properly as it was always zero.

I feel it is some strange behavior.

Could someone please help me on this.

Regards,
Manula
1 week ago
RE: " I got an error. "
What error message?

If you see "Shipping options could not be loaded" (language resource checkout.shippingoptioncouldnotbeloaded), then it means that the FixedByWeightByTotal plugin is not returning any matched method/rates.  You need to check your criteria / ranges.  Be sure that you have all ranges covered regarding weight and subtotal and country.

Also, there is a setting at the bottom of the page.  "Limit shipping methods to configured ones".  Note the hint for that field:
If you check this option, then your customers will be limited to shipping options configured here. Otherwise, they'll be able to choose any existing shipping options even they are not configured here (zero shipping fee in this case).

Thus, if not selected, and no criteria matches, then the customer will see methods with a $0 rate.
I recommend that you select it, and be sure that all your criteria ranges are covered.

You may want to set up a "catch all" for each method having:
Country:  *
Order weight from: 0
Order weight to: 999999
Order subtotal from: 0
Order subtotal to: 999999
Additional fixed cost:  999999

If you (customer) sees the 999999 amount, then you know that no other rows matched.
1 week ago
Thanks for your reply. I would be able to fix the issue by adjusting the values for cost.

By the way;

I got this error when I saving 9th shipping method's restrictions.

The error message is;
"
We're sorry, an internal error occurred.

Our supporting staff has been notified of this error and will address the issue shortly.

We apologize for the inconvenience.

Please try clicking your browsers 'back' button or try reloading the home page.

If you continue to receive this message, please try again in a little while.

Thank you for your patience. "


Does it only support for adding eight shipping methods, why I cannot save the restrictions for 9th shipping method ?

1 week ago
There's no limit to the number of Shipping Methods or rows for By Weight configuration.
In general, when you see "We're sorry, an internal error occurred", immediately go to the Admin >  System > Log, to get the more detailed message.  (Post the full message it if you need help.)
6 days ago
This is the detailed error showing in the log,

Log level : Error

Short message : Form value count limit 2048 exceeded.

Full message : System.IO.InvalidDataException: Form value count limit 2048 exceeded.
   at Microsoft.AspNetCore.WebUtilities.FormPipeReader.AppendAndVerify(KeyValueAccumulator& accumulator, String decodedKey, String decodedValue)
   at Microsoft.AspNetCore.WebUtilities.FormPipeReader.ParseFormValuesFast(ReadOnlySpan`1 span, KeyValueAccumulator& accumulator, Boolean isFinalBlock, Int32& consumed)
   at Microsoft.AspNetCore.WebUtilities.FormPipeReader.ParseValuesSlow(ReadOnlySequence`1& buffer, KeyValueAccumulator& accumulator, Boolean isFinalBlock)
   at Microsoft.AspNetCore.WebUtilities.FormPipeReader.ParseFormValues(ReadOnlySequence`1& buffer, KeyValueAccumulator& accumulator, Boolean isFinalBlock)
   at Microsoft.AspNetCore.WebUtilities.FormPipeReader.ReadFormAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.Features.FormFeature.InnerReadFormAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.Features.FormFeature.ReadForm()
   at Microsoft.AspNetCore.Http.DefaultHttpRequest.get_Form()
   at Nop.Web.Framework.Controllers.BaseController.SaveSelectedTabName(String tabName, String formKey, String dataKeyPrefix, Boolean persistForTheNextRequest)
   at Nop.Web.Framework.Controllers.BaseController.SaveSelectedTabName(String tabName, Boolean persistForTheNextRequest)
   at Nop.Web.Framework.Mvc.Filters.SaveSelectedTabAttribute.SaveSelectedTabFilter.SaveSelectedTab(ActionExecutingContext context)
   at Nop.Web.Framework.Mvc.Filters.SaveSelectedTabAttribute.SaveSelectedTabFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Nop.Services.Authentication.AuthenticationMiddleware.InvokeAsync(HttpContext context)
   at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 121
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddlewareBase.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Nop.Services.Installation.InstallUrlMiddleware.InvokeAsync(HttpContext context, IWebHelper webHelper)
   at Nop.Services.Common.KeepAliveMiddleware.InvokeAsync(HttpContext context, IWebHelper webHelper)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Is there a way to handle this error " Form value count limit 2048 exceeded." ?



1 day ago
@Team,

Any idea behind this ?
22 hours ago
What version of nopCommerce are you using?