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.

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    May 17, 2010 @ 15:28
    Matt Brailsford
    0

    Cannot create basket when not in product catalog.

    Hi Guys,

    I'm trying to add items to a basket, but am getting the following error in my AddToBasket.xslt file:

    Cannot create basket when not in product catalog. Make sure that SiteContext.Current.CatalogContext.CurrentCatalogName contains the name of the current product catalog group.

    I have a different product page than the demo site, which is just a UserControl. It passes through the SKU and Quantity. For the catalog name, I have hard coded this in the XSLT for now as I will only have 1 catalog. In this scenario, how should the SiteContext be initialized?

    Many thanks

    Matt

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 17, 2010 @ 15:35
    Søren Spelling Lund
    0

    The default implementation of CatalogContext (used by SiteContext) assumes that the URL includes a querystring parameter called "catalog". The easiest way to make it work is to include the querystringparameter on your page.

    If you want a different behavior you can either go ahead and implement your own ICatalogContext and register it with /umbraco/ucommerce/configuration/Components.config or you can override the CurrentCatalogName on our CatalogContext and register that with components.config

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    May 17, 2010 @ 16:29
    Matt Brailsford
    0

    Cool, that worked.

    I couldn't inherit the default CatalogContext, but using composition and proxying the unwanted properties worked a treat.

    Thanks again

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft