Currency Preamble for WooCommerce

 

By default, WooCommerce allows you to set the currency symbol ($, €, etc.), but it does not provide flexibility to add a currency preamble (prefix text) before the price.

For example:

  • You may want your product prices to appear as CAD $100.00 instead of just $100.00.

This is particularly useful for:

  • Stores selling internationally (avoiding confusion when multiple currencies use the same symbol $).

  • Businesses that want more professional-looking product pricing.

  • Store owners needing to localize their pricing display without hacking WooCommerce core files.

This plugin was created to fill this gap by allowing store admins to prepend any short text or currency code before WooCommerce product prices.

1. Goal of the Plugin

The main goals are:

  • Provide store admins with a simple way to add a currency preamble (like USD, CAD, etc.) before or after product prices.

  • Ensure the preamble is applied sitewide (product pages, shop pages, cart, checkout, etc.).

Make it lightweight, non-intrusive, and customizable without relying on extra heavy plugins.

2. Key Features
  1. Custom Currency Preamble

    – Admin can define a short preamble text (e.g., “CAD” or “NGN”) that appears before the price.

  2. WooCommerce Integration

    – Hooks directly into WooCommerce price formatting filters.
    – Works seamlessly across shop, product, cart, and checkout pages.

  3. Global Application

    – Once set, the preamble is displayed sitewide wherever WooCommerce outputs prices.

  4. Lightweight & Easy-to-Use

    – No complex settings or bloated features.
    – Just a single option field to set your preamble text.

  5. Safe & Compatible

    – Built as a standalone plugin (no WooCommerce core edits).
    -Follows WordPress plugin development best practices.
3. Usage

Step 1: Install & Activate

  • Upload the plugin to WordPress (/wp-content/plugins/).

  • Activate via the Plugins menu in the WordPress dashboard.

Step 2: Configure Settings

  • Go to WooCommerce → Settings → General.

  • Find the option Currency Preamble.

  • Enter your desired preamble text (e.g., “USD”, “CAD”, “NGN”).

Step 3: Save & Test

  • Save settings.

  • Visit product pages, shop pages, and checkout.

Prices will now display with the chosen preamble.