Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2020-07-24T16:15:43Z
I need to show the product category in _RenderSingleProduct.cshtml
I can see it uses Hotcakes.Modules.Core.Models.SingleProductViewModel, but how to show the category in that views? In that model there is item to access all product informations, but the category seems missing.
If I listing fo all products it is very important to show for each product the category it belongs to...
Will Strohl (install acct)
2020-07-24T17:07:19Z
The main reason that you don't already have a built-in way to do that in the view model is because most stores don't do this. The most common use case is that a product could belong to many categories, so adding this to the view is a nightmare scenario to a designer. 😃

You can add a method to the view in question that queries the API for the product and then list the various categories it belongs to.
Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2020-07-25T03:11:37Z
thanks Will but i can't find anywhere how i can use api calls directly from a viewset using a method.
Is it a programming or designer work?
Is there any example about?
Loading
  • Sign-up for the Hotcakes Community Newsletter: