getPlanStats( )


Gets statistics about the pricing plans.

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.

Method Declaration
Copy
function getPlanStats(): Promise<PlansStats>;
Request
This method does not take any parameters
Returns
Return Type:Promise<PlansStats>
Get statistics for the pricing plans
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import wixPricingPlansBackend from "wix-pricing-plans-backend"; export const myGetPlanStatsFunction = webMethod(Permissions.Anyone, () => { return wixPricingPlansBackend .getPlanStats() .then((statistics) => { console.log(statistics); }) .catch((error) => { console.error(error); }); }); /* Statistics object relevant to the site's pricing plans: * * { * // Count of all plans (public, hidden and archived) * "total": 8 * } * */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?