getPricingPageOptions( )
Returns the options set for the current Plans & Pricing page.
Description
The getPricingPageOptions()
function retrieves the options set for the Plans & Pricing Page in navigateToPricingPage()
.
The returned PricingPageOptions
object also includes any options set for the Checkout and Thank You pages.
Call this function in the page code of a default or custom Plans & Pricing page. If you need to pass the returned pricing page
options to navigateToCheckout()
at a later point, store the options object globally so you can access it later.
Note:
- To work with the Pricing Plans API, you need to publish your site.
Syntax
function getPricingPageOptions(): Promise<PricingPageOptions>
getPricingPageOptions Parameters
This function does not take any parameters.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
List of plan IDs displayed on the Plans & Pricing page.
Plans & Pricing page title.
Plans & Pricing page subtitle.
The data associated with the Checkout page.
Was this helpful?
1import { customPurchaseFlow } from 'wix-pricing-plans-frontend';23export async function showOptions_click(event) {4 const pricingPageOptions = await customPurchaseFlow.getPricingPageOptions();5 console.log(pricingPageOptions);6}
1import { customPurchaseFlow } from 'wix-pricing-plans-frontend';23$w.onReady(() => {4 $w('#button').onClick(async () => {5 const pricingPageOptions = await customPurchaseFlow.getPricingPageOptions();6 customPurchaseFlow.navigateToCheckout({7 planId: 'fedb93e3-623a-487b-a47d-499f48ee3c7d',8 ...pricingPageOptions,9 });10 });11});