clearPrimary( )


Sets all pricing plans as not primary.

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.

Method Declaration
Copy
function clearPrimary(): Promise<void>;
Request
This method does not take any parameters
Make no plans primary, clearing the highlight and the ribbon on the site
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import wixPricingPlansBackend from "wix-pricing-plans-backend"; export const myClearPrimaryFunction = webMethod(Permissions.Anyone, () => { return wixPricingPlansBackend .clearPrimary() .then(() => { // No pricing plans are set as primary. This means // no plans are highlighted with a custom ribbon // when displayed on the site. console.log("No plans are highlighted on the site"); }) .catch((error) => { console.error(error); }); }); // Returns a promise that resolves to void
Errors

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

Did this help?