Closed bleroy closed 8 years ago
Original comment by nduarte (Bitbucket: nduarte, GitHub: nduarte):
Aha, I found the bloody mouse :) On the dashboard when creating a weight base shipping methods you have to put a value on the Maximum Weight. After doing that and overriding the shapes everything works now. Thank´s for your help. You can close this one. Nuno
Original comment by nduarte (Bitbucket: nduarte, GitHub: nduarte):
About the shipping calculations: I create Weight Based Shipping Method on the dashboard and chose all destination areas availables. I created a product on the dashboard and put a value on the weight. Shouldn´t the cart show the estimate shipping price after choosing the country and zip code? I checked on your site nwazet.com and it does that.
Original comment by nduarte (Bitbucket: nduarte, GitHub: nduarte):
Hello Bertrand, I override the the shape and checked for nulls on Model.Country and Model.ZipCode, then i had another error on ShippingInfoForm.cshtml :
Operator '==' cannot be applied to operands of type 'string' and 'ClaySharp.Clay'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '==' cannot be applied to operands of type 'string' and 'ClaySharp.Clay'
Source Error:
Line 12: Line 13: @Html.Label("Country", T("Destination country")) Line 14: @Html.DropDownList("Country", Country.List.Select(c => new SelectListItem { Line 15: Text = c, Line 16: Selected = c == Model.Country
I override this shape as well, checking for nulls, and casting Model.Country to string, it worked with no errors, now i can select country and assign a zipcode and the values are stored in localstorage (they display on the form, and i also checked localstorage on Chrome developer tools), but it doesn´t list the shipping methods neither the shipping calculations.
Nuno.
Original comment by nduarte (Bitbucket: nduarte, GitHub: nduarte):
Original comment by nduarte (Bitbucket: nduarte, GitHub: nduarte):
The first problem is that when you never assign the properties Country an ZipCode to the shape unless the variables country and zipCode passes the validation of Country.UnitedStates or Country not null, when the user goes for the cart page for the first time these are not set, so there is no way for those properties to be set on the shape.
Original comment by nduarte (Bitbucket: nduarte, GitHub: nduarte):
Hi Bertrand, I've been debugging the code and i found a problem in ShoppingCartController.cs in the method BuildCartShape, you are only setting on the shape the Country and ZipCode if its not null, or if the country is United States. I Hardcoded the values on the method for testing purposes and the error disapeared, the cart form is shown, but the shippingMethods is returning 0, so i cannot see or access the shipping options.
I see that you have this working well on your website nwazet.com, what version of the module are you using there?
Thank´s
Nuno
Originally reported by: nduarte (Bitbucket: nduarte, GitHub: nduarte)
Hello Bertrand and Sipke , I´m starting to use your module a i get this error when trying to view the cart or on checkout, can you give me any clues on what can i do do fix this. Thanks, Nuno.
Server Error in '/' Application.
The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments
Source Error:
Line 108: Line 109: Line 110: @if (String.IsNullOrWhiteSpace(Model.Country) && Line 111: String.IsNullOrWhiteSpace(Model.ZipCode)) { Line 112: @Display.ShippingInfoForm()
Source File: e:\VS Projects\Orchard_Nwazet\src\Orchard.Web\Modules\Nwazet.Commerce\Views\ShoppingCart.cshtml Line: 110
Stack Trace:
[RuntimeBinderException: The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments] CallSite.Target(Closure , CallSite , Type , Object ) +202 System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +685 ASP._Page_Modules_Nwazet_Commerce_Views_ShoppingCart_cshtml.Execute() in e:\VS Projects\Orchard_Nwazet\src\Orchard.Web\Modules\Nwazet.Commerce\Views\ShoppingCart.cshtml:110 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +119 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88 System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +759 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +382 System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +470 System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +155 System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model) +93 Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) +267 Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.<>cDisplayClass28.b 15(DisplayContext displayContext) +160
Orchard.DisplayManagement.Descriptors.<>cDisplayClass5.b 2(DisplayContext displayContext) +134
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) +220
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) +1817
Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) +204
Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerableb 19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Funcb 19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Funcb 19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Funcb 19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Funcb 19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Funcb 19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Funcb 19() +71
System.Web.Mvc.Async.<>cDisplayClass1.b 0() +44
System.Web.Mvc.Async.<>cDisplayClass8`1.b 7(IAsyncResult _) +42
System.Web.Mvc.Async.WrappedAsyncResultb 3(IAsyncResult asyncResult) +45
System.Web.Mvc.Async.<>cDisplayClass4.b 3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +66
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) +47
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9628700
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
1 parameters) +205 Orchard.DisplayManagement.Implementation.DisplayHelperBehavior.InvokeMember(Func
1 proceed, Object target, String name, INamedEnumerable1 args) +99 ClaySharp.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:29 ClaySharp.ClayBehaviorCollection.Execute(Func
1 proceed, Func3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:13 ClaySharp.ClayBehaviorCollection.InvokeMember(Func
1 proceed, Object self, String name, INamedEnumerable1 args) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:29 ASP._Page_Core_Shapes_Views_ShapeResult_Display_cshtml.Execute() in e:\VS Projects\Orchard_Nwazet\src\Orchard.Web\Core\Shapes\Views\ShapeResult\Display.cshtml:1 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +119 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88 System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +759 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +382 Orchard.Mvc.ViewEngines.ThemeAwareness.<>c__DisplayClass7.<FindView>b__5(ViewContext viewContext, TextWriter writer, IViewDataContainer viewDataContainer) +238 Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutView.Render(ViewContext viewContext, TextWriter writer) +99 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +429 System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39 System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +74 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 continuation) +388 System.Web.Mvc.<>cDisplayClass1c.1 continuation) +388 System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 continuation) +388 System.Web.Mvc.<>cDisplayClass1c.1 continuation) +388 System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 continuation) +388 System.Web.Mvc.<>cDisplayClass1c.1 continuation) +388 System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 continuation) +388 System.Web.Mvc.<>cDisplayClass1c.1 continuation) +388 System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 continuation) +388 System.Web.Mvc.<>cDisplayClass1c.1 continuation) +388 System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 continuation) +388 System.Web.Mvc.<>cDisplayClass1c.1 continuation) +388 System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList
1 filters, ActionResult actionResult) +303 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +844 System.Web.Mvc.<>cDisplayClass1d.1.End() +151 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +68 System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47 System.Web.Mvc.Async.WrappedAsyncResult
1.End() +151 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +65 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39 System.Web.Mvc.<>cDisplayClass8.