Pay What You Like, External Products and Checkout Protection
Core Forms 5.3 adds five Core Commerce store tools, ported from Stackless for FluentCart:
- Pay what you like: buyers choose what to pay.
- External products: a product page here that sends buyers to another site to buy.
- Free price text: “Free” instead of “USD 0.00”.
- Checkout protection: refuses throwaway email addresses and floods of orders.
- Payment problem alerts: emails you when a live payment can’t start or a renewal fails.
They work with the Licensing module and need no extra module.
Pay what you like
Edit a product, and under Selling → Pay what you like tick Let buyers choose what to pay.
- The minimum is each plan’s price. A plan priced at 0 can be bought free, or for any amount the buyer picks.
- Suggested amount: where checkout starts. Empty starts at the plan price.
- Quick amounts: up to 4 buttons, separated by commas, such as
5, 10, 25. Use0for a free choice. - Maximum: the most a buyer can pay. Empty means 1,000,000 (or 1,000 times the plan price, if that is more, for currencies such as VND or IDR), so a typo can’t charge a fortune.
The amounts are in each plan’s currency, and quick amounts outside a plan’s range are left out.
On a plan priced at 0, a buyer pays 0 or at least 1.00 (100 in currencies without cents, such as JPY). Payment providers refuse smaller charges, so 0.25 shows “Enter 0, or at least USD 1.00.”
Without a payment method for the currency, the box isn’t shown: a free plan checks out free, and a paid plan shows the usual “Checkout isn’t available yet” notice.
It applies to one-time (lifetime) plans only. Plans with a license term keep their price, because their renewals charge the plan price.
At checkout, the buyer sees a Name your price box under the contact fields, with the quick amounts. The order summary shows the plan price plus “Extra you chose to pay”, and the total updates as they type.
- An amount below the minimum or above the maximum shows “Enter at least …” or “Enter at most …”.
- When the total reaches 0, the payment methods disappear and the button says Complete purchase.
- If checkout can’t go ahead (a missing answer, say), the page comes back with the buyer’s amount kept.
- The 0 quick amount shows your Text for free plans.
Change the box heading under Core Commerce → Settings → Prices and checkout protection.
On product pages, the plan shows “Pay what you like: this price or more”, or “Free, or pay what you like” for a 0 plan.
Links with an amount: add cf_price to a checkout link to start at that amount, for example /core-checkout/?cf_product=my-theme&cf_plan=lifetime&cf_price=20. An amount outside the limits is moved to the nearest limit.
How it’s charged: the part above the plan price is added to the order like a priced add-on.
- Coupons and tax apply to the whole amount.
- The amount is saved with the purchase before the buyer pays, and checked against what the provider charged before a license is issued.
- The server checks every amount, so editing the page can’t lower it.
The Storefront API returns pay_what_you_like (min, max, suggested, presets) on each eligible plan.
External products
Edit a product, and under Selling → Sold on another website tick Send buyers to another website to buy this product.
| Field | Default | What it does |
|---|---|---|
| Product URL | A complete address beginning with https:// or http:// | |
| Button text | View product | Up to 60 characters |
| Open in a new tab | Off | Adds rel="noopener noreferrer" |
| Add rel=”nofollow” | On | On unless turned off, also for products created through the API |
| Add rel=”sponsored” | Off | For affiliate and paid links |
| Hide the price on product pages | Off |
What changes:
- The product page, product list, price and buy button blocks, shortcodes and Bricks elements keep the product here, but their buy buttons link to the URL.
- A checkout link for the product (
/core-checkout/?cf_product=…) sends the visitor straight to the URL. - The checkout refuses the product: “This product is sold on another website.”
- The Storefront API returns an
externalobject, and each plan’scheckout_urlis the external URL. - The product’s buttons show even when it has no active plan here.
The address comes only from the product’s saved settings, never from the link, so it can’t be used to send visitors elsewhere.
Licenses bought here before you switched a product to another site still renew and upgrade here.
Untick the box to sell the product here again. The URL is kept.
Free price text
Under Core Commerce → Settings → Prices and checkout protection, Text for free plans replaces a 0.00 price.
- It shows on product pages, product lists, the price block, the checkout order summary and the Storefront API’s
formatted_price. Buy buttons show no price. - On a pay-what-you-like plan the order summary shows the amount, since the buyer may pay more.
- The default is Free. Leave it empty to show the amount.
- Totals, discounts, tax, invoices and emails keep showing amounts.
Developers can change it with the cf_commerce_price_label filter ($label, $minor, $currency).
Checkout protection
Under Core Commerce → Settings → Prices and checkout protection:
- Refuse throwaway email addresses (on by default) refuses about 60 disposable email services, such as Mailinator and YOPmail, and their subdomains.
- The buyer sees: “Please use an email address you keep. We send your receipt and downloads there.”
- Also refuse these email domains: your own list, separated by commas.
- Orders per hour from one connection (default 10) refuses further attempts until an hour has passed since the earliest one counted. Leave it empty for 10, or use 0 for no limit.
- The buyer sees: “Too many order attempts from your connection. Please try again in an hour, or contact us for help.”
- Only attempts that pass the other checks count.
What a connection is: the visitor’s IP address, or for IPv6 its /64 block, since one home or server is given a whole block. Behind Cloudflare, the address Cloudflare reports is used, and only for requests that really come from Cloudflare’s network. For another proxy or load balancer, return the real address from the cf_checkout_client_ip filter ($ip, $server).
The limit keeps only a hash of the address, for an hour. Orders still record the buyer’s IP address as before. Logged-in administrators are never limited, so you can test freely.
Payment problem alerts
Under Core Forms → Settings → Payments, Email me when a live payment can’t start or a renewal payment fails is on by default.
You get a plain-text email when:
- a payment gateway can’t start a checkout, from a Core Forms payment form, the Core Commerce checkout, a client invoice or a license upgrade. Typical causes are a rejected key, an unsupported currency or the provider being down. The email names the product or form, the currency and the provider’s error message.
- a renewal payment fails at the provider (automatic renewals). The email names the product and the license ID.
- a payment needs your review, such as a second Braintree charge for one purchase.
Problems on the buyer’s side, such as a coupon that no longer applies or a form total of 0, don’t send alerts.
Alerts are sent only in live mode, from WP-Cron, never while the buyer waits. The same problem is reported once every 30 minutes. They contain no customer names or email addresses, and no keys.
They go to the site admin email unless you enter another address.
For developers, the actions behind them are:
cf_payment_checkout_failed($provider, $reason, $context).$context['error']is the exception; aCore_Forms\Payments\PurchaseRefusedis the buyer’s side and sends no alert.cf_subscription_payment_failed($subscription, $provider)cf_payment_needs_review($provider, $message, $context)