It so, I'm guessing that your confirmation page is not within a catalog context (in the url). You can use an overload to the GetBasket that taken a boolean, indicating whether or not is should create a new basket, if one does not exist (and it probably doesn't, since you have completed in before the confirmation page).
You might want to add a property to your homepage/website doc type holding the name of your catalog and pass this value to SetCatalogContext in your XSLT.
Calls to SiteContext.Current.OrderContext.GetBasket() will trigger uCommerce to assign a new basket to the customer by default. I believe that you might have a call like that your mini cart macro, which is causing the issue.
You can either
1) Remove the mini cart completely from your page (you probably knew that already :))
2) or you can do a call to SiteContext.Current.OrderContext.GetBasket(false) instead, which will not try and assign a new basket to the customer.
3) or finally you could assign a catalog name to the SiteContext.Current.CatalogContext.CurrentCatalogName, which will allow uCommerce to assign the basket to the customer (basically it needs to know which currency to work with from the catalog)
"Cannot create basket when not in product catalog"
Error being thrown up by my mini basket. Seriously? This is occuring on the oeder confirmation page. (It sohuld be giving the empty message)
"order confirmation page"
"should be giving"
Hi Tony,
Do you use the XSLT API?
It so, I'm guessing that your confirmation page is not within a catalog context (in the url). You can use an overload to the GetBasket that taken a boolean, indicating whether or not is should create a new basket, if one does not exist (and it probably doesn't, since you have completed in before the confirmation page).
I'm using the following little helper in my XSLT extension to set the catalog context manually:
public static string SetCatalogContext(string catalog) {
SiteContext.Current.CatalogContext.CurrentCatalogName = catalog;
return "";
}
You might want to add a property to your homepage/website doc type holding the name of your catalog and pass this value to SetCatalogContext in your XSLT.
Bye
Christian
I'm doing this with Razor
Hi Tony,
Calls to SiteContext.Current.OrderContext.GetBasket() will trigger uCommerce to assign a new basket to the customer by default. I believe that you might have a call like that your mini cart macro, which is causing the issue.
You can either
1) Remove the mini cart completely from your page (you probably knew that already :))
2) or you can do a call to SiteContext.Current.OrderContext.GetBasket(false) instead, which will not try and assign a new basket to the customer.
3) or finally you could assign a catalog name to the SiteContext.Current.CatalogContext.CurrentCatalogName, which will allow uCommerce to assign the basket to the customer (basically it needs to know which currency to work with from the catalog)
Hope this helps.
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.