Tier prices from ProductAttributeCombinations doesn't show up

Monday, November 25, 2024 12:19:44 PM
  • Posted: Wednesday, March 11, 2020 12:45 AM
  • 4
Sample report:
1. Tier price defined in Product Attribute Combination of the product

2. Product detail page with the corresponding product attribute combination, without the tier price

Describe your problem:
When we add tier prices for specific product attribute combination, they doesn't show up on the product detail page. It shows only Tier prices, when they defined in the main product. While debugging, I the checked the displayTierPrices variable on the breakpoint in _ProductTierPrices.cshtml:

@model IList<ProductDetailsModel.TierPriceModel>
@{
    //When there is just one tier (with  qty 1), there are no actual savings in the list.
    var displayTierPrices = Model.Any() && !(Model.Count == 1 && Model[0].Quantity <= 1);
}

When Tier prices defined in product attribute combinations, Model.Count will be 0. For my understanding, it only filled by the product tier prices, not by tier prices of the corresponding product attribute combination.
Version of GrandNode: 4.50
Did you make any private modifications of GrandNode?: No
0
  • Posted: Wednesday, March 11, 2020 7:22 AM
  • 953
In fact it's not a problem, it's by design. You will see price for particular tier price when you choose the right quantity and attributes. If you want to show the same table like on main product, you can create a widget to handle that.
Best regards,
Patryk

GrandNode Team
0
  • Posted: Tuesday, March 17, 2020 7:15 PM
  • 4
Hi,

thanks for your hint, I created successfully a Widget for that. I've encountered another problem with Theme Editor. For my widget, it is neccessary to change frontend code in the Views/Product/_ProductAttributes.cshtml file. When I doing that locally it works fine, but when I change the code on the server via theme editor it throws an error. This error isn't related to my change, in general when I change just a comment, the file is copied to the Template folder and the product detail site crashed with following error:

[code]Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: One or more compilation failures occurred:
/app/Themes/DefaultClean/Views/Product/_ProductAttributes.cshtml(100,43): error CS1061: 'IHtmlHelper<IList<ProductDetailsModel.ProductAttributeModel>>' does not contain a definition for 'DatePickerDropDowns' and no accessible extension method 'DatePickerDropDowns' accepting a first argument of type 'IHtmlHelper<IList<ProductDetailsModel.ProductAttributeModel>>' could be found (are you missing a using directive or an assembly reference?)
/app/Themes/DefaultClean/Views/Product/_ProductAttributes.cshtml(108,52): error CS0029: Cannot implicitly convert type 'System.Threading.Tasks.Task<Grand.Core.Domain.Media.Download>' to 'Grand.Core.Domain.Media.Download'
   at Microsoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompiler.CompileAndEmit(RazorCodeDocument codeDocument, String generatedCode)
   at Microsoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompiler.CompileAndEmit(String relativePath)
   at Microsoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompiler.OnCacheMiss(String normalizedPath)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRazorPageFactoryProvider.CreateFactory(String relativePath)
   at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.CreateCacheResult(HashSet`1 expirationTokens, String relativePath, Boolean isMainPage)
   at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.OnCacheMiss(ViewLocationExpanderContext expanderContext, ViewLocationCacheKey cacheKey)
   at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.LocatePageFromViewLocations(ActionContext actionContext, String pageName, Boolean isMainPage)
   at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.FindView(ActionContext context, String viewName, Boolean isMainPage)
   at Microsoft.AspNetCore.Mvc.ViewEngines.CompositeViewEngine.FindView(ActionContext context, String viewName, Boolean isMainPage)
   at Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper.FindView(String partialName)
   at Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
   at AspNetCore.Views_Product_ProductTemplate_Simple.<ExecuteAsync>b__38_1() in /app/Grand.Web/Views/Product/ProductTemplate.Simple.cshtml:line 92
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.GetChildContentAsync(Boolean useCachedResult, HtmlEncoder encoder)
   at Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
   at AspNetCore.Views_Product_ProductTemplate_Simple.ExecuteAsync() in /app/Grand.Web/Views/Product/ProductTemplate.Simple.cshtml:line 51
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewCo
0
  • Posted: Tuesday, March 17, 2020 7:16 PM
  • 4
Complete StackTrace:

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: One or more compilation failures occurred:
/app/Themes/DefaultClean/Views/Product/_ProductAttributes.cshtml(100,43): error CS1061: 'IHtmlHelper<IList<ProductDetailsModel.ProductAttributeModel>>' does not contain a definition for 'DatePickerDropDowns' and no accessible extension method 'DatePickerDropDowns' accepting a first argument of type 'IHtmlHelper<IList<ProductDetailsModel.ProductAttributeModel>>' could be found (are you missing a using directive or an assembly reference?)
/app/Themes/DefaultClean/Views/Product/_ProductAttributes.cshtml(108,52): error CS0029: Cannot implicitly convert type 'System.Threading.Tasks.Task<Grand.Core.Domain.Media.Download>' to 'Grand.Core.Domain.Media.Download'
   at Microsoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompiler.CompileAndEmit(RazorCodeDocument codeDocument, String generatedCode)
   at Microsoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompiler.CompileAndEmit(String relativePath)
   at Microsoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompiler.OnCacheMiss(String normalizedPath)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRazorPageFactoryProvider.CreateFactory(String relativePath)
   at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.CreateCacheResult(HashSet`1 expirationTokens, String relativePath, Boolean isMainPage)
   at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.OnCacheMiss(ViewLocationExpanderContext expanderContext, ViewLocationCacheKey cacheKey)
   at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.LocatePageFromViewLocations(ActionContext actionContext, String pageName, Boolean isMainPage)
   at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.FindView(ActionContext context, String viewName, Boolean isMainPage)
   at Microsoft.AspNetCore.Mvc.ViewEngines.CompositeViewEngine.FindView(ActionContext context, String viewName, Boolean isMainPage)
   at Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper.FindView(String partialName)
   at Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
   at AspNetCore.Views_Product_ProductTemplate_Simple.<ExecuteAsync>b__38_1() in /app/Grand.Web/Views/Product/ProductTemplate.Simple.cshtml:line 92
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.GetChildContentAsync(Boolean useCachedResult, HtmlEncoder encoder)
   at Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
   at AspNetCore.Views_Product_ProductTemplate_Simple.ExecuteAsync() in /app/Grand.Web/Views/Product/ProductTemplate.Simple.cshtml:line 51
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
   at Microsoft.AspNetCore.Mvc.ViewR
0
  • Posted: Wednesday, March 18, 2020 10:23 AM
  • 953
Hi Alexander,

Can you send us this request to support@grandnode.com with details about the version of the plugin, version of GrandNode? Thanks!
Best regards,
Patryk

GrandNode Team
0
back to top
Filters