Hi
Is it possible to get the current amount of products in cart (update it asyncronous) withour having a seperate page for async call etc.?
/Hans
Hi
Is it possible to get the current amount of products in cart (update it asyncronous) withour having a seperate page for async call etc.?
/Hans
If you are in a layout template with a pageviewmodel you can go with
@Model.Cart.ProductsCount @Model.Cart.OrderlinesCount @Model.Cart.TotalProductsCount
In other templates you can use @Dynamicweb.Ecommerce.Common.Context.Cart.OrderLines.Count
thanks Nicolai
But can i get the value without reloading the page, or loading another page asyncronously?
/Hans
You can use the webapi:
~/dwapi/ecommerce/carts/{cartSecret}
where the cartSecret is Dynamicweb.Ecommerce.Common.Context.Cart.Secret
That will give you the cart as json.
BR Nicolai
You must be logged in to post in the forum