Please forgive me if this is a simple question. I am building an example store from scratch to help verify the business requirements for our next Umbraco site. I am using route hijacking so I can have my own controllers and do my own routing (i.e. not using the uCommerce url rewriting). My url's then look like "/Store/Catalog/Category/product?catalogName=SpringCatalog&productId=200".
I am having a problem with everything in SiteContext being null, which I sort of would expect since I am not using the url rewriting rules for uCommerce. My question is: Is there a way that I can build my SiteContext in my controller or route every request through the pipeline that populates the SiteContext?
I have been able to get around the SiteContext being null problem until I try to have a CartAPIController which extends the UmbracoApiController. I want to be able to add a product to a cart by calling
Populate SiteContext manually?
Hello all,
Please forgive me if this is a simple question. I am building an example store from scratch to help verify the business requirements for our next Umbraco site. I am using route hijacking so I can have my own controllers and do my own routing (i.e. not using the uCommerce url rewriting). My url's then look like "/Store/Catalog/Category/product?catalogName=SpringCatalog&productId=200".
I am having a problem with everything in SiteContext being null, which I sort of would expect since I am not using the url rewriting rules for uCommerce. My question is: Is there a way that I can build my SiteContext in my controller or route every request through the pipeline that populates the SiteContext?
I have been able to get around the SiteContext being null problem until I try to have a CartAPIController which extends the UmbracoApiController. I want to be able to add a product to a cart by calling
Thanks!
Hi Logan,
If you change your parameters to catalog, category, and product SiteContext will automatically populate.
Alternatively you can set up the context yourself based on whatever info you have available in your routes like so:
This can be done for all aspects of the CatalogContext.
Hope this helps.
is working on a reply...