RTFM

Simple Price Per Code

for WooCommerce
Simple Price Per Code
Current Version
1.0.0
Requires WordPress
6.5
Tested Up To
7.0
Translations included
🇺🇸 English
🇪🇸 Spanish
🇫🇷 French
🇩🇪 German
🇨🇳 Chinese
🇯🇵 Japanese

Simple Price Per Code adds private WooCommerce pricing that only activates when a customer enters one or more approved member codes. Store admins manage the available codes in one place, then assign code-specific prices directly inside product and variation pricing fields.

Requirements

  • WordPress 6.5 or newer
  • WooCommerce 8.0 or newer
  • PHP 8.2 or newer

What The Plugin Does

  • Lets admins create reusable member codes containing only letters, numbers, dashes, and underscores
  • Adds a price field for every saved code on WooCommerce products
  • Supports variation-level member prices, with automatic fallback to the parent product price when a variation field is blank
  • Lets customers apply one or more member codes on cart and checkout
  • Updates cart pricing automatically when a matching code is active
  • Shows the original price struck through beside the member price when a code changes a line item price
  • Stores applied member codes and related pricing on the order
  • Shows member pricing details on the thank-you page, order emails, and admin order screen
  • Includes a member-savings summary throughout cart, checkout, and order views
  • Includes shortcodes and a native block so you can place the member-code form anywhere, including before the shop

Installation

  1. Upload the plugin folder to /wp-content/plugins/ or install it through the WordPress admin.
  2. Activate Simple Price Per Code.
  3. Make sure WooCommerce is active.
  4. In WordPress admin, go to WooCommerce > Member Pricing.
  5. Use the Settings tab to add the member codes you want to support and configure frontend behavior.
  6. Use the Instructions tab if you need the shortcodes, native block name, or a quick explanation of how the settings work.
  7. Edit products and enter prices for any codes that should affect those products.

Setup

1. Add Member Codes

Open WooCommerce > Member Pricing and add each code you want customers to be able to use.

  • Codes are stored in lowercase
  • Codes are case-insensitive when customers enter them
  • Allowed characters are letters, numbers, dashes, and underscores
  • Removing a code deletes that code from the master list and removes its saved price fields from all products and variations

2. Configure Frontend Behavior

The settings screen also lets you control:

  • Whether the member-code field appears on cart
  • Whether the member-code field appears on checkout
  • The field label shown to customers
  • How many codes can be used on one order, with 0 meaning unlimited
  • Whether member codes can be combined with WooCommerce coupons

3. Add Product Prices

After you create at least one code, product edit screens show a matching member-price field for each code.

  • Simple products: add prices in the standard WooCommerce pricing area
  • Variable products: add fallback prices on the parent product if needed
  • Variations: add variation-specific member prices to override the parent product’s member price for that code
  • Leave a member-price field blank to keep the normal WooCommerce price

How Pricing Works

When a customer applies a valid member code:

  • Any product with a price for that code switches to the member price
  • Products without a matching member price keep their normal WooCommerce price
  • If multiple codes are active and more than one matches a product, the lowest eligible member price wins
  • The code values themselves are not shown on product pages for customers unless the customer already has a valid code active in session and the price is being applied

Order Display

The plugin saves member-code pricing details to the order and displays them in:

  • The order confirmation / thank-you page
  • Customer emails
  • The WooCommerce admin order screen

Each summary includes:

  • The codes used on the order
  • The products affected by member pricing
  • Original and member prices
  • Total member savings when the member prices reduce the order total

Shortcodes And Block

Use this shortcode to render the member-code form in another location:

[sppc_member_code_form]

The block editor also includes a native block named Member Code Entry.

Use these when you want customers to enter a valid member code before they browse products. Once the code is active in session, shop and product pricing can show the matching member price automatically.

Extra Upgrades Included

The plugin goes beyond the base request in two meaningful ways:

Variation-Level Pricing

Variable products can use member-code pricing too. Each variation can define its own code-specific prices, and any blank variation field automatically inherits the parent product’s member price for that code.

Savings Visibility

When member pricing lowers an order total, the plugin shows the total member savings in cart, checkout, the thank-you page, emails, and the admin order screen. This makes the pricing benefit obvious to both the customer and the store team.

Uninstall Behavior

When the plugin is deleted from the WordPress Plugins screen, it removes:

  • The saved member code list
  • Frontend settings
  • Product and variation member-price metadata for registered codes

Historical order data is left intact so past orders keep their pricing records.

Troubleshooting

A member code is not being accepted

  • Confirm the code exists in WooCommerce > Member Pricing
  • Check for spaces or unsupported characters
  • If coupon stacking is disabled, remove any WooCommerce coupon before applying the member code
  • Confirm the order has not already reached the maximum allowed number of member codes unless the setting is 0 for unlimited

A product price did not change

  • Check whether that product or variation has a price saved for the active code
  • For variations, confirm whether the variation has its own member price or should inherit from the parent product
  • Make sure the active code is still listed in the settings screen

The member-code field does not appear

  • Check the cart and checkout visibility settings in WooCommerce > Member Pricing
  • If your site uses a custom flow, place the [sppc_member_code_form] shortcode where needed
  • You can also use the Member Code Entry block on a landing page above the shop

Developers

The plugin includes filters and actions so developers can customize member pricing behavior.

Filter: sppc_product_member_price

Use this filter to override the stored member price for a specific product and code before the plugin resolves pricing.

add_filter( 'sppc_product_member_price', function ( $price, $product, $code ) {
    if ( 'vip_member' === $code && 123 === $product->get_id() ) {
        return 19.99;
    }

    return $price;
}, 10, 3 );

Filter: sppc_resolved_member_pricing

Use this filter to modify the final resolved member pricing result after the plugin chooses the winning code.

add_filter( 'sppc_resolved_member_pricing', function ( $pricing, $product, $codes ) {
    if ( empty( $pricing ) ) {
        return $pricing;
    }

    if ( in_array( 'staff_rate', $codes, true ) ) {
        $pricing['code']         = 'staff_rate';
        $pricing['member_price'] = 10.00;
    }

    return $pricing;
}, 10, 3 );

Filter: sppc_member_code_label

Use this filter to change the frontend label based on context.

add_filter( 'sppc_member_code_label', function ( $label, $context ) {
    if ( 'checkout' === $context ) {
        return 'Club code';
    }

    return $label;
}, 10, 2 );

Filter: sppc_price_html

Use this filter to change the formatted strike-through / member-price HTML shown on the frontend.

add_filter( 'sppc_price_html', function ( $formatted, $original_html, $product, $pricing ) {
    if ( ! empty( $pricing['code'] ) ) {
        $formatted .= ' <small>(' . esc_html( strtoupper( $pricing['code'] ) ) . ')</small>';
    }

    return $formatted;
}, 10, 4 );

Action: sppc_after_member_code_applied

Use this action to react after a code has been added to the customer session.

add_action( 'sppc_after_member_code_applied', function ( $code, $active_codes ) {
    error_log( 'Applied member code: ' . $code . ' | Active: ' . implode( ',', $active_codes ) );
}, 10, 2 );

Action: sppc_after_member_code_removed

Use this action to react after a code has been removed from the customer session.

add_action( 'sppc_after_member_code_removed', function ( $code, $active_codes ) {
    error_log( 'Removed member code: ' . $code . ' | Remaining: ' . implode( ',', $active_codes ) );
}, 10, 2 );

Changelog

1.0.0 – 2026-04-14

  • Add admin-managed member codes for private WooCommerce pricing.
  • Add product and variation member-code pricing with variation fallback support.
  • Add cart, checkout, shortcode, and native block entry points for customer code activation.
  • Add order, email, and admin summaries for applied member pricing and savings.
  • Add settings and instructions tabs for plugin configuration and usage guidance.
  • Add WellPlayedWP updater wiring, uninstall cleanup, and localization assets for distribution readiness.