# Plan Upgrade
Before proceeding further to find the gist, it is of utmost importance to ensure that you are already familiar with the "Introduction" article. This article discusses the necessary steps that must be completed* prior to utilizing the information provided in this section.
*Go back to "Introduction" now.
# Upgrading a plan
PanelAlpha offers a user-friendly method for customers to seamlessly manage plan upgrades directly within the application. When users approach the maximum number of available sites or their hosting space nears capacity, they can initiate an upgrade for their website.
# Workflow
- When the end client reaches the limit of their sites, they will get a dashboard notification with information that they cannot create any new instances before they upgrade their plan.
The button configuration is described in the next section of this article.
- Otherwise, just the notification without the redirecting button will be displayed.
- In the "My Hosting" section of the PanelAlpha client area, in the top right corner of the 'Plan Usage' table, there is a button that allows upgrading the current plan.
- Upgrade your plan from the WHMCS platform level:
- Select the product from available, then confirm your decision.
- Once the payment is complete, the end user will see the new product active on the list of products/services. Consequently, with the new upgraded product with more instances allowed, the user may follow back to PanelAlpha, via 'Manage WordPress' redirecting buttons, to quickly create new instances within the new upgraded limit.
# Plan and product cnfiguration
- Set up the upgrade link in the PanelAlpha admin area → Configuration → Plans → Plan Details page. There type in the hyperlink that will redirect the end user to a page where they can upgrade their current plan.
- In your WHMCS, create a base of products that will be offered to PanelAlpha clients to upgrade their plan.
- It is important to create products with different plans assigned and different limits set up.
- When the product settings are ready, move to the Upgrades tab, and select packages which will be allowed for clients to upgrade. When ready, clients redirected form PanelAlpha, will be given a choice to select products from within the packages selected in this step.
# Service identification logic
Take a moment now to understand how the process works from the background.
As an administrator, you need to include a link in the Plan details to enable client redirection to WHMCS for upgrade purposes. When the "Upgrade" button is pressed in the PanelAlpha Hosting details, this URL is utilized, with a unique ID number added to the link.
For example:
Saved upgrade URL: https://modulesgardencom/index.php/store/wordpress-hosting
Link used for redirection: https://modulesgarden.com/index.php/store/wordpress-hosting?paupgradeserviceid=2
Note that ?paupgradeserviceid=2 has been automatically added!
This is how a hook used for these purposes appears, based on the WHMCS example:
add_hook('ClientAreaPageHome', 1, function () {
if (empty($_REQUEST['paupgradeserviceid'])) {
return;
}
$panelAlphaServiceId = $_REQUEST['paupgradeserviceid'];
$hosting = Hosting::getService($panelAlphaServiceId);
if (!$hosting) {
Helper::showPageNotFound();
}
global $CONFIG;
header("Location: {$CONFIG['SystemURL']}/upgrade.php?type=package&id={$hosting->id}");
exit();
});