Wo WooCommerce Beginner

DataFirefly Inflation Pricing for WooCommerce

Raise WooCommerce prices in bulk while keeping charm prices such as 59, 89 or 569.

Updated Module version 1.0.0

What the plugin does

DataFirefly Inflation Pricing applies a percentage to all or part of your WooCommerce catalogue, then snaps each resulting price onto a charm price ladder you define. A 3 % increase on a product priced 59 does not produce 60.77 but 60.90, or 69 if you prefer whole numbers ending in 9.

The full journey runs in three stages: you describe the scope and the percentage, the plugin computes every new price and shows them in a table, then you approve. Nothing is written to the database before that approval, and every previous price is kept so the campaign can be rolled back.

Installation

  1. Download the ZIP archive from your DataFirefly customer account.
  2. In the WordPress admin, go to Plugins then Add New Plugin and click Upload Plugin.
  3. Select the ZIP file, install it, then activate.
  4. A new menu appears under WooCommerce, Inflation Pricing.

Activation creates two tables: wp_df_inflation_campaigns for campaigns and wp_df_inflation_items for price rows. The prefix follows your own installation.

Requirements: WordPress 5.8 or higher, WooCommerce 6.0 or higher, PHP 7.4 or higher. The plugin declares compatibility with HPOS and the cart and checkout blocks at start-up.

The three screens

New campaign

The main working screen. It gathers three cards: Increase, Scope and Rounding. You build the campaign here, then launch the preview.

History

The list of every campaign with its status. From this page you open the line by line detail of a campaign, apply a campaign left pending, roll back an applied campaign or delete a campaign you no longer need.

Rounding rules

The global settings: rounding tiers, direction, guaranteed increase, gross or net calculation base, batch size, uninstall behaviour. A simulator at the bottom of the page shows the result on sample prices.

Understanding rounding tiers

A tier is defined by three values:

  • Applies up to: the upper bound of the price band it covers. A value of 0 means no limit, so it designates the tier handling every price above the other tiers.
  • Step: the gap between two possible prices.
  • Ending: the offset applied to that gap.

The final price always equals the step multiplied by an integer, plus the ending. A few examples:

  • Step 10, ending 9 gives 9, 19, 29, 59, 89, 569, 899
  • Step 1, ending 0.90 gives 9.90, 14.90, 60.90, 99.90
  • Step 5, ending 4 gives 24, 29, 124, 129, 134
  • Step 0.50, ending 0.40 gives 4.40, 4.90, 9.40, 9.90
  • Step 100, ending 99 gives 599, 1299, 2499

The ending must stay below the step, otherwise it has no visible effect. A step of 1 with an ending of 9 simply produces every whole number.

The tier is picked from the original price

To stop a product sitting just under a bound from jumping into a much coarser band, the tier used is the one matching the product’s current price, not the computed price. An item at 19.90 therefore stays on the low price tier even if the increase pushes it above 20.

The trade-off between readability and accuracy

This is the most important point to grasp before launching a campaign. The coarser the rounding ladder, the further the actual change drifts from the requested percentage.

Take a 3 % increase on a product priced 59. The raw computed price is 60.77. Depending on the ladder:

  • Step 1, ending 0.90 gives 60.90, that is +3.2 %
  • Step 5, ending 4 gives 64, that is +8.5 %
  • Step 10, ending 9 gives 69, that is +16.9 %

No plugin can get around this arithmetic: if you insist on whole numbers ending in 9, the minimum gap between two prices is 10, which represents 17 % at 59. The plugin does not hide that fact, it makes it visible before writing anything through the simulator, the Change column in the preview and the per campaign ceiling.

A simple rule: the step must stay small relative to the prices in the band. A step of 1 on prices between 20 and 100 produces gaps of 1 to 5 %, which is consistent with annual inflation. A step of 10 on the same band is not.

Presets

Five presets fill the tier table in one click from the Rounding rules tab.

  • Balanced: the default setting. Up to 10 step 0.50 ending 0.40, up to 100 step 1 ending 0.90, up to 300 step 5 ending 4, above that step 10 ending 9. The actual change stays between 2 and 5 % for a 3 % target.
  • Whole numbers ending in 9: up to 100 and above, step 10 ending 9. You get exactly 59, 89, 569, 899. The drift on low prices is significant.
  • Whole numbers ending in 4 or 9: step 5 ending 4 below 100, step 10 ending 9 above. A common retail compromise.
  • Decimals ending in .90: step 1 ending 0.90 below 100, step 10 ending 9.90 above.
  • No charm rounding: step 0.01 ending 0. The percentage is applied to the cent.

Presets are only a starting point. You can add, remove or edit tiers freely, then save.

Rounding direction and guaranteed increase

Direction

  • Closest charm price: the recommended behaviour. The computed price moves to the nearest value of its tier, above or below.
  • Always up: the price always moves to the next value up. Margins are protected but the actual increases often exceed the target.
  • Always down: the price moves to the next value down. Reserve this for price reductions.

Guaranteed increase

With the closest direction, a small percentage can be entirely absorbed by rounding. A 3 % increase on 59 gives 60.77, and the closest price on a ladder with a step of 10 is still 59: the price does not move.

The option Never let rounding cancel the increase fixes this case by moving to the next value as long as the result stays at or below the starting price. It only acts on positive percentages. For a price reduction, uncheck it.

Rounding on the gross price or on the stored price

WooCommerce stores prices net or gross depending on the Enter prices with tax setting. If your shop stores net prices and displays gross prices, rounding the stored value produces nothing readable for the customer: 49.17 net displayed with 20 % VAT gives 59.00 gross, but 49.00 net gives 58.80 gross.

The Round on setting offers two behaviours:

  • The price the customer sees, tax included: the plugin converts the stored price to gross using the product tax class, applies the rounding to that value, then converts back to net with four decimals before saving. This is the default.
  • The stored price: rounding applies directly to the value held in the database, with no conversion.

If your shop already stores gross prices, or if tax is disabled, both settings produce the same result. Products marked as non-taxable go through no conversion.

Building a campaign

Increase card

  • Campaign name: optional, a timestamped name is generated if you leave it empty.
  • Percentage: positive for an increase, negative for a decrease. Two decimals accepted.
  • Sale prices: see the dedicated section below.
  • Skip a product when the actual change exceeds X %: the main safeguard. With a 3 % target and a 6 % ceiling, any product whose rounding would produce an increase above 6 % is left out of the campaign, with the reason shown in the preview. Leave the field empty to disable this check.

Scope card

  • Categories to include: leave empty to handle the whole catalogue. Child categories of the selected ones are included automatically.
  • Categories to exclude: takes precedence over inclusion, child categories included.
  • Tags: restricts to products carrying one of the selected tags.
  • Product types: simple, variable, external, grouped. Ticking variable handles the variations, not the parent product which has no price of its own.
  • Product status: published, draft, private, pending. For variations, the parent product status is the one evaluated.
  • Regular price between: two optional bounds evaluated on the stored regular price.
  • Skip products currently on sale: leaves out products with a sale price set.
  • Exclude these IDs or SKUs and Restrict to these IDs or SKUs: free lists separated by commas, spaces or line breaks. SKUs are resolved to identifiers at selection time. On a variable product, entering the parent ID covers all its variations.

Rounding card

By default the campaign uses the global rules, recalled at the top of the card. Tick Override the global rules for this campaign to adjust the direction, the guaranteed increase and the calculation base for this campaign only. The tiers themselves stay those of the global settings.

The box On rollback, skip products edited after the campaign was applied drives the rollback behaviour. Leave it ticked in the vast majority of cases.

Sale prices

Four modes are available. They only apply to products that actually have a sale price set.

  • Recompute and keep the same discount rate: the default mode. A product priced 100 shown at 80 keeps its 20 % discount after the increase. The new sale price also goes through rounding.
  • Apply the same percentage: the sale price receives exactly the same treatment as the regular price.
  • Leave untouched: the sale price stays strictly unchanged. The displayed discount therefore grows mechanically.
  • Remove the sale price: the sale price is removed, along with its start and end dates.

In every case, if a new sale price would reach or exceed the new regular price, it is removed automatically to avoid an inconsistency on the shop front.

Preview and apply

The Preview the new prices button triggers three successive operations, with a progress bar:

  1. Selection of the products matching the scope and recording of the queue.
  2. Computation of the new price of every row, in batches.
  3. Display of the table and the statistics.

For each row the table shows the product with a link to its edit screen, the SKU, the current price, the new price, the actual percentage change, the sale price before and after, and the status. Rows left out carry the skipped status and a reason: free product, no regular price, price already at the target value, or change above the allowed limit.

The Load 50 more rows button paginates the table. Download the CSV exports the whole campaign, skipped rows included, which allows an offline review or a sign-off by a third party.

As long as you have not clicked Apply to the catalogue, no price has been modified. The campaign stays available in the history with the Ready to apply status and can be applied later.

Application runs in batches through the WooCommerce product API, which guarantees the update of the displayed price, the internal lookup table and the caches. After each batch, the affected variable products are resynchronised so the minimum and maximum prices shown in the shop stay correct.

Rolling a campaign back

From the History screen, a campaign with the Applied status offers a Roll back button. Restoration runs in batches and returns every product to its original regular price and sale price.

If the safety option was active when the campaign was created, each product is checked before restoration: if its current price no longer matches the price applied by the campaign, the row is left aside with an explicit message. This avoids overwriting a manual change made in the meantime.

Deleting a campaign also erases its rollback data. A campaign that has been applied then deleted can no longer be rolled back.

WP-CLI commands

Four commands cover the same journey without a browser, which suits very large catalogues and deployment scripts.

wp df-inflation preview --percent=3 --categories=15,22
wp df-inflation apply --campaign=12 --yes
wp df-inflation apply --percent=4.5 --types=simple,variable --sale=ratio --yes
wp df-inflation revert --campaign=12 --yes
wp df-inflation campaigns

Available options: --percent, --name, --categories, --types, --sale (keep, percent, ratio or remove), --campaign and --yes. The preview command builds the campaign and prints the statistics without writing anything, and returns the identifier to reuse with apply.

Global settings

  • Price tiers: the table described above, with the add and remove buttons and the presets.
  • Direction and Guarantee the increase: default values offered on every new campaign.
  • Round on: gross or stored price calculation base.
  • Batch size: number of products handled per request, from 1 to 200. The default of 25 suits most hosting. Drop to 10 if you hit an execution timeout, raise to 50 or 100 on a dedicated server.
  • Uninstall: when the box is ticked, removing the plugin erases both tables and the options. Unticked, campaign data survives a reinstall.

Customisation for developers

Two filters let you step into the engine behaviour.

// Adjust a rounded price.
add_filter( 'df_inflation_rounded_price', function ( $result, $raw_price, $tier ) {
    return $result;
}, 10, 3 );

// Modify the list of products selected by a campaign.
add_filter( 'df_inflation_scope_rows', function ( $rows, $filters ) {
    return $rows;
}, 10, 2 );

Every admin action requires the manage_woocommerce capability. Ajax requests are protected by a nonce and check that capability server side.

Troubleshooting

No product matches the scope

Check that the ticked product types match your catalogue and that the targeted products have a regular price set. A variable product where only the variations carry a price requires the variable type to be ticked, not the simple type.

The progress bar stalls

Lower the batch size in the settings, then start again. A batch of 10 products is enough on the most constrained hosting. The browser console shows the detail of the failed request.

The new prices do not show in the shop

Clear the cache of your caching plugin and the server cache. The plugin purges the WooCommerce transients of the modified products but has no control over a third party page cache.

Variable product prices look inconsistent

The minimum and maximum prices shown on the parent page come from a WooCommerce synchronisation. The plugin triggers it after each batch. If a gap remains, the WooCommerce, Status, Tools, Clear transients tool forces a full recalculation.

An actual change far above the target

That is the expected behaviour on a coarse ladder. Fill in the per campaign ceiling to leave those products out, or add a finer tier on the price band concerned.

Uninstalling

Deactivating the plugin removes nothing: campaigns and rollback data stay in the database. A full deletion from the plugin list triggers the cleanup only if the matching option was ticked in the settings before the deletion.

Was this page helpful?

Still stuck? Contact support