Search.../

clearPrimary( )

Sets all pricing plans as not primary.

Description

The clearPrimary() function returns a Promise that resolves when no pricing plan is marked as a primary plan.

After clearing the primary plan, when viewing pricing plans on the site, no plan is highlighted with a customizable ribbon.

Only users with "Manage Pricing Plans" permissions can clear the primary plan.

Syntax

function clearPrimary(): Promise<void>

clearPrimary Parameters

This function does not take any parameters.

Returns

Return Type:

Promise<void>

Related Content:

Was this helpful?

Make no plans primary, clearing the highlight and the ribbon on the site

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import wixPricingPlansBackend from 'wix-pricing-plans-backend';
3
4export const myClearPrimaryFunction = webMethod(Permissions.Anyone, () => {
5 return wixPricingPlansBackend.clearPrimary()
6 .then(() => {
7 // No pricing plans are set as primary. This means
8 // no plans are highlighted with a custom ribbon
9 // when displayed on the site.
10 console.log("No plans are highlighted on the site");
11 })
12 .catch((error) => {
13 console.error(error);
14 });
15});
16
17// Returns a promise that resolves to void