WP Manifestindependent plugin directory
manifest / ecommerce / woocommerce-sale-percentage

Sale Percentage

WooCommerce plugin to better manage and display product sale labels.

by netzstrategen · github.com/netzstrategen/woocommerce-sale-percentage · website

1stars
1forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/netzstrategen/woocommerce-sale-percentage/archive/refs/heads/master.zip

Readme

Sale Percentage

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.

:gear: How to Install

:warning: The plugin requires WooCommerce to be installed.

  1. Open your WordPress installation root path in the terminal.
  2. git submodule add --name sale-percentage -- git@github.com:netzstrategen/woocommerce-sale-percentage.git wp-content/plugins/sale-percentage
  3. Activate the plugin: wp plugin activate sale-percentage

:zap: WP CLI

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

:building_construction: How to Contribute

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.

:hammer_and_wrench: Dev Setup

Requirements:

Setup steps:

  1. git clone git@github.com:netzstrategen/woocommerce-sale-percentage.git
  2. cd woocommerce-sale-percentage
  3. npm install
  4. npm run build

Available Scripts

  • npm run serve ·Builds all assets and watches for changes. Alias for gulp watch.
  • npm run build · Builds all the assets. Alias for gulp build.

:page_facing_up: License

GPL-2.0 License © netzstrategen

Read the full README on GitHub →