Adding products to your cart
You can use the cartAddProducts function to add products to your cart. This function takes the products you want to add and includes them in your cart. After adding products, the function provides an updated cart Cart as the result. Here is an example of how you can use the mutation to add products to your cart:prd_ZJQYAR_-ypwOLKEz
. The following JSON code will add 2 more units of that product, resulting in a total of 3 units:
Updating Line Items in the Cart
To update line items in your cart, you can use the cartLineUpdate mutation. This mutation allows you to modify the quantity of a specific line item in the cart. Here is an example of how to use this mutation:- $id: The ID of the cart you want to update.
- $lineId: The ID of the specific line item within the cart.
- $quantity: The new quantity you want to set for the line item.
Deleting Line Items from the Cart
To remove line items from the cart, you can use the cartLineDelete mutation. This mutation allows you to delete a specific line item from the cart. Here is an example of how to use this mutation:- $id: The ID of the cart from which you want to delete the line item.
- $lineId: The ID of the specific line item you wish to remove from the cart.