add_to_cart
Add a product to the Tuma250 shopping cart by providing its URL slug. Optionally set quantity and variation attributes for variable products.
Instructions
Add a product to the Tuma250 shopping cart.
Uses the product slug (from search_products URL or get_order_details). For variable products, pass variation_attributes so the page pre-selects the variant, e.g. {"attribute_quantity": "500g"}.
Args: product_slug: Product URL slug, e.g. "fresh-carrots-1kg" (from URL or get_order_details items). quantity: Number of units to add (default 1). variation_attributes: For variable products, attribute key/value pairs e.g. {"attribute_quantity": "500g"} (from get_order_details or get_product_variations raw_attributes).
Returns: dict containing: - success (bool): Whether the item was confirmed in the cart. - cart_total_items (int): Total number of line items in the cart. - cart_total_price (float | None): Cart grand total. - line_item_summary (list): Each item with id, slug, variation_attributes, name, qty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quantity | No | ||
| product_slug | Yes | ||
| variation_attributes | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||