Search.../

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:

Promise<PricingPageOptions>
NAME
TYPE
DESCRIPTION
planIds
Array<string>

List of plan IDs displayed on the Plans & Pricing page.

title
string

Plans & Pricing page title.

subtitle
string

Plans & Pricing page subtitle.

checkout
CheckoutPageOptions

The data associated with the Checkout page.

Was this helpful?

Set a button to return the Pricing Page options when clicked

Copy Code
1import { customPurchaseFlow } from 'wix-pricing-plans-frontend';
2
3export async function showOptions_click(event) {
4 const pricingPageOptions = await customPurchaseFlow.getPricingPageOptions();
5 console.log(pricingPageOptions);
6}
Get the Pricing Page options and pass to checkout

Copy Code
1import { customPurchaseFlow } from 'wix-pricing-plans-frontend';
2
3$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});