/** * An object representing an address. */ interface CartAddress { /** * First name. * @requiredField firstName */ firstName: string; /** * Last name. * @requiredField lastName */ lastName: string; /** * Email address. * @requiredField email */ email: string; /** * Phone number. * @requiredField phone */ phone: string; /** * Address. * @requiredField address */ address: string; } /** * An object representing a coupon applied in a shopping cart. */ interface CartAppliedCoupon { /** * Coupon code. * @requiredField code */ code: string; /** * Coupon unique identifier. * @requiredField couponId */ couponId: string; /** * Coupon name. * @requiredField name */ name: string; /** * Type of coupon. * One of: * * + `"BuyXGetY"` * + `"FixedPriceAmount"` * + `"FreeShipping"` * + `"MoneyOffAmount"` * + `"PercentOffRate"` * @requiredField couponType */ couponType: string; /** * Value of the coupon discount. * @requiredField discountValue */ discountValue: string; } /** * An object representing a visitor who abandoned a shopping cart. */ interface CartBuyerInfo { /** * Buyer's unique ID. * @requiredField id */ id: string; /** * Buyer's email address. * @requiredField email */ email: string; /** * Buyer's first name. * @requiredField firstName */ firstName: string; /** * Buyer's last name. * @requiredField lastName */ lastName: string; /** * Buyer's identity. * One of: * * + `"ADMIN"`: Buyer is the site owner. * + `"MEMBER"`: Buyer is a logged-in site member. * + `"VISITOR"`: Buyer is not logged in. * + `"CONTACT"`: A contact has been created for the buyer. * @requiredField identityType */ identityType: string; /** * Buyer's phone number. * @requiredField phone */ phone: string; } /** * An object representing a custom text field. */ interface CartCustomTextField { /** * Field title. * @requiredField title */ title: string; /** * Field value. * @requiredField value */ value: string; } /** * An object representing a line item in a shopping cart. */ interface CartLineItem { /** * Cart line item ID. * @requiredField id */ id: number; /** * Name of the line item. * @requiredField name */ name: string; /** * Notes about the line item. * @requiredField notes */ notes: string; /** * Line item price. * @requiredField price */ price: string; /** * Line item product ID. * @requiredField productId */ productId: string; /** * Line item quantity. * @requiredField quantity */ quantity: number; /** * Line item stock keeping unit. * @requiredField sku */ sku: string; /** * Total price charged to the customer for all line items after any applicable discounts. * @requiredField totalPrice */ totalPrice: string; /** * Line item weight. * @requiredField weight */ weight: string; /** * Type of the line item. * One of: * * + `"DIGITAL"`: Digital item. * + `"PHYSICAL"`: Physical item. * + `"CUSTOM_AMOUNT_ITEM"`: Item with a custom price. * + `"UNSPECIFIED"`: Type can't be classified due to an error. * @requiredField lineItemType */ lineItemType: string; /** * Line item options. * @requiredField options * @servicePath wix-stores-frontend.Option */ options: Option[]; /** * Media item. * @requiredField mediaItem * @servicePath wix-stores-frontend.CartMediaItem */ mediaItem: CartMediaItem; /** * Custom text. * @requiredField customTextFields * @servicePath wix-stores-frontend.CartCustomTextField */ customTextFields: CartCustomTextField[]; } /** * An object representing a line item's primary media. */ interface CartMediaItem { /** * Media item type. Currently only `"IMAGE"` type supported. * @requiredField type */ type: string; /** * Media item source for media uploaded to Wix (wix:image, wix:video or external URL). * @requiredField src */ src: string; } /** * An object representing a shopping cart. */ interface CartObj { /** * Unique identifier of the shopping cart. * @requiredField _id */ _id: string; /** * Coupon applied in the shopping cart. * @requiredField appliedCoupon * @servicePath wix-stores-frontend.CartAppliedCoupon */ appliedCoupon: CartAppliedCoupon; /** * Cart billing address. * @requiredField billingAddress * @servicePath wix-stores-frontend.CartAddress */ billingAddress: CartAddress; /** * The buyer's information. * @requiredField buyerInfo * @servicePath wix-stores-frontend.CartBuyerInfo */ buyerInfo: CartBuyerInfo; /** * Cart status. Either `"INCOMPLETE"` or `"COMPLETE"`. * @requiredField status */ status: string; /** * Currency of the shopping cart. * @requiredField currency * @servicePath wix-stores-frontend.Currency */ currency: Currency; /** * The shopping cart's shipping information. * @requiredField shippingInfo * @servicePath wix-stores-frontend.CartShippingInfo */ shippingInfo: CartShippingInfo; /** * Items in the shopping cart. * @requiredField lineItems * @servicePath wix-stores-frontend.CartLineItem */ lineItems: CartLineItem[]; /** * The shopping cart's totals. * @requiredField totals * @servicePath wix-stores-frontend.OrderTotals */ totals: OrderTotals; /** * The order's units of weight. One of: `"KG"`, `"LB"`, or `"UNSPECIFIED_WEIGHT_UNIT"`. * @requiredField weightUnit */ weightUnit: string; } /** * An object representing shipping information. */ interface CartShippingInfo { /** * Shipment address. * @servicePath wix-stores-frontend.CartAddress */ shippingAddress?: CartAddress; /** * Pickup address. * @servicePath wix-stores-frontend.CartAddress */ pickupInfo?: CartAddress; } /** * An object representing a currency. */ interface Currency { /** * The currency code. * @requiredField currency */ currency: string; } /** * An object representing a media item. * * The `src` property of a `MediaItem` can be an image or video from the [Media Manager](https://support.wix.com/en/article/about-the-media-manager). * * The image source format for Media Manager images is: * `wix:image://v1//#originWidth=&originHeight=[&watermark=]` * * The video source format is: * `wix:video://v1//#posterUri=&posterWidth=&posterHeight=` */ interface MediaItem { /** * Media item ID. * @requiredField id */ id: string; /** * Media item title. * @requiredField title */ title: string; /** * Media item description. * @requiredField description */ description: string; /** * Media items type. Can be "image" or "video." * @requiredField type */ type: string; /** * Media item URL. * @requiredField src */ src: string; /** * Thumbnail URL for videos only. */ thumbnail?: string; } /** * An object representing a line item option. */ interface Option { /** * Name of the product option. * @requiredField option */ option: string; /** * Selected option. * @requiredField selection */ selection: string; } /** * An object representing an order's totals. */ interface OrderTotals { /** * The subtotal of all the order's line items, excluding tax. * @requiredField subtotal */ subtotal: number; /** * The total shipping price, including tax. * @requiredField shipping */ shipping: number; /** * The total amount of tax. * @requiredField tax */ tax: string; /** * The total calculated discount amount. * @requiredField discount */ discount: number; /** * The total price. * @requiredField total */ total: number; /** * The total weight of the order's items. * @requiredField weight */ weight: number; /** * The total quantity of the the order's line items. * @requiredField quantity */ quantity: number; } /** * An object representing an option for a store product. */ interface ProductOption { /** * Option type. Either `"color"` or `"drop_down"`. * @requiredField optionType */ optionType: string; /** * Option name. * @requiredField name */ name: string; /** * Option choices. * @requiredField choices * @servicePath wix-stores-frontend.ProductOptionsChoice */ choices: ProductOptionsChoice[]; } /** * An object representing all the available options for a store product, such as "Size" or "Color". * * An option can't be changed if it has choices and variants. To change an option, reset its variants with `resetAllProductVariantData()` or `resetVariantData()`. For each option, you can define a maximum of 6 choices. */ interface ProductOptions { /** * Name of the option. This key name *  is dependent on the options added to the product. For example, if a product has a size * option, this key will be something like `"Size"`. * * `optionKey` isn't case-sensitive. Therefore the values for the option keys "`Size`", "`SIZE`", and "`size`" are combined. * @requiredField optionKey * @servicePath wix-stores-frontend.ProductOption */ optionKey: ProductOption; } /** * An object returned by `getProductOptionsAvailability()` representing the availability of a product. */ interface ProductOptionsAvailability { /** * Whether the product with the specified option choices is available for purchase. * @requiredField availableForPurchase */ availableForPurchase: boolean; /** * An object representing all the available options for a store product. * @requiredField productOptions * @servicePath wix-stores-frontend.ProductOptions */ productOptions: ProductOptions; /** * Main product media item (image or video) URL. * @requiredField mainMedia */ mainMedia: string; /** * List of product media items. * @requiredField mediaItems * @servicePath wix-stores-frontend.MediaItem */ mediaItems: MediaItem; /** * The variant of the product selected using the specified option choices if there is one. * @requiredField selectedVariant * @servicePath wix-stores-frontend.ProductOptionsAvailabilitySelectedVariant */ selectedVariant: ProductOptionsAvailabilitySelectedVariant; } /** * An object representing the product variant selected with `getProductOptionsAvailability()`. */ interface ProductOptionsAvailabilitySelectedVariant { /** * Product variant stock keeping unit value. * @requiredField sku */ sku: string; /** * Product variant currency. * @requiredField currency */ currency: string; /** * Product variant price. The variant price must be greater than its discount. * @requiredField price */ price: number; /** * Discounted product variant price. * @requiredField discountedPrice */ discountedPrice: number; /** * Product variant price formatted with the currency. * @requiredField formattedPrice */ formattedPrice: string; /** * Discounted product variant price formatted with the currency. * @requiredField formattedDiscountedPrice */ formattedDiscountedPrice: string; /** * Whether the product variant is shown in the store. * @requiredField visible */ visible: boolean; /** * Whether the product variant is in stock. * @requiredField inStock */ inStock: boolean; /** * Product variant weight. * @requiredField weight */ weight: number; } /** * An object representing an options choice for a store product, such as choice "Small" for the option "Size." * * You can define between 1 and 30 choices for each option. */ interface ProductOptionsChoice { /** * Choice value. * @requiredField value */ value: number; /** * Choice description. * @requiredField description */ description: number; /** * Choice media. * @requiredField media * @servicePath wix-stores-frontend.ProductOptionsChoiceMedia */ media: ProductOptionsChoiceMedia; /** * Whether the product with this choice is in stock. * @requiredField inStock */ inStock: boolean; /** * Whether the product with this option is visible. * @requiredField visible */ visible: boolean; } /** * An object representing the choice media. */ interface ProductOptionsChoiceMedia { /** * Main choice media item (image or video thumbnail) URL. * @requiredField mainMedia */ mainMedia: string; /** * List of choice media items. * @requiredField mediaItems * @servicePath wix-stores-frontend.MediaItem */ mediaItems: MediaItem; } /** * An object representing the selection of specific variants of a product. Use only one of * `choices` or `variantIds`. */ interface ProductVariantOptions { /** * Choices of the retrieved variants. */ choices?: object; /** * IDs of the variants to retrieve. */ variantIds?: string[]; } interface QuickViewOptions { /** * Product quantity to be displayed in the Quick View. Defaults to 1. * @requiredField quantity */ quantity: number; } /** * An object containing variant information to use when creating or updating variants. */ interface VariantInfo { /** * Variant currency. * @requiredField currency */ currency: string; /** * Variant price. The variant price must be greater than its discount. If the variant price has been updated, changes to the product price don't affect the variant price. * @requiredField price */ price: number; /** * Discounted variant price. * @requiredField discountedPrice */ discountedPrice: number; /** * Variant price formatted with the currency. * @requiredField formattedPrice */ formattedPrice: string; /** * Discounted variant price formatted with the currency. * @requiredField formattedDiscountedPrice */ formattedDiscountedPrice: string; /** * Price per unit. * @requiredField pricePerUnit */ pricePerUnit: number; /** * Price per unit formatted with currency symbol. * @requiredField formattedPricePerUnit */ formattedPricePerUnit: string; /** * Variant weight. * @requiredField weight */ weight: number; /** * Variant stock keeping unit value. * @requiredField sku */ sku: string; /** * Whether the variant is visible in the store. * @requiredField visible */ visible: boolean; } /** * An object representing a product variant item. */ interface VariantItem { /** * Unique variant ID. * @requiredField _id */ _id: string; /** * Choices of the retrieved variant in the form of an object containing a `key:value` pair for each variant choice. For example, if a variant has a size option, this key value will be something like "Size" and its value will be something like "Large". * @requiredField choices */ choices: object; /** * Variant information. * @requiredField variant * @servicePath wix-stores-frontend.VariantInfo */ variant: VariantInfo; } /** * Function that runs when a cart changes. * @param cart - The changed cart. * @requiredField cart * @servicePath wix-stores-frontend.CartObj */ type CartChangedHandler = (cart: CartObj) => void; /** * **Deprecated.** * The `wix-stores-frontend.Cart` module will continue to work, but newer functions are available at * [`wix-ecom-frontend`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/introduction) and [`wix-ecom-backend.CurrentCart`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/introduction). * * > **Note:** * > The `wix-stores-frontend.Cart` modules is deprecated. * > If you're already using this modules in your code, it will continue to work. * > To stay compatible with future changes, update your code * > with the migration instructions in this module's functions. * * The `wix-stores-frontend.Cart` module contains functionality for working with a * site's cart from frontend code. * * To use the Wix Stores Cart API, import `{ cart }` from the `wix-stores-frontend` module: * * ```javascript * import { cart } from 'wix-stores-frontend'; * ``` */ interface Cart { /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.addToCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/add-to-current-cart). * * > #### 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.addToCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/add-to-current-cart). * > * > 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.addProducts()`, * > and replace it with `currentCart.addToCurrentCart()`. * > Update your code to work with the new `currentCart.addToCurrentCart()` call and response properties. * > * > To help with updating your code to work with the new `currentCart.addToCurrentCart()` properties, learn more about [integrating Wix Stores with the Wix eCommerce](https://dev.wix.com/docs/velo/api-reference/wix-stores-backend/e-commerce-integration). * > * > 3. Test your changes to make sure your code behaves as expected. * * Adds one or more products to the cart. * * The `addProducts()` function returns a Promise that is resolved when the * specified products are added to the cart. * * Use the `quantity` property of each `AddToCartItem` object that is * passed to the products parameter to add one or more products to the cart at one time. * * Use the `options` property of each `AddToCartItem` object that is * passed to the products parameter to specify the product options to choose when adding * the product to the cart. For example, if a product comes in different sizes, you can * specify the size that should be added to the cart. If the product you are adding to the * cart has options, you must specify which options should be chosen. * * You can see a product's option information in the `productOptions` field in the **Stores/Products** collection. * * You can use [`product.getOptionsAvailability()`](https://www.wix.com/velo/reference/wix-stores-frontend/product/getoptionsavailability) * to determine if an item with specific options is available for purchase. * * > **Note:** If you use [`wix-stores-backend.createProduct()`](https://www.wix.com/velo/reference/wix-stores-backend/createproduct) immediately before adding that product to the cart, we suggest [setting a timeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) for `"1000"` milliseconds (1 second) before calling `cart.addProducts()`. While this slows down the operation slightly, it also ensures proper retrieval of the newly created product before adding it to the cart. * @param products - One or more products to be added to the cart. * @requiredField products * @servicePath wix-stores-frontend.Cart.AddToCartItem * @returns Fulfilled - The updated cart with added products. * @servicePath wix-stores-frontend.CartObj */ addProducts(products: AddToCartItem[]): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.updateCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/update-current-cart). * * > #### 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.updateCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/update-current-cart). * > * > 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.applyCoupon()`, * > and replace it with `currentCart.updateCurrentCart()`. * > Update your code to work with the new `currentCart.updateCurrentCart()` * > call and response properties. * > * > 3. Test your changes to make sure your code behaves as expected. * * Adds and applies a coupon to the cart. * * The `applyCoupon()` function returns a Promise that resolves to the current * site visitor's cart when the specified coupon has been applied. * * The cart can only hold one coupon. If a coupon is already applied to the cart, passing a different `couponCode` to `applyCoupon()` will replace the existing one. * * > **Note:** When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `applyCoupon()` will only work when viewing the live site. * @param couponCode - The code of the coupon to be applied to the cart. * @requiredField couponCode * @returns Fulfilled - The updated cart. * @servicePath wix-stores-frontend.CartObj */ applyCoupon(couponCode: string): Promise; /** * **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()`](https://dev.wix.com/docs/velo/api-reference/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. * * @returns Fulfilled - The retrieved cart. * @servicePath wix-stores-frontend.CartObj */ getCurrentCart(): Promise; /** * **Deprecated.** * This function will continue to work, but will soon be deprecated. Hiding the Mini Cart or Side Cart can be done by clicking anywhere else on the page. * * Hides the Mini Cart. * * The `hideMiniCart()` function hides the Mini Cart. * Learn more about the [Mini Cart](https://support.wix.com/en/article/customizing-the-cart-page). * * > **Note:** This API will fail when viewing the site on mobile because there is no Mini Cart on the mobile site. */ hideMiniCart(): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-frontend.onCartChange()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/on-cart-change). * * > #### 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-frontend.onCartChange()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/on-cart-change). * > * > To migrate to the new function: * > * > 1. Add the new import statement: * > * > ```javascript * > import wixEcomFrontend from "wix-ecom-frontend"; * > ``` * > * > 2. Look for any code that uses `cart.onChange()`, * > and replace it with `wixEcomFrontend.onCartChange()`. * > The new `onCartChange()` event handler does not return the changed cart. Update your code accordingly. * > * > 3. Test your changes to make sure your code behaves as expected. * * * An event handler that is triggered when items are added or removed from a cart. * * The `onChange()` function is a client-side event handler invoked every time the cart changes. It takes a callback function which receives the new `Cart` object as a parameter. * * > **Notes:** * > + Use `onChange()` in the global site code file (masterPage.js). This ensures the event is triggered when a change to the cart is made on any page. Learn more about [global (site) code](https://support.wix.com/en/article/velo-working-with-the-velo-sidebar#global-site). * > + The `onChange()` function can only be used once a page has loaded. Therefore, you must use it in code that is contained in or is called from the [onReady()](https://dev.wix.com/docs/velo/api-reference/$w/on-ready) event handler or any element event handler. * > + When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `onChange()` will only work when viewing the live site. * @param handler - The name of the function to run when a cart changes. * @requiredField handler * @servicePath wix-stores-frontend.CartChangedHandler */ onChange(handler: CartChangedHandler): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.removeCouponFromCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/remove-coupon-from-current-cart). * * > #### 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.removeCouponFromCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/remove-coupon-from-current-cart). * > * > 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.removeCoupon()`, * > and replace it with `currentCart.removeCouponFromCurrentCart()`. * > Update your code to work with the new `currentCart.removeCouponFromCurrentCart()` * > call and response properties. * > * > 3. Test your changes to make sure your code behaves as expected. * * Removes the coupon currently applied to the cart. * * The `removeCoupon()` function returns a Promise that resolves to the current * site visitor's cart when the currently applied coupon has been removed. * * > **Note:** When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `removeCoupon()` will only work when viewing the live site. * * @returns Fulfilled - The updated cart. * @servicePath wix-stores-frontend.CartObj */ removeCoupon(): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.removeLineItemsFromCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/remove-line-items-from-current-cart). * * > #### 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.removeLineItemsFromCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/remove-line-items-from-current-cart). * > * > 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.removeProduct()`, * > and replace it with `currentCart.removeLineItemsFromCurrentCart()`. * > Update your code to work with the new `currentCart.removeLineItemsFromCurrentCart()` * > call and response properties. * > * > 3. Test your changes to make sure your code behaves as expected. * * Removes a specified product from the cart. * * The `removeProduct()` function returns a Promise that resolves to the * updated cart after the product is removed. * Every line item in a cart has an ID. Pass this to `removeProduct()` to remove that line item/product from the cart. * * > **Notes:** * > + `removeProduct()` does not decrement the line item's quantity, it removes the line item/product altogether. * > + When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `removeProduct()` will only work when viewing the live site. * @param cartLineItemId - ID of the cart line item to remove. * @requiredField cartLineItemId * @returns Fulfilled - The updated cart. * @servicePath wix-stores-frontend.CartObj */ removeProduct(cartLineItemId: number): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-frontend.openSideCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/open-side-cart). * * > #### 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-frontend.openSideCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/open-side-cart). * > * > To migrate to the new function: * > * > 1. Add the new import statement: * > * > ```javascript * > import wixEcomFrontend from "wix-ecom-frontend"; * > ``` * > * > 2. Look for any code that uses `cart.showMiniCart()`, * > and replace it with `wixEcomFrontend.openSideCart()`. * > * > 3. Test your changes to make sure your code behaves as expected. * * Shows the Mini Cart. * * The `showMiniCart()` function displays the Mini Cart. * Learn more about the [Mini Cart](https://support.wix.com/en/article/customizing-the-cart-page). * > **Note:** This API will fail when viewing the site on mobile because there is no Mini Cart on the mobile site. */ showMiniCart(): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.updateCurrentCartLineItemQuantity()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/update-current-cart-line-item-quantity). * * > #### 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.updateCurrentCartLineItemQuantity()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/update-current-cart-line-item-quantity). * > * > 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.updateLineItemQuantity()`, * > and replace it with `currentCart.updateCurrentCartLineItemQuantity()`. * > Update your code to work with the new `currentCart.updateCurrentCartLineItemQuantity()` * > call and response properties. * * Updates the quantity of a specified line item in the cart. * * The `updateLineItemQuantity()` function returns a Promise that resolves to the current * site visitor's cart when the specified line item's quantity has been updated. * * > **Note:** When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `updateLineItemQuantity()` will only work when viewing the live site. * @param cartLineItemId - ID of the cart line item to update. * @requiredField cartLineItemId * @param quantity - Line item's new quantity. * @requiredField quantity * @returns Fulfilled - The updated cart. * @servicePath wix-stores-frontend.CartObj */ updateLineItemQuantity(cartLineItemId: number, quantity: number): Promise; } /** * An object used when adding one or more products to the cart. */ interface AddToCartItem { /** * ID of the product to add to the cart. * @requiredField productId */ productId: string; /** * Number of product units to add to the cart. * @requiredField quantity */ quantity: number; /** * Specific product options to add to the cart. * If the product you're adding has options, you must specify which options to add. * @servicePath wix-stores-frontend.Cart.AddToCartOptions */ options?: AddToCartOptions; } /** * An object used when adding a product to the cart with options. */ interface AddToCartOptions { /** * Product options to use when adding the * product to the cart. The object contains `key:value` pairs where the key is the option name and the value is the chosen option value. */ choices?: object; /** * Custom text fields to use when adding the product to the cart. * @servicePath wix-stores-frontend.Cart.CustomTextField */ customTextFields?: CustomTextField[]; } /** * An object used to pass a custom text field when adding a product to * the cart with options. */ interface CustomTextField { /** * Custom text field title. * @requiredField title */ title: string; /** * Custom text field value. * @requiredField value */ value: string; } /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.addToCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/add-to-current-cart). * * > #### 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.addToCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/add-to-current-cart). * > * > 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.addProducts()`, * > and replace it with `currentCart.addToCurrentCart()`. * > Update your code to work with the new `currentCart.addToCurrentCart()` call and response properties. * > * > To help with updating your code to work with the new `currentCart.addToCurrentCart()` properties, learn more about [integrating Wix Stores with the Wix eCommerce](https://dev.wix.com/docs/velo/api-reference/wix-stores-backend/e-commerce-integration). * > * > 3. Test your changes to make sure your code behaves as expected. * * Adds one or more products to the cart. * * The `addProducts()` function returns a Promise that is resolved when the * specified products are added to the cart. * * Use the `quantity` property of each `AddToCartItem` object that is * passed to the products parameter to add one or more products to the cart at one time. * * Use the `options` property of each `AddToCartItem` object that is * passed to the products parameter to specify the product options to choose when adding * the product to the cart. For example, if a product comes in different sizes, you can * specify the size that should be added to the cart. If the product you are adding to the * cart has options, you must specify which options should be chosen. * * You can see a product's option information in the `productOptions` field in the **Stores/Products** collection. * * You can use [`product.getOptionsAvailability()`](https://www.wix.com/velo/reference/wix-stores-frontend/product/getoptionsavailability) * to determine if an item with specific options is available for purchase. * * > **Note:** If you use [`wix-stores-backend.createProduct()`](https://www.wix.com/velo/reference/wix-stores-backend/createproduct) immediately before adding that product to the cart, we suggest [setting a timeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) for `"1000"` milliseconds (1 second) before calling `cart.addProducts()`. While this slows down the operation slightly, it also ensures proper retrieval of the newly created product before adding it to the cart. * @param products - One or more products to be added to the cart. * @requiredField products * @servicePath wix-stores-frontend.Cart.AddToCartItem * @returns Fulfilled - The updated cart with added products. * @servicePath wix-stores-frontend.CartObj */ declare function addProducts(products: AddToCartItem[]): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.updateCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/update-current-cart). * * > #### 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.updateCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/update-current-cart). * > * > 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.applyCoupon()`, * > and replace it with `currentCart.updateCurrentCart()`. * > Update your code to work with the new `currentCart.updateCurrentCart()` * > call and response properties. * > * > 3. Test your changes to make sure your code behaves as expected. * * Adds and applies a coupon to the cart. * * The `applyCoupon()` function returns a Promise that resolves to the current * site visitor's cart when the specified coupon has been applied. * * The cart can only hold one coupon. If a coupon is already applied to the cart, passing a different `couponCode` to `applyCoupon()` will replace the existing one. * * > **Note:** When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `applyCoupon()` will only work when viewing the live site. * @param couponCode - The code of the coupon to be applied to the cart. * @requiredField couponCode * @returns Fulfilled - The updated cart. * @servicePath wix-stores-frontend.CartObj */ declare function applyCoupon(couponCode: string): Promise; /** * **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()`](https://dev.wix.com/docs/velo/api-reference/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. * * @returns Fulfilled - The retrieved cart. * @servicePath wix-stores-frontend.CartObj */ declare function getCurrentCart(): Promise; /** * **Deprecated.** * This function will continue to work, but will soon be deprecated. Hiding the Mini Cart or Side Cart can be done by clicking anywhere else on the page. * * Hides the Mini Cart. * * The `hideMiniCart()` function hides the Mini Cart. * Learn more about the [Mini Cart](https://support.wix.com/en/article/customizing-the-cart-page). * * > **Note:** This API will fail when viewing the site on mobile because there is no Mini Cart on the mobile site. */ declare function hideMiniCart(): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-frontend.onCartChange()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/on-cart-change). * * > #### 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-frontend.onCartChange()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/on-cart-change). * > * > To migrate to the new function: * > * > 1. Add the new import statement: * > * > ```javascript * > import wixEcomFrontend from "wix-ecom-frontend"; * > ``` * > * > 2. Look for any code that uses `cart.onChange()`, * > and replace it with `wixEcomFrontend.onCartChange()`. * > The new `onCartChange()` event handler does not return the changed cart. Update your code accordingly. * > * > 3. Test your changes to make sure your code behaves as expected. * * * An event handler that is triggered when items are added or removed from a cart. * * The `onChange()` function is a client-side event handler invoked every time the cart changes. It takes a callback function which receives the new `Cart` object as a parameter. * * > **Notes:** * > + Use `onChange()` in the global site code file (masterPage.js). This ensures the event is triggered when a change to the cart is made on any page. Learn more about [global (site) code](https://support.wix.com/en/article/velo-working-with-the-velo-sidebar#global-site). * > + The `onChange()` function can only be used once a page has loaded. Therefore, you must use it in code that is contained in or is called from the [onReady()](https://dev.wix.com/docs/velo/api-reference/$w/on-ready) event handler or any element event handler. * > + When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `onChange()` will only work when viewing the live site. * @param handler - The name of the function to run when a cart changes. * @requiredField handler * @servicePath wix-stores-frontend.CartChangedHandler */ declare function onChange(handler: CartChangedHandler): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.removeCouponFromCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/remove-coupon-from-current-cart). * * > #### 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.removeCouponFromCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/remove-coupon-from-current-cart). * > * > 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.removeCoupon()`, * > and replace it with `currentCart.removeCouponFromCurrentCart()`. * > Update your code to work with the new `currentCart.removeCouponFromCurrentCart()` * > call and response properties. * > * > 3. Test your changes to make sure your code behaves as expected. * * Removes the coupon currently applied to the cart. * * The `removeCoupon()` function returns a Promise that resolves to the current * site visitor's cart when the currently applied coupon has been removed. * * > **Note:** When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `removeCoupon()` will only work when viewing the live site. * * @returns Fulfilled - The updated cart. * @servicePath wix-stores-frontend.CartObj */ declare function removeCoupon(): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.removeLineItemsFromCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/remove-line-items-from-current-cart). * * > #### 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.removeLineItemsFromCurrentCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/remove-line-items-from-current-cart). * > * > 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.removeProduct()`, * > and replace it with `currentCart.removeLineItemsFromCurrentCart()`. * > Update your code to work with the new `currentCart.removeLineItemsFromCurrentCart()` * > call and response properties. * > * > 3. Test your changes to make sure your code behaves as expected. * * Removes a specified product from the cart. * * The `removeProduct()` function returns a Promise that resolves to the * updated cart after the product is removed. * Every line item in a cart has an ID. Pass this to `removeProduct()` to remove that line item/product from the cart. * * > **Notes:** * > + `removeProduct()` does not decrement the line item's quantity, it removes the line item/product altogether. * > + When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `removeProduct()` will only work when viewing the live site. * @param cartLineItemId - ID of the cart line item to remove. * @requiredField cartLineItemId * @returns Fulfilled - The updated cart. * @servicePath wix-stores-frontend.CartObj */ declare function removeProduct(cartLineItemId: number): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-frontend.openSideCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/open-side-cart). * * > #### 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-frontend.openSideCart()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/open-side-cart). * > * > To migrate to the new function: * > * > 1. Add the new import statement: * > * > ```javascript * > import wixEcomFrontend from "wix-ecom-frontend"; * > ``` * > * > 2. Look for any code that uses `cart.showMiniCart()`, * > and replace it with `wixEcomFrontend.openSideCart()`. * > * > 3. Test your changes to make sure your code behaves as expected. * * Shows the Mini Cart. * * The `showMiniCart()` function displays the Mini Cart. * Learn more about the [Mini Cart](https://support.wix.com/en/article/customizing-the-cart-page). * > **Note:** This API will fail when viewing the site on mobile because there is no Mini Cart on the mobile site. */ declare function showMiniCart(): Promise; /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-backend.currentCart.updateCurrentCartLineItemQuantity()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/update-current-cart-line-item-quantity). * * > #### 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.updateCurrentCartLineItemQuantity()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/current-cart/update-current-cart-line-item-quantity). * > * > 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.updateLineItemQuantity()`, * > and replace it with `currentCart.updateCurrentCartLineItemQuantity()`. * > Update your code to work with the new `currentCart.updateCurrentCartLineItemQuantity()` * > call and response properties. * * Updates the quantity of a specified line item in the cart. * * The `updateLineItemQuantity()` function returns a Promise that resolves to the current * site visitor's cart when the specified line item's quantity has been updated. * * > **Note:** When [editing a site as a contributor](https://support.wix.com/en/article/velo-working-with-contributors), `updateLineItemQuantity()` will only work when viewing the live site. * @param cartLineItemId - ID of the cart line item to update. * @requiredField cartLineItemId * @param quantity - Line item's new quantity. * @requiredField quantity * @returns Fulfilled - The updated cart. * @servicePath wix-stores-frontend.CartObj */ declare function updateLineItemQuantity(cartLineItemId: number, quantity: number): Promise; type cartSdkModuleContext_AddToCartItem = AddToCartItem; type cartSdkModuleContext_AddToCartOptions = AddToCartOptions; type cartSdkModuleContext_Cart = Cart; type cartSdkModuleContext_CustomTextField = CustomTextField; declare const cartSdkModuleContext_addProducts: typeof addProducts; declare const cartSdkModuleContext_applyCoupon: typeof applyCoupon; declare const cartSdkModuleContext_getCurrentCart: typeof getCurrentCart; declare const cartSdkModuleContext_hideMiniCart: typeof hideMiniCart; declare const cartSdkModuleContext_onChange: typeof onChange; declare const cartSdkModuleContext_removeCoupon: typeof removeCoupon; declare const cartSdkModuleContext_removeProduct: typeof removeProduct; declare const cartSdkModuleContext_showMiniCart: typeof showMiniCart; declare const cartSdkModuleContext_updateLineItemQuantity: typeof updateLineItemQuantity; declare namespace cartSdkModuleContext { export { type cartSdkModuleContext_AddToCartItem as AddToCartItem, type cartSdkModuleContext_AddToCartOptions as AddToCartOptions, type cartSdkModuleContext_Cart as Cart, type cartSdkModuleContext_CustomTextField as CustomTextField, cartSdkModuleContext_addProducts as addProducts, cartSdkModuleContext_applyCoupon as applyCoupon, cartSdkModuleContext_getCurrentCart as getCurrentCart, cartSdkModuleContext_hideMiniCart as hideMiniCart, cartSdkModuleContext_onChange as onChange, cartSdkModuleContext_removeCoupon as removeCoupon, cartSdkModuleContext_removeProduct as removeProduct, cartSdkModuleContext_showMiniCart as showMiniCart, cartSdkModuleContext_updateLineItemQuantity as updateLineItemQuantity }; } type Methods$2 = { [P in keyof T as T[P] extends Function ? P : never]: T[P]; }; declare const cartContext: Methods$2; /** * The wix-stores-frontend.Navigate module contains functionality for navigating to * store-related pages from frontend code. * * To use the Wix Stores Navigate API, import `{ navigate }` from the `wix-stores-frontend` module: * * ```javascript * import { navigate } from 'wix-stores-frontend'; * ``` */ interface Navigate { /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-frontend.navigateToCartPage()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/navigate-to-cart-page). * * > #### 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-frontend.navigateToCartPage()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/navigate-to-cart-page). * > * > To migrate to the new function: * > * > 1. Add the new import statement: * > * > ```javascript * > import wixEcomFrontend from "wix-ecom-frontend"; * > ``` * > * > 2. Look for any code that uses `navigate.toCart()`, * > and replace it with `wixEcomFrontend.navigateToCartPage()`. * > * > 3. Test your changes to make sure your code behaves as expected. * * Directs the browser to navigate to the site visitor's cart page. * * The `toCart()` function navigates the browser to the site visitor's cart page. * * @returns Fulfilled - When the browser is directed to the site visitor's cart page. */ toCart(): Promise; /** * Navigates to the specified product's page. * * ![developer preview tag](https://user-images.githubusercontent.com/89579857/213133550-2b4fa3e8-e8fc-4513-a733-00abcc70925c.png) * * > **Note:** This method is supported in [sites](https://dev.wix.com/docs/develop-websites) and [mobile apps](https://www.wix.com/app-builder). * @param productId - ID of the product to navigate to. * @requiredField productId * @returns Fulfilled - When the browser or app is directed to the product's page. */ toProduct(productId: string): Promise; } /** * **Deprecated.** * This function will continue to work, but a newer version is available at * [`wix-ecom-frontend.navigateToCartPage()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/navigate-to-cart-page). * * > #### 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-frontend.navigateToCartPage()`](https://dev.wix.com/docs/velo/api-reference/wix-ecom-frontend/navigate-to-cart-page). * > * > To migrate to the new function: * > * > 1. Add the new import statement: * > * > ```javascript * > import wixEcomFrontend from "wix-ecom-frontend"; * > ``` * > * > 2. Look for any code that uses `navigate.toCart()`, * > and replace it with `wixEcomFrontend.navigateToCartPage()`. * > * > 3. Test your changes to make sure your code behaves as expected. * * Directs the browser to navigate to the site visitor's cart page. * * The `toCart()` function navigates the browser to the site visitor's cart page. * * @returns Fulfilled - When the browser is directed to the site visitor's cart page. */ declare function toCart(): Promise; /** * Navigates to the specified product's page. * * ![developer preview tag](https://user-images.githubusercontent.com/89579857/213133550-2b4fa3e8-e8fc-4513-a733-00abcc70925c.png) * * > **Note:** This method is supported in [sites](https://dev.wix.com/docs/develop-websites) and [mobile apps](https://www.wix.com/app-builder). * @param productId - ID of the product to navigate to. * @requiredField productId * @returns Fulfilled - When the browser or app is directed to the product's page. */ declare function toProduct(productId: string): Promise; type navigateSdkModuleContext_Navigate = Navigate; declare const navigateSdkModuleContext_toCart: typeof toCart; declare const navigateSdkModuleContext_toProduct: typeof toProduct; declare namespace navigateSdkModuleContext { export { type navigateSdkModuleContext_Navigate as Navigate, navigateSdkModuleContext_toCart as toCart, navigateSdkModuleContext_toProduct as toProduct }; } type Methods$1 = { [P in keyof T as T[P] extends Function ? P : never]: T[P]; }; declare const navigateContext: Methods$1; /** * The wix-stores-frontend.product module contains functionality for working with a * store's products from frontend code. * * To use the Wix Stores Product API, import `{ product }` from the `wix-stores-frontend` module: * * ```javascript * import { product } from 'wix-stores-frontend'; * ``` */ interface Product { /** * Retrieves the availability of a product based on the specified option choices. * * The information returned in the `selectedVariant` and `availableForPurchase` * properties reflects the option choices passed in the `choices` parameter. * * If the specified choices result in the selection of a single product variant, * that variant is returned in the `selectedVariant` property and the `availableForPurchase` * property indicates whether that product variant is available for purchase. * * If the choices specified in the `choices` parameter don't result in the selection of a single product variant, * no variant is returned in the `selectedVariant` property and the `availableForPurchase` * property will be `false`. * @param productId - The ID of the product whose availability is being checked. * @requiredField productId * @param choices - Option choices to use when checking the product's availability in the form of * an object containing a `key:value` pair for each product option. For example, if a product has a size option, the key will be something like "Size" and its value will be something like "Large". * @requiredField choices * @returns Fulfilled - The availability information of the product. * @servicePath wix-stores-frontend.ProductOptionsAvailability */ getOptionsAvailability(productId: string, choices: object): Promise; /** * Gets a product's available variants based on the specified product ID and either option choices or variant IDs. * @param productId - ID of the product whose variants are being retrieved. Pass only this field to retrieve all of the specified product's variants. * @requiredField productId * @param options - Variant options to return. If not specified, all the product's variants are returned. * @servicePath wix-stores-frontend.ProductVariantOptions * @returns Fulfilled - The variants with the specified choices. * @servicePath wix-stores-frontend.VariantItem */ getVariants(productId: string, options?: ProductVariantOptions): Promise; /** * Opens the [Quick View](https://support.wix.com/en/article/wix-stores-customizing-the-quick-view-in-the-product-gallery) modal of a specified product. * * The quantity input field in the Quick View will be pre-populated with 1, unless otherwise specified in the `options.quantity` field. * * If the product has different [options or variants](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#product-option-faqs), * they will be displayed for selection in the opened Quick View. * * >**Note:** * > This API fails when viewing the site on mobile because there is no Quick View on the mobile site. * @param productId - ID of the product to be displayed in the Quick View. * @requiredField productId * @param options - Quick View options. * @servicePath wix-stores-frontend.QuickViewOptions * @returns Fulfilled - When the Quick View modal is opened. */ openQuickView(productId: string, options?: QuickViewOptions): Promise; } /** * Retrieves the availability of a product based on the specified option choices. * * The information returned in the `selectedVariant` and `availableForPurchase` * properties reflects the option choices passed in the `choices` parameter. * * If the specified choices result in the selection of a single product variant, * that variant is returned in the `selectedVariant` property and the `availableForPurchase` * property indicates whether that product variant is available for purchase. * * If the choices specified in the `choices` parameter don't result in the selection of a single product variant, * no variant is returned in the `selectedVariant` property and the `availableForPurchase` * property will be `false`. * @param productId - The ID of the product whose availability is being checked. * @requiredField productId * @param choices - Option choices to use when checking the product's availability in the form of * an object containing a `key:value` pair for each product option. For example, if a product has a size option, the key will be something like "Size" and its value will be something like "Large". * @requiredField choices * @returns Fulfilled - The availability information of the product. * @servicePath wix-stores-frontend.ProductOptionsAvailability */ declare function getOptionsAvailability(productId: string, choices: object): Promise; /** * Gets a product's available variants based on the specified product ID and either option choices or variant IDs. * @param productId - ID of the product whose variants are being retrieved. Pass only this field to retrieve all of the specified product's variants. * @requiredField productId * @param options - Variant options to return. If not specified, all the product's variants are returned. * @servicePath wix-stores-frontend.ProductVariantOptions * @returns Fulfilled - The variants with the specified choices. * @servicePath wix-stores-frontend.VariantItem */ declare function getVariants(productId: string, options?: ProductVariantOptions): Promise; /** * Opens the [Quick View](https://support.wix.com/en/article/wix-stores-customizing-the-quick-view-in-the-product-gallery) modal of a specified product. * * The quantity input field in the Quick View will be pre-populated with 1, unless otherwise specified in the `options.quantity` field. * * If the product has different [options or variants](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#product-option-faqs), * they will be displayed for selection in the opened Quick View. * * >**Note:** * > This API fails when viewing the site on mobile because there is no Quick View on the mobile site. * @param productId - ID of the product to be displayed in the Quick View. * @requiredField productId * @param options - Quick View options. * @servicePath wix-stores-frontend.QuickViewOptions * @returns Fulfilled - When the Quick View modal is opened. */ declare function openQuickView(productId: string, options?: QuickViewOptions): Promise; type productSdkModuleContext_Product = Product; declare const productSdkModuleContext_getOptionsAvailability: typeof getOptionsAvailability; declare const productSdkModuleContext_getVariants: typeof getVariants; declare const productSdkModuleContext_openQuickView: typeof openQuickView; declare namespace productSdkModuleContext { export { type productSdkModuleContext_Product as Product, productSdkModuleContext_getOptionsAvailability as getOptionsAvailability, productSdkModuleContext_getVariants as getVariants, productSdkModuleContext_openQuickView as openQuickView }; } type Methods = { [P in keyof T as T[P] extends Function ? P : never]: T[P]; }; declare const productContext: Methods; export { cartContext as cart, navigateContext as navigate, productContext as product };