Copied to clipboard

Flag this post as spam?

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


  • Natasha 9 posts 99 karma points
    Dec 05, 2019 @ 15:37
    Natasha
    0

    Snipcart

    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!

  • Yakov Lebski 594 posts 2350 karma points
    Dec 05, 2019 @ 17:41
    Yakov Lebski
    100

    enter image description here

    I think here should be item.Value ...

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies