Search...
getPlanStats( )
Gets statistics about the pricing plans.
Description
The getPlanStats()
function returns a Promise that resolves to statistics about the plans
on the site.
Currently this function provides only the total number of pricing plans, including archived plans.
Only users with "Manage Pricing Plans" permissions can get plan statistics.
Syntax
function getPlanStats(): Promise<PlansStats>
getPlanStats Parameters
This function does not take any parameters.
Returns
Fulfilled - Overall statistics about the pricing plans.
Return Type:
Promise<PlansStats>
NAME
TYPE
DESCRIPTION
total
number
Total number of plans created, including active plans (both public and hidden) and archived plans.
Was this helpful?
Get statistics for the pricing plans
Copy Code
1import wixPricingPlansBackend from 'wix-pricing-plans-backend';23export function myGetPlanStatsFunction() {4 return wixPricingPlansBackend.getPlanStats()5 .then((statistics) => {6 console.log(statistics);7 })8 .catch((error) => {9 console.error(error);10 });11}1213/* Statistics object relevant to the site's pricing plans:14 *15 * {16 * // Count of all plans (public, hidden and archived)17 * "total": 818 * }19 *20 */