Conditional Add to Cart for WooCommerce source code
By Nabil Lemsieh, on WordPress.org since 2020. 600+ active installs.
Conditionally hide, disable, customize, or replace the WooCommerce Add to Cart button — no code required. Below is its source code for every one of its 13 releases, what changed in the latest one, and how often it ships.
What changed in 1.4.0
Released Nov 25, 2026, 4 months after 1.3.0- Improved: “Replace Button” action now uses a rich content editor (WYSIWYG) with formatting toolbar instead of a plain HTML textarea
- Various tweaks
10 files changed since 1.3.0: 10 modified, 0 added, 0 removed.
- assets/css/main.css modified, +1,449 bytes
- assets/css/settings.css modified, +2,168 bytes
- assets/js/settings.js modified, +2,024 bytes
- conditional-add-to-cart.php modified, same size
- includes/Admin.php modified, +1,779 bytes
- includes/Front.php modified, +32 bytes
- includes/Plugin.php modified, same size
- readme.txt modified, +201 bytes
- templates/action-rule.php modified, +553 bytes
- templates/pro-upgrade-sidebar.php modified, +254 bytes
Release history
13 releases since April 2020- 1.4.0 Nov 25, 2026 Improved: “Replace Button” action now uses a rich content editor (WYSIWYG) with formatting toolbar instead of a plain HTML textarea
- 1.3.0 Jul 9, 2026 New: Product Tag condition — target products by WooCommerce product tags
- 1.2.1 May 25, 2026 Various admin UI fixes
- 1.2.0 May 25, 2026
- 1.0.0 Apr 4, 2026 New: Multiple country selection with searchable dropdown