PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 10/26/2020 3:11 AM by  Reto Cossalter
How to display manufacturer on product detail
 6 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Page 1 of 212 > >>
Author Messages





Basic Member






--
3/21/2019 6:58 AM
    Is there a way to display the manufacturer on the product detail page?
    As far as I see this information is not available in ProductPageViewModel
    Any pointers?

    Regards
    Reto





    Veteran Member






    --
    3/21/2019 12:19 PM
    You won't find the Manufacturer directly referenced in the SingleProductViewModel class, but you have what you need to display it already there.

    [code=csharp]@Model.Item.ManufacturerId [/code]

    Then, use the appropriate controller class to query for and display the manufacturer details you're interested in.
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes





    Basic Member






    --
    8/20/2020 4:57 AM
    Just for anyone looking for a solution to this I will quickly summarize what we ended up to do:

    Create a new view within your Viewset in the following folder: Views/Shared/_manufacturer.cshtml
    Add the following code
    [code=csharp]
    @model Hotcakes.Modules.Core.Models.ProductPageViewModel

    @functions{
    private string DisplayName(){
    var m = HccApp.ContactServices.Manufacturers.Find(Model.LocalProduct.ManufacturerId);
    return m.DisplayName;
    }
    }

    @Html.Raw(DisplayName())
    [/code]
    Change _ProductDetails.cshtml and the new partial view wherever you want:
    [code=csharp]
    @Html.Partial("_manufacturer", Model)
    [/code]
    This will render the manufacturer name.





    Veteran Member






    --
    8/20/2020 3:32 PM
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes





    Basic Member






    --
    8/21/2020 1:47 AM
    Great News!
    Thanks
    You are not authorized to post a reply.
    Page 1 of 212 > >>


    Loading
    • Sign-up for the Hotcakes Community Newsletter: