PriceTrim – Percentage Discount for WooCommerce

Description

WooCommerce only lets you enter a sale price. If you want to take 30% off, you have to work out the price yourself. This plugin adds a Discount (%) field under the sale price and does the maths for you.

The result is saved in WooCommerce’s own sale price field. Your theme, cart, coupons, product feeds and reports see an ordinary sale price, the same as if you had typed it in.

What it does

  • Works on simple and external products, and on each variation of a variable product.
  • The sale price updates while you type the percentage.
  • The percentage is saved with the product, so it is still there next time you open it.
  • If you change the regular price, the sale price follows. 30% off $100 becomes 30% off $150.
  • The Variations tab gets three extra bulk actions to set or remove a percentage on every variation at once.

Good to know

  • If a product already has a sale price you typed yourself, the plugin warns you before replacing it. Nothing changes until you save.
  • While a percentage is set, the sale price field is locked. Clear the percentage if you want to type a price by hand.
  • Changing the regular price from Quick Edit, bulk edit, a CSV import or the REST API also updates the sale price. If that same change sets a sale price too, the plugin leaves it alone, and the product editor lets you apply the percentage again.
  • Prices are rounded half up to the number of decimals set in WooCommerce. 19.99 with 15% off is 16.99.
  • Nothing is loaded on your store’s front end. There is no settings page, and the plugin does not connect to any outside service.
  • Uninstalling deletes the saved percentages but keeps the sale prices, so your customers keep paying the same.

Compatibility

  • Compatible with HPOS (High-Performance Order Storage).
  • Classic product editor only. WooCommerce’s block-based product editor was experimental and was removed in WooCommerce 11.0.
  • Grouped products have no price of their own, so there is nothing to discount.
  • Translation ready.
  • With Polylang, each language keeps its own percentage. WPML and Polylang for WooCommerce have not been tested yet.

Screenshots

Installation

  1. Go to Plugins > Add New, search for “PriceTrim” and install it. You can also upload the ZIP file from Plugins > Add New > Upload Plugin.
  2. Activate it. WooCommerce has to be active.
  3. That’s it. There is nothing to configure.

Simple products

  1. Edit a product and go to Product data > General.
  2. Enter the regular price, then a percentage in Discount (%), for example 30 or 12.5.
  3. Click Update. To remove the discount, empty the field (or enter 0) and update again.

Variable products

Each variation has its own Discount (%) field in the Variations tab. Fill it in and click Save changes.

To change all variations at once, use the Bulk actions menu in the same tab:

  • “Apply discount to variations without a discount” only touches variations that have no discount and no sale price yet.
  • “Apply discount to all variations” replaces whatever discount or sale price they had.
  • “Remove discount from all variations” removes the percentage and the sale prices it calculated. Sale prices you typed by hand are kept.

Bulk actions affect every variation of the product, not only the ones shown on the current page.

FAQ

Where is the discounted price stored?

In WooCommerce’s normal sale price field. The plugin also stores the percentage, and a copy of the price it calculated so it can tell if someone changed the sale price later.

What happens if I deactivate or delete the plugin?

Your sale prices stay as they are. Deactivating keeps the percentages too. Deleting the plugin removes the percentages and nothing else.

Can I use it with scheduled sales?

Yes. Set the dates with WooCommerce’s Schedule link as usual. The plugin only calculates the price.

Which percentages can I use?

Anything above 0 and below 100, with up to two decimals. 12.5 and 12,5 both work. The resulting sale price has to be above 0 and below the regular price.

How are prices rounded?

Half up, to the number of decimals in WooCommerce > Settings > General. With two decimals, 9.99 with 15% off is 8.49 (8.4915), and 1.15 with 50% off is 0.58 (0.575).

Can I set the percentage from Quick Edit, a CSV import or the REST API?

No, the field is only in the product editor. But if any of those changes the regular price of a discounted product, the sale price is recalculated with the saved percentage.

Does it change anything customers see?

No. Customers see WooCommerce’s usual sale price, with the regular price crossed out.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“PriceTrim – Percentage Discount for WooCommerce” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • First release.