Developer forum

Forum » Ecommerce - Standard features » API based solutions

API based solutions

Søren Heide Larsen
Søren Heide Larsen
Reply

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:

  1. Retrieve context:
    var pageView = Dynamicweb.Frontend.PageView.GetPageviewByPageID(/*some page id*/);
  2. Modify Context.Cart
  3. 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?


Replies

 

You must be logged in to post in the forum