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?
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
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:
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
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
Cool, that worked.
I couldn't inherit the default CatalogContext, but using composition and proxying the unwanted properties worked a treat.
Thanks again
Matt
is working on a reply...
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.