At the moment the commands are only documented here while they are still being tested. An announcement in the future will provide details when they will be usable.

Get Cart

Get the contents of a cart.
wp cocart cart get

Arguments

cart_key
string
The cart key.
user_id
int
The user ID.
wp cocart cart get --cart_key=t_978655cffb069bbc97e8cdd2991d3c
wp cocart cart get --user_id=174

Clear Cart

Clear the contents of a cart.
wp cocart cart clear

Arguments

cart_key
string
The cart key.
user_id
int
The user ID.
Examples
wp cocart cart clear --cart_key=t_978655cffb069bbc97e8cdd2991d3c
wp cocart cart clear --user_id=174

Add to Cart

Add an item to the cart.
wp cocart cart add

Arguments

cart_key
string
The cart key.
user_id
int
The user ID.
product_id
int
required
The product ID.
quantity
int
The quantity of the product.
wp cocart cart add --cart_key=t_978655cffb069bbc97e8cdd2991d3c --product_id=247
wp cocart cart add --user_id=174 --product_id=247

Remove Item

Remove an item from the cart.
wp cocart cart remove

Arguments

cart_key
string
The cart key.
user_id
int
The user ID.
item_key
int
required
The item key.
wp cocart cart remove --cart_key=t_978655cffb069bbc97e8cdd2991d3c --item_key=70efdf2ec9b086079795c442636b55fb
wp cocart cart remove --user_id=174 --item_key=70efdf2ec9b086079795c442636b55fb

Update Item

Update the quantity of an item in the cart.
wp cocart cart update

Arguments

cart_key
string
The cart key.
user_id
int
The user ID.
item_key
int
required
The item key.
quantity
int
required
The quantity of the item.
wp cocart cart update --cart_key=t_978655cffb069bbc97e8cdd2991d3c --item_key=70efdf2ec9b086079795c442636b55fb --quantity=2
wp cocart cart update --user_id=174 --item_key=70efdf2ec9b086079795c442636b55fb --quantity=2