Developer forum

Forum » Development » All Cart Commands (CartCmd)

All Cart Commands (CartCmd)

Bo Møller
Reply
Is it possible to get a list of all cart commands? 

Replies

 
Morten Snedker
Reply
This post has been marked as an answer
 I'm afraid the documentation on this part has room for improvement. Here goes:

- add
- addmulti
- emptycart
- converttoorder
- updateorderlines
- incorderline
- decorderline
- delorderline
- orderline
- fetchingcustomerfrominfodirekt

Let me know if this info is sufficient.

Regards /Snedker

Votes for this answer: 0
 
Bo Møller
Reply
Have you got some examples on how to use updateorderlines? Or the "orderline" one?
 
Kim Søjborg Pedersen
Reply
 Yes please or at least a description on how to use updateorderlines and orderline
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

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

 
Mikkel Ricky
Reply

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

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

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

 
Mikkel Ricky
Reply

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

 

 
Sten Hougaard
Reply

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