Search.../

arrangePlans( )

Changes the display order of the pricing plans on the site page and in the Dashboard.

Description

The arrangePlans() function returns a Promise that resolves when the plans are rearranged on the site page and in the Dashboard.

To rearrange the order of the plans, provide a list of IDs for all non-archived plans in the desired order, including hidden plans.

Only users with "Manage Pricing Plans" permissions can arrange plans.

Note: Make sure to provide all non-archived plan IDs to avoid unpredictable results.

Syntax

function arrangePlans(ids: Array<string>): Promise<void>

arrangePlans Parameters

NAME
TYPE
DESCRIPTION
ids
Array<string>

IDs of all non-archived plans in the order you want them arranged.

Returns

Return Type:

Promise<void>

Was this helpful?

Arrange plans

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import wixPricingPlansBackend from 'wix-pricing-plans-backend';
3
4export const myArrangePlansFunction = webMethod(Permissions.Anyone, () => {
5 const ids = [
6 "23b345b6-c78d-9012-e3f4-567g89h0i01k",
7 "3fb6a3c8-988b-7895-04bd-5c59ae0b18ea",
8 "3fb6a3c8-988b-7896-04bd-6c69ae0b18eb",
9 "4bb6a3c8-877b-7896-10ca-6c69ae0b18eb"
10 ];
11 return wixPricingPlansBackend.arrangePlans(ids)
12 .then(() => {
13 console.log("Plans rearranged");
14 })
15 .catch((error) => {
16 console.error(error);
17 });
18});
19
20// Returns a promise that resolves to void