Hi Dynamicweb / Community,
We would like to run large parts of the cart as API (MVC) without having the need to create pages and I can only assume that we are not the only ones. We know that Dynamicweb is in the path of making Dynamicweb less dependent on the Context. But I would like to know if there is a best practice to cart retrieval and modifications from an MVC Controller, or at least what others have done to achieve this.
We have often done something like:
- Retrieve context:
var pageView = Dynamicweb.Frontend.PageView.GetPageviewByPageID(/*some page id*/); - Modify Context.Cart
- Calculate order: Here, we have done a lot of different tricks, none of which did not really feel like a hack (I’ll post code if needed)
Any takes on this?