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.

  • Logan P. 47 posts 217 karma points
    May 06, 2014 @ 23:35
    Logan P.
    0

    SiteContext.Current.CatalogContext.CurrentCategory always returns NULL


    I am new to Umbraco and UCommerce so please forgive me if this is a simple question. 

    So I have Umbraco 7 installed along with UCommerce 6.0.1.14120. I also installed the Razor Store Demo, plus built my own store. I am using the MVC rendering engine. In both stores, anytime I try to get the CurrentCategory, from SiteContext.Current.CatalogContext.CurrentCategory, it always returns null. 

    I can provide more details if necessary. Does anyone have any ideas on why this could be happening? I can get all of my categories fine by using UCommerce.Api.CatalogLibrary.GetRootCategories();

    Thanks!

  • Nickolaj Lundgreen 233 posts 1132 karma points
    May 08, 2014 @ 10:13
    Nickolaj Lundgreen
    0

    What's the URL you are trying to get SiteContext.Current.CatalogContext.CurrentCategory from?

  • Logan P. 47 posts 217 karma points
    May 08, 2014 @ 20:13
    Logan P.
    0

    Hi Nickolaj, I am trying to get to localhost:5244/shop/catalog. This is the default url for the "catalog" that came in the content section when I installed the demo razor store. Its not big deal if I can't resolve this as I have came up with another way to handle my navigation through the store (although sadly this was using parameters in custom routes which isn't supported either, so now on to using a url rewriter).

     

    Thanks!

  • Nickolaj Lundgreen 233 posts 1132 karma points
    May 09, 2014 @ 09:15
    Nickolaj Lundgreen
    100

    localhost:5244/shop/catalog Doesn't have any CurrentCategory because the URL doesn't contain any category information ( fx. /c-1/c-2/p-3, linking to catalog id 1, category id 2 and product id 3).

  • Logan P. 47 posts 217 karma points
    May 12, 2014 @ 15:58
    Logan P.
    0

    Wow, that was pretty dumb haha. Thanks for your help though man, I am getting a better feel for Umbraco everyday. 

  • Nickolaj Lundgreen 233 posts 1132 karma points
    May 13, 2014 @ 08:27
    Nickolaj Lundgreen
    0

    We have all been there!

    Keep trying (and asking, when you get stuck) :)

Please Sign in or register to post replies

Write your reply to:

Draft