This plugin improves the way WooCommerce manages and displays product sale labels as follows:
- Shows the calculated discount percentage taking in account the product regular and sale prices.
- Displays the lowest/highest discount percentage for all the variations of a product.
- Ensures the sale label is displayed only if the sale percentage reaches a minimum value, defined as a WooCommerce custom configuration setting (10% by default).
- Ensures performance by recalculating and saving the products sale percentage only when its regular price or sale price is modified.
- Provides a wp-cli command to force the recalculation of the sale percentage for a single product, several or all products in the shop.
- Is compatible with WooCommerce Advanced Bulk Edit plugin.
- Open your WordPress installation root path in the terminal.
git submodule add --name sale-percentage -- git@github.com:netzstrategen/woocommerce-sale-percentage.git wp-content/plugins/sale-percentage
- Activate the plugin:
wp plugin activate sale-percentage
This plugin provides a wp-cli command to force the recalculation of the sale percentage for a single product, several or all products in the shop.
Usage: wp sale-percentage refresh [<product-ids-list> | --all]
Examples:
wp sale-percentage refresh 2165, 2166, 2167
wp sale-percentage refresh --all
Any kind of contribution is very welcome!
Please, be sure to read our Code of Conduct before start contributing.
If you notice something wrong please open an issue or create a Pull Request or just send an email to tech@netztsrategen.com. If you want to warn me about an important security vulnerability, please use the GitHub Security page.
Requirements:
Setup steps:
git clone git@github.com:netzstrategen/woocommerce-sale-percentage.git
cd woocommerce-sale-percentage
npm install
npm run build
npm run serve
·Builds all assets and watches for changes. Alias forgulp watch
.npm run build
· Builds all the assets. Alias forgulp build
.