Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/dannyportal/woocommerce-gated-code-item-checkout/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
A lightweight WooCommerce plugin that adds a single Access Code field to checkout when needed, and prevents customers from purchasing certain products unless a valid code is provided.
Built to be generic and reusable across any store/industry.
What it does
- Adds an Access Code field to checkout only if the cart contains restricted products.
- Lets store owners assign one or multiple allowed codes per product (one per line).
- Blocks checkout (order placement) unless the code matches every restricted product in the cart.
- Saves the used access code onto the order for admin visibility.
Requirements
- WordPress + WooCommerce installed and active.
Installation
- Create a folder:
wp-content/plugins/woocommerce-checkout-access-codes/ - Add this file inside it:
woocommerce-checkout-access-codes.php - Activate in WP Admin → Plugins.
Setup (Store Owner)
- Edit any product in WooCommerce.
- Go to Product Data → General.
- Find Checkout Access Codes.
- Enter one code per line. (Leave blank for unrestricted products.)
- Update the product.
How matching works
- Codes are normalized before comparison:
- trimmed
- multiple spaces collapsed
- converted to uppercase
Admin: where to see the code used
Open the order in WP Admin and you’ll see Access Code Used in the order details.
Notes / limitations
- This plugin blocks purchase at checkout (not at add-to-cart).
- A single code must be valid for all restricted products in the cart.
License
MIT (recommended) — add a LICENSE file if you want open-source friendly defaults.
Releases
1 release.
Tag
Published
WooCommerce
latest
Jan 12, 2026 9mo ago
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.