Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Jacob 39 posts 88 karma points
    Feb 21, 2013 @ 19:47
    Jacob
    0

    SiteContext - CurrentCategory, custom Category, assign Products

    Hello

    I hope my title makes some kind of sense :)

    What I want to do is manipulate the SiteContext, CurrentCategory.

    Basicly I want to do the following, this is only some example code for test purposes:

    Category MyCat = new Category();
    Product nP1 = new Product();
    Product nP2 = new Product();
    List<Product> lPro = new List<Product>();
    lPro.Add(nP1);
    lPro.Add(nP2);
    MyCat.Products = lPro;
    SiteContext.Current.CatalogContext.CurrentCategory = MyCat;

    My problem is that the Category.Products does not have a setter, so how would I be able to do this?

    Any help is appreciated.

    Thanks

  • Morten Skjoldager 440 posts 1499 karma points
    Feb 22, 2013 @ 08:26
    Morten Skjoldager
    100

    There's an AddProduct on category. I think that would do the trick? 

  • Jacob 39 posts 88 karma points
    Feb 22, 2013 @ 12:15
    Jacob
    0

    Damn! Your right... I really do not know how I missed that :-S

    Sometimes it is better to take a break, when you start missing the obvious.

     

  • Morten Skjoldager 440 posts 1499 karma points
    Feb 22, 2013 @ 15:34
    Morten Skjoldager
    0

    Hah! 

    Usually when that barrier is reached, i go eat cake. Actually. Some of my collegues have an Epephany duck they talk to. You know. When you ask for questions you sometimes see it yourself. 

Please Sign in or register to post replies

Write your reply to:

Draft