Copied to clipboard

Flag this post as spam?

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


  • René 327 posts 852 karma points
    Jun 25, 2014 @ 15:40
    René
    0

    Teacommerce Umbraco 7 - Product view

    HI 

    I struggeling to convert part of the teacommerce demo to Umbraco 7.  

    //Product
      string ProductTypeName = "Product";
      DynamicNode currentPage = Model;
      DynamicNode mainProduct = currentPage.AncestorOrSelf( p => p.NodeTypeAlias == ProductTypeName && p.Parent.NodeTypeAlias != ProductTypeName );

    To get the product with the variants as subnodes i have the above code from the teacommerce demo (Umbraco 6). 

    //Product
        string ProductTypeName = "Product";
        IPublishedContent currentPage = CurrentPage;
        IPublishedContent mainProduct = currentPage.AncestorOrSelf(p => p.NodeTypeAlias == ProductTypeName && p.Parent.NodeTypeAlias != ProductTypeName);

    I have beeen trying to get it to work in many ways, but i cant. 

    I get this error from the above code

    Error  35  Cannot convert lambda expression to type 'string' because it is not a delegate type

    Any suggestions? 

    RenĂ© 

  • Anders Burla Johansen 2560 posts 8256 karma points
    Jun 26, 2014 @ 10:59
    Anders Burla Johansen
    0

    It says something about a string. So try and figure out which part of your lambda expression that works with strings. Maybe try and make a real simple lambda expression to see it works.

    Kind regards
    Anders

  • 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