WooCommerce plugin docs / Cart

Cart

Overview

The assistant uses the WooCommerce cart session, not a parallel basket. Shoppers can view totals, add products, change quantity, remove lines, and jump to checkout.

How It Works

  • GET /aiwsa/v1/cart — current cart + cart_url + checkout_url from wc_get_checkout_url() / cart URL.
  • Add from AI: tool add_to_cartConfirmation_Broker → shopper Confirm → POST .../confirm. Request cannot change product or qty.
  • Add from widget POST /cart/add: also staged through the same broker.
  • POST /cart/update and /cart/remove write the session directly (when tools enabled).
  • Extra JSON fields are ignored. Client cannot set price. Quantity capped (aiwsa_max_add_to_cart_quantity).

How to Enable It

WooCommerce → AI Assistant → Cart Assistant → enable tools. Appearance shows the cart icon in the widget.

Configuration

Cart Assistant settings.

Frontend Usage

  1. Add from a product card or accept an AI proposal (Confirm).
  2. Open the cart control.
  3. Change qty / remove.
  4. Click Checkout (primary button) to leave chat for WooCommerce checkout.

Example

Shopper confirms adding product 412 qty 1. Mini-cart shows line, subtotal from WooCommerce, checkout button.

Behavior

SituationWhat happens
Out of stock / not purchasableAdd fails with cart error
Variable without variationMust select variation
Confirm expiredMust add again
Tool disabledCorresponding UI/API hidden or refused
GuestSession cart like the rest of WooCommerce

Limitations

  • Not a custom checkout. Payment happens on WooCommerce.
  • Clear cart is a staged, confirmed action.

Troubleshooting

Add does nothing: Enable AI Agent, add_to_cart tool, product purchasable, nonce from /config. Quantity buttons missing: update_quantity off.