> 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

# Method name: getProduct()

# Method package: w

# Method menu location: w --> ProductPage --> getProduct

# Method Link: https://dev.wix.com/docs/velo/velo-only-apis/$w/product-page/get-product.md

# Method Description:

Gets all the information associated with the current product.

The `getProduct()` function returns a Promise that is resolved when all
 of the information about the product shown on the `ProductPage` is
 retrieved.

 > **Important for Catalog V1 to V3 migration:** `getProduct()` returns a `Productv1` or a `Productv3` object, depending on a site's catalog version. These objects differ in field names, types, structure, and values, so code that relies on the V1 structure might stop working after a site migrates to Catalog V3. For the field-by-field differences, see the [Catalog V1 to V3 Migration Guide](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/catalog-v1-to-v3-migration-guide.md).
 >
 > Before a site migrates, update your code in one of the following ways:
 >
 > + Check the structure of the response and handle both product types. Only `Productv3` has a `revision` field.
 > + Call [Get Catalog Version](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/get-catalog-version?apiView=SDK.md) from backend code and process the product according to the version it reports.



# Method Code Examples:

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

## Get the current product's information

```javascript
$w('#myProductPage').getProduct()
  .then((product) => {
    let productName = product.name;
    let productDescription = product.description;
    // see example product object below
  })
  .catch((error) => {
    console.error(error);
  });

/*
 * Example product object:
 *
 *  {
 *    "_id": "91f7ac8b-2baa-289c-aa50-6d64764f35d3",
 *    "_updatedDate": "Wed Jan 20 2021 10:54:48 GMT+0200",
 *    "name": "Colombian Arabica",
 *    "description": "<p>The best organic coffee that Colombia has to offer.</p>",
 *    "mainMedia": "wix:image://v1/nsplsh_5033504669385448625573~mv2_d_6000_3376_s_4_2.jpg/file.jpg#originWidth=6000&originHeight=3376",
 *    "mediaItems": [
 *      {
 *        "id": "nsplsh_5033504669385448625573~mv2_d_6000_3376_s_4_2.jpg",
 *        "src": "wix:image://v1/nsplsh_5033504669385448625573~mv2_d_6000_3376_s_4_2.jpg/file.jpg#originWidth=6000&originHeight=3376",
 *        "description": "",
 *        "title": "",
 *        "link": "undefined",
 *        "type": "Image"
 *      }
 *    ],
 *    "sku": "undefined",
 *    "ribbons": [{"text": "Organic and Fair trade"}],
 *    "ribbon": "Organic and Fair trade",
 *    "currency": "USD",
 *    "price": 35,
 *    "discountedPrice": 30,
 *    "formattedPrice": "$35.00",
 *    "formattedDiscountedPrice": "$30.00",
 *    "pricePerUnit": 0.12,
 *    "formattedPricePerUnit": "$0.12",
 *    "pricePerUnitData": {
 *      "totalQuantity": 250,
 *      "totalMeasurementUnit": "G",
 *      "baseQuantity": 1,
 *      "baseMeasurementUnit": "G"
 *    },
 *    "inventoryItemId": "6e085374-d455-d763-55af-929b89b0ca2c",
 *    "discount": {
 *      "type": "AMOUNT",
 *      "value": 5
 *    },
 *    "trackInventory": false,
 *    "inStock": true,
 *    "quantityInStock": "undefined",
 *    "additionalInfoSections": [
 *      {
 *        "title": "Storage recommendations",
 *        "description": "<p>To&nbsp;preserve&nbsp;your beans' fresh roasted flavor as long as possible, store them in an opaque, air-tight container at room temperature.</p>\n"
 *      }
 *    ],
 *    "productOptions": {
 *      "Weight": {
 *        "optionType": "drop_down",
 *        "name": "Weight",
 *        "choices": [
 *          {
 *            "value": "250g",
 *            "description": "250g",
 *            "inStock": true,
 *            "visible": true,
 *            "mainMedia": "wix:image://v1/614034_103e8f4ab0ae4536a38b319d3eb437ed~mv2.png/missing-media.png#originWidth=500&originHeight=500",
 *            "mediaItems": []
 *          },
 *          {
 *            "value": "500g",
 *            "description": "500g",
 *            "inStock": true,
 *            "visible": true,
 *            "mainMedia": "wix:image://v1/614034_103e8f4ab0ae4536a38b319d3eb437ed~mv2.png/missing-media.png#originWidth=500&originHeight=500",
 *            "mediaItems": []
 *          }
 *        ]
 *      },
 *      "Ground for": {
 *        "optionType": "drop_down",
 *        "name": "Ground for",
 *        "choices": [
 *          {
 *            "value": "Stovetop",
 *            "description": "Stovetop",
 *            "inStock": true,
 *            "visible": true,
 *            "mainMedia": "wix:image://v1/614034_103e8f4ab0ae4536a38b319d3eb437ed~mv2.png/missing-media.png#originWidth=500&originHeight=500",
 *            "mediaItems": []
 *          },
 *          {
 *            "value": "Filter",
 *            "description": "Filter",
 *            "inStock": true,
 *            "visible": true,
 *            "mainMedia": "null",
 *            "mediaItems": []
 *          }
 *        ]
 *      }
 *    },
 *    "productPageUrl": "/product-page/colombian-arabica-1",
 *    "customTextFields": [
 *      {
 *        "title": "What would you like us to print on the custom label?",
 *        "maxLength": 200,
 *        "mandatory": false
 *      }
 *    ],
 *    "manageVariants": true,
 *    "productType": "physical",
 *    "slug": "colombian-arabica-1",
 *    "weight": "undefined",
 *    "collections": "undefined",
 *    "seoData": {
 *      "tags": [
 *        {
 *          "type": "title",
 *          "children": "Colombian Arabica | Organic and Fair Trade",
 *          "custom": false,
 *          "disabled": false
 *        },
 *        {
 *          "type": "meta",
 *          "props": {
 *            "name": "description",
 *            "content": "The best organic fair trade coffee that Colombia has to offer."
 *          },
 *          "children": "",
 *          "custom": false,
 *          "disabled": false
 *        }
 *      ]
 *    },
 *    "variants": [
 *      {
 *        "_id": "00000000-0000-0020-0005-a316e6ba5b37",
 *        "choices": {
 *          "Weight": "250g",
 *          "Ground for": "Stovetop"
 *        },
 *        "variant": {
 *          "currency": "USD",
 *          "price": 35,
 *          "discountedPrice": 30,
 *          "pricePerUnit": 0.12,
 *          "formattedPrice": "$35.00",
 *          "formattedDiscountedPrice": "$35.00",
 *          "formattedPricePerUnit": "$0.12",
 *          "weight": 0.25,
 *          "sku": "10001",
 *          "visible": true
 *        }
 *      },
 *      {
 *        "_id": "00000000-0000-0021-0005-a316e6ba5b37",
 *        "choices": {
 *          "Weight": "250g",
 *          "Ground for": "Filter"
 *        },
 *        "variant": {
 *          "currency": "USD",
 *          "price": 40,
 *          "discountedPrice": 35,
 *          "pricePerUnit": 0.14,
 *          "formattedPrice": "$40.00",
 *          "formattedDiscountedPrice": "$40.00",
 *          "formattedPricePerUnit": "$0.14",
 *          "weight": 0.25,
 *          "sku": "10003",
 *          "visible": true
 *        }
 *      },
 *      {
 *        "_id": "00000000-0000-003f-0005-a316e6ba5b37",
 *        "choices": {
 *          "Weight": "500g",
 *          "Ground for": "Stovetop"
 *        },
 *        "variant": {
 *          "currency": "USD",
 *          "price": 65,
 *          "discountedPrice": 60,
 *          "pricePerUnit": 0.24,
 *          "formattedPrice": "$65.00",
 *          "formattedDiscountedPrice": "$65.00",
 *          "formattedPricePerUnit": "$0.24",
 *          "weight": 0.5,
 *          "sku": "10002",
 *          "visible": true
 *        }
 *      },
 *      {
 *        "_id": "00000000-0000-0040-0005-a316e6ba5b37",
 *        "choices": {
 *          "Weight": "500g",
 *          "Ground for": "Filter"
 *        },
 *        "variant": {
 *          "currency": "USD",
 *          "price": 70,
 *          "discountedPrice": 65,
 *          "pricePerUnit": 0.26,
 *          "formattedPrice": "$70.00",
 *          "formattedDiscountedPrice": "$70.00",
 *          "formattedPricePerUnit": "$0.26",
 *          "weight": 1,
 *          "sku": "10004",
 *          "visible": true
 *        }
 *      }
 *    ]
 *  }
 *
 */
```

---