Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Darren Wilson 229 posts 597 karma points
    May 28, 2017 @ 22:02
    Darren Wilson
    0

    Display featured products on home page

    Hi Folks,

    I've installed the fast track store on my existing 7.6 site. I'm having an issue displaying featured products on my site homepage. I'm hoping that someone might be able to shed some light on this - I'm using the following dependencies:

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<FtStore>
    @inherits Merchello.Web.Mvc.MerchelloTemplatePage
    
    @{
        Layout = "FastTrack.cshtml";
    
    }
    
    @using Merchello.Core
    @using Merchello.Core.Models
    @using Merchello.FastTrack.Ui
    @using Merchello.Web
    @{
        var storeRoot = ExampleUiHelper.Content.GetStoreRoot();
        var catalogRoot = storeRoot.FirstChild(x => x.DocumentTypeAlias == "ftCatalog" && x.IsVisible());
        var basketPage = ExampleUiHelper.Content.GetBasket();
        var accountPage = ExampleUiHelper.Content.GetAccount();
    }
    

    But when I'm trying using the following, I'm getting an error saying there are missing dependencies

    Compiler Error Message: CS1061: 'Umbraco.Web.Models.RenderModel' does not contain a definition for 'FeaturedProducts' and no extension method 'FeaturedProducts' accepting a first argument of type 'Umbraco.Web.Models.RenderModel' could be found (are you missing a using directive or an assembly reference?)
    

    Here's the code...

    @if (Model.FeaturedProducts.Any())
    {
        <section id="categories">
            <div class="page-header">
                <h1>Featured Products</h1>
            </div>
            @foreach (var row in Model.FeaturedProducts.ToArray().Split(3))
            {
                <div class="row">
                    @foreach (var fp in row)
                    {
                        <div class="col-xs-4">
                            @Html.Partial("_ProductBox", fp)
                        </div>
                    }
                </div>
            }
    
        </section>
    }
    

    I've tried this, but I think this relates to the old Bazaar store: https://our.umbraco.org/projects/collaboration/merchello/merchello/76863-list-merchello-featured-products-on-existing-home-node

    Any help with this will be greatly appreciated as I've been banging my head against a brick wall for about a week!

    Thanks Darren

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 31, 2017 @ 14:03
    Rusty Swayne
    0

    Hey Darren,

    This is most likely ModelsBuilder not being synched. Can you check your ModelsBuilder setting in the web.config and rebuild your models if you need to ...

  • Darren Wilson 229 posts 597 karma points
    Jun 11, 2017 @ 22:06
    Darren Wilson
    0

    Hi Rusty,

    I hope this message finds you well.

    I'm struggling a bit with this - sorry. Here's my modelbuilder settings. I must be doing something wrong. I've tried copying over all the dependencies from the other fast track pages but it still doesn't work.

    Thanks again for taking the time to look at this. Darren enter image description here

  • Puck Holshuijsen 184 posts 727 karma points
    Jun 12, 2017 @ 11:09
    Puck Holshuijsen
    0

    Hi Darren,

    I believe this is due to the fact that yeah have PureLive Models enabled inside your config.

    I think if you change it to Dll, you should be able to rebuild your models from that screen.

    Puck

Please Sign in or register to post replies

Write your reply to:

Draft