Developer forum
E-mail notifications
All Cart Commands (CartCmd)
Replies
- add
Let me know if this info is sufficient.
Regards /Snedker
I know it's an old thread but it seems that it's still not addressed. I have two questions related to this:
1. Where is the documentation that describes all the cart commands?
2. How do I implement a simple quantity update? It seems that updateorderlines adds the passed in quantity to the current quantity, is that correct? If so, how can I just update a quantity for an item from a form?
Thanks,
Imar
The best documentation we currently have on this is section "7.2 Managing the Cart" in Dynamicweb eCommerce 8 ;-)
In the first step in the Cart module you can post QuantityOrderLine«actual order line id»=87 to update the quantity on a specific order line.
The CartCmd action also supports updating order line quantities, but it only works with GET requests:
@foreach (var line in GetLoop("OrderLines")) { <form method="get"> <input type="hidden" name="Id" value="@Pageview.Page.ID"/> … <input type="number" name='QuantityOrderLine@(line.GetValue("Ecom:Order:OrderLine.ID"))' value='@line.GetValue("Ecom:Order:OrderLine.Quantity")'/> <button type="submit" name="CartCmd" value="UpdateOrderLines">Update</button> </form> }
I have registered the missing support for POST requests as Bug 16436.
Best regards,
Mikkel
Hi Mikkel,
Thanks for that. You say "In the first step in the Cart module you can post QuantityOrderLine«actual order line id»=87 to update the quantity on a specific order line." That seems to contradict with the second part that says only GET is supported. Or am I missing something?
Imar
The Cart module handles POST requests with QuantityOrderLine-stuff by itself, i.e. without using the CartCmd, so you're not missing anything. But I understand your confusion.
I have fixed Bug 16436 and the fix will be released with Dynamicweb 8.6.
Best regards,
Mikkel
Just a note - it is "cartcmd" (not cardcmd).
So to empty card using querystring you would add:
cartcmd=emptycart
/Sten Hougaard
You must be logged in to post in the forum