To use the Cart API, install the @wix/ecom package using npm or Yarn:
@wix/ecom
npm install @wix/ecom
or
yarn add @wix/ecom
Then import { cart } from @wix/ecom:
{ cart }
import { cart } from "@wix/ecom";