The Free Price Text module replaces $0.00 (or any zero-price display) with custom text like “FREE” across your store. This applies to product pages, variation selectors, and cart totals.
Why Use This Module
Fluent Cart displays zero-priced products as $0.00. This looks awkward for freebies, samples, lead magnets, and promotional items. Showing “FREE” instead is cleaner and more persuasive.
Enabling the Module
- Go to Fluent Cart > GT Extensions.
- Toggle on Free Price Text.
- Set your preferred display text (default: “FREE”).
- Click Save Settings.
The module also integrates directly into Fluent Cart’s settings. After enabling, go to Fluent Cart > Settings > Store Setup and look for the Free Price Display section. You can configure the text there as well.
Settings
- Free Text — The text to display instead of $0.00. Default:
FREE. You can use any text: “No Cost”, “Complimentary”, “$0 — Free”, etc. - Enable Free Price Text — Toggle from the Fluent Cart store settings panel.
How It Works
The module operates on two levels:
Server-side filtering:
The module hooks into fluent_cart/single_product/variation_price and fluent_cart/cart/estimated_total to replace zero prices before they reach the browser. When the price value is 0, the filter returns your custom text wrapped in a styled <span> element.
Client-side DOM replacement:
Because Fluent Cart uses Vue.js for dynamic rendering, some price elements are rendered after the initial page load. The module injects a JavaScript snippet in wp_footer that:
- Scans the page for price elements containing zero values
- Sets up a
MutationObserverto catch dynamically-rendered prices - Replaces matched patterns with your custom text
The script detects zero prices in eight currency formats: $0.00, €0.00, £0.00, ¥0, ₹0.00, ₩0, CHF 0.00, and 0.00 kr.
Styling
The free price text is wrapped in a <span class="gtfc-free-price"> element with these default styles:
.gtfc-free-price {
color: #10b981;
font-weight: 600;
}
The text appears in green (emerald-500) and bold weight, making it stand out from regular prices.
Where It Appears
- Product pages — Replaces the main price display and variation prices
- Product archive/cards — Replaces prices on listing pages
- Cart — Replaces line item prices and totals when the cart total is zero
- Checkout — Replaces estimated total display
Integration with Custom Cart Text Module
When the Free Price Text module is active, the Custom Add to Cart Text module automatically changes the “Buy Now” button to “Get it Free” for zero-priced products. Both modules work together without additional configuration.
Customization
Filter the free price text programmatically:
add_filter( 'gt_extensions_fluentcart/free_price_text', function( $text ) {
return 'Complimentary';
} );
This filter runs before the text is displayed, letting you set different text based on context (product type, user role, etc.).