4.2 KiB
WHMCS Pricing
Display WHMCS product prices on WordPress using shortcodes. Lightweight, cached, works with Elementor.
Installation
- Upload ZIP via
Plugins > Add New > Upload Plugin - Activate
- Go to
Settings > WHMCS Pricing - Enter your WHMCS credentials
WHMCS Setup
Step 1: Allow API Access by IP
- Go to
General Settings > Securitytab in WHMCS - Find API IP Access Restriction
- Add your WordPress server IP address
- Save changes
Step 2: Generate API Credentials
- Go to
System Settings > API Credentials - Click
Generate New API Credential - Set Access Type to
Allowed - Copy Identifier and Secret
Enter these in WordPress plugin settings along with your WHMCS URL.
Security Note: Without adding your WordPress server IP to API IP Access Restriction, the API calls will be blocked by WHMCS.
Usage
Basic shortcode:
[whmcs_price product_id="123" billing_cycle="annually"]
Parameters
product_id- WHMCS product ID (required)billing_cycle- monthly, quarterly, semiannually, annually, biennially, triennially (default: monthly)currency- EUR, USD, GBP, etc. (uses plugin default if not specified)format-defaultorno_decimalsshow_cycle-trueorfalse(default: true)lang- Language:english,spanish,portuguese-pt,dutch,french,german,russian(default: english)class- Custom CSS class
Examples
[whmcs_price product_id="5" billing_cycle="annually"]
Output: €24.00 per year
[whmcs_price product_id="5" billing_cycle="monthly" format="no_decimals"]
Output: €3 per month
[whmcs_price product_id="5" currency="USD" show_cycle="false"]
Output: $3.50
[whmcs_price product_id="5" billing_cycle="annually" lang="spanish"]
Output: €24.00 por año
[whmcs_price product_id="5" billing_cycle="monthly" lang="dutch"]
Output: €3.00 per maand
Translations
Billing cycle text is translated via languages.json. Supported languages:
englishspanishportuguese-ptdutchfrenchgermanrussian
Add more languages by editing languages.json in the plugin folder (uses WHMCS language naming).
{
"italian": {
"monthly": "al mese",
"annually": "all'anno"
}
}
Find Product IDs
In WHMCS admin:
System Settings > Products/Services- Click a product
- ID is in URL:
?id=123
HTML Output
<span class="whmcs-price" data-product-id="123" data-cycle="annually">
<span class="currency-symbol">€</span>
<span class="price-amount">24.00</span>
<span class="billing-cycle">per year</span>
</span>
Style it with CSS:
.whmcs-price { font-weight: bold; }
.price-amount { font-size: 24px; }
Important Notes
WHMCS uses -1.00 for unavailable billing cycles. If a product doesn't have monthly pricing in WHMCS, don't use billing_cycle="monthly" in the shortcode. Check your WHMCS product configuration first.
Caching: Prices are cached for 1 hour by default. Change this in plugin settings. Click "Clear All Cache" after updating prices in WHMCS.
Errors: Only administrators see error messages. Regular visitors see nothing if a price can't be loaded.
Settings
- WHMCS URL - Your WHMCS installation URL (https://billing.yourdomain.com)
- API Identifier - From WHMCS API credentials
- API Secret - From WHMCS API credentials
- Default Currency - Fallback currency (EUR, USD, etc.)
- Show Decimals - Toggle decimal places globally
- Cache Duration - How long to cache API responses (seconds)
- Debug Mode - Enable logging, disable cache
Troubleshooting
Price shows as -1.00:
- That billing cycle isn't available for this product in WHMCS
- Use a different
billing_cycleparameter
No price displays:
- Check product ID exists in WHMCS
- Verify API credentials are correct
- Enable Debug Mode and check
/wp-content/debug.log - Clear plugin cache
Wrong price:
- Clear cache (prices are cached)
- Check currency matches WHMCS configuration
- Verify billing cycle is available
Requirements
- WordPress 5.0+
- PHP 7.4+
- WHMCS 8.x with API access
- SSL recommended
Support
By: ArkHost Sponsored by: Duplika.com License: GPL v2+