> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

> **Deprecated.** This method is deprecated. Planned removal date: 2025-01-01.

# Method name: getCurrentCart()

# Method package: wixStoresFrontend

# Method menu location: wixStoresFrontend --> Cart --> getCurrentCart

# Method Link: https://dev.wix.com/docs/velo/apis/wix-stores-frontend/cart/get-current-cart.md

# Method Description:

**Deprecated.**
This function will continue to work, but a newer version is available at
[`wix-ecom-backend.CurrentCart.getCurrentCart()`](https://www.wix.com/velo/reference/wix-ecom-backend/currentcart/getcurrentcart).

We recommend you migrate to the new [Wix eCommerce APIs](https://www.wix.com/velo/reference/wix-ecom-backend/introduction) as soon as possible.

> #### Migration Instructions
>
> If this function is already in your code, it will continue to work.
> To stay compatible with future changes, migrate to
> [`wix-ecom-backend.CurrentCart.getCurrentCart()`](wix-ecom-backend/currentcart/getcurrentcart).
>
> The `wix-ecom-backend.CurrentCart.getCurrentCart()` function works from both backend and frontend code.
>
> To migrate to the new function:
>
> 1. Add the new import statement:
>
>    ```javascript
>    import { currentCart } from 'wix-ecom-backend';
>    ```
>
> 2. Look for any code that uses `cart.getCurrentCart()`,
>    and replace it with `currentCart.getCurrentCart()`.
>    Update your code to work with the new `currentCart.getCurrentCart()`
>    call and response properties.
>    For more info about the differences between the Stores Cart and eCommerce Cart, refer to the [cart conversion table](https://www.wix.com/velo/reference/wix-ecom-backend/cart/stores-to-ecommerce-cart-conversion-table).
>
> 3. Test your changes to make sure your code behaves as expected.

Gets the current site visitor's shopping cart.

The `getCurrentCart()` function returns a Promise that resolves to the current
site visitor's shopping cart.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Get the current site visitor's cart

```javascript
import { cart } from 'wix-stores-frontend';

cart.getCurrentCart()
  .then((currentCart) => {
    const cartId = currentCart._id;
    const cartLineItems = currentCart.lineItems;
  })
  .catch((error) => {
    console.error(error);
  });


/* Example of returned currentCart object:
*
* {
*   "_id": "b36eb035-635a-450e-b74d-acf86ee4dfcc",
*   "appliedCoupon": {
*     "couponId": "e81e9c48-f954-4044-ba64-ccfe5c103c8f",
*     "name": "Summer Sale",
*     "code": "SummerSale",
*     "discountValue": "$10.00",
*     "couponType": "MoneyOff"
*   },
*   "billingAddress": {
*     "firstName": "John",
*     "lastName": "Doe",
*     "email":"john.doe@somedomain.com",
*     "phone":"5555555",
*     "address":"235 West 23rd Street\nNew York, New York 10011\nUnited States"
*   },
*   "buyerNote": "This is a note from the buyer.",
*   "buyerInfo":{
*     "firstName": "John",
*     "lastName": "Doe",
*     "email": "john.doe@somedomain.com",
*     "phone": "5555555555",
*     "identityType": "CONTACT"
*   },
*   "status": "INCOMPLETE",
*   "currency": {
*      "code": "USD"
*   },
*   "shippingInfo": {
*      "deliveryOption": "Free Shipping",
*      "shippingAddress": {
*        "firstName": "John",
*        "lastName": "Doe",
*        "email":"john.doe@somedomain.com",
*        "phone":"5555555",
*        "address":"235 West 23rd Street\nNew York, New York 10011\nUnited States"
*      },
*      "pickupDetails":null
*   },
*   "lineItems":[
*     {
*       "quantity": 1,
*       "price": 120,
*       "name": "A product",
*       "productId": "a668ef33-f5b8-6569-d04c-1d123be68441",
*       "totalPrice": 120,
*       "lineItemType": "PHYSICAL",
*       "customTextFields": [
*         "title": "Custom Field",
*         "value": "Custom value"
*       ],
*       "mediaItem": {
*         "src": "wix:image://v1/a9ff3b_ed3b544c319b4fad9c222c791a997832.jpg/file.jpg#originWidth=1000&originHeight=1000",
*         "type": "IMAGE"
*       },
*       "sku": "21554345656",
*       "options": [ ],
*       "weight": 3,
*       "id": 1
*     },
*     {
*       "quantity": 1,
*       "price": 25,
*       "name": "Another product",
*       "productId": "1a2d7e83-4bef-31d5-09e1-3326ee271c09",
*       "totalPrice": 25,
*       "lineItemType": "PHYSICAL",
*       "mediaItem": {
*         "src": "wix:image://v1/a9ff3b_c6158b4d41784ae8b08337a331e1de7f.jpg/file.jpg#originWidth=1000&originHeight=1000",
*         "type": "IMAGE"
*       },
*       "sku": "217537123517253",
*       "options": [
*         {
*           "option": "Size",
*           "selection": "Medium"
*         },
*         {
*           "option": "Color",
*           "selection": "Black"
*         }
*       ],
*       "weight": 2,
*       "id": 2
*     }
*   ],
*   "totals": {
*      "discount": 0,
*      "quantity": 2,
*      "shipping": 0,
*      "subtotal": 145,
*      "tax": 0,
*      "total": 145,
*      "weight": 5
*   },
*   "weightUnit": "LB"
* }
*/
```

---