Quantcast
Channel: ActiveTopics
Viewing all articles
Browse latest Browse all 72689

Snipcart

$
0
0

Hi There

I am trying to implement snipcart on my site. It's been a while since i've used umbraco so this code from the tutoria here https://snipcart.com/blog/integrating-snipcart-with-umbraco-pre-zombie-apocalypse-e-commerce throws an error I am using version 8.1.4. I have tried doing it myself but get stumped at adding an image from childpages all I can do is list the sub pages :

@{ var selection = Model.Children.Where(x => x.IsVisible()).ToArray(); }


@if (selection.Length > 0)
{
    <ul>
        @foreach (var item in selection)
        {
            <li>
                <h2>@item.Name</h2>


                @{
    var image = Model.Value<IPublishedContent>("image");
    if (image != null)
    {
        <p>@image.Url</p>
        <img src="@image.Url" style="width:200px" alt="@image.Value("alt")" />
    }
} 

            </li>
        }
    </ul>
}

Please help it's driving me craaaazy!


Viewing all articles
Browse latest Browse all 72689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>