
內容簡介
總結:Role Membership Access for WooCommerce 外掛讓您可以基於 WordPress 使用者角色來限制 WooCommerce 產品的可見性、購買、加入購物車、購物車及結帳權限。
1. 這個外掛可以做什麼?
- 使用「允許角色分類」(Products → Categories) 來限制訪問。
- 使用帶有進入模式的「產品允許角色」(Products → Edit Product) 來限制訪問。
- 防止未授權使用者:
- 查看商店/目錄中的受限產品(取決於佈景主題,通過過濾器強化)
- 將受限產品加入購物車
- 購買受限產品
- 如購物車中有受限產品,則無法完成結帳
2. 外掛提供了什麼特性?
- WooCommerce 設置選項卡:WooCommerce → 設置 → WooRole Access
- 每個分類角色限制
- 每個產品角色限制與進入模式(Inherit / Manual / Combine)
- 多個類別衝突策略選項(Union / Intersection / Priority Category)
- 未授權使用者的可選重定向
- 在產品標題上方顯示可靠的內聯通知(支持區塊主題)
問題與答案:
1. 使用 Role Membership Access for WooCommerce 可以做些什麼?
- 使用「允許角色分類」來限制訪問。
- 使用「產品允許角色」並設定進入模式來限制訪問。
- 防止未授權使用者查看受限產品、將受限產品加入購物車、購買受限產品、如果購物車中有受限產品則無法完成結帳。
2. 外掛提供哪些特性?
- WooCommerce 設置選項卡
- 每個分類角色限制
- 每個產品角色限制與進入模式
- 多個類別衝突策略選項
- 未授權使用者的可選重定向
- 在產品標題上方顯示內聯通知。
外掛標籤
開發者團隊
② 後台搜尋「Role Membership Access for WooCommerce」→ 直接安裝(推薦)
原文外掛簡介
Role Membership Access for WooCommerce lets you restrict WooCommerce product visibility, purchasing, add-to-cart, cart, and checkout access based on WordPress user roles.
You can:
* Restrict access using Category Allowed Roles (Products → Categories).
* Restrict access using Product Allowed Roles with Access Mode (Products → Edit Product).
* Prevent unauthorized users from:
– Viewing restricted products in the shop/catalog (theme dependent, hardened via filters)
– Adding restricted products to cart
– Purchasing restricted products
– Completing checkout if restricted products are in cart
The plugin provides:
* A WooCommerce Settings tab: WooCommerce → Settings → WooRole Access
* Per-category role restrictions
* Per-product role restrictions with Access Mode (Inherit / Manual / Combine)
* Multi-category conflict strategy options (Union / Intersection / Priority Category)
* Optional redirect for unauthorized users
* A reliable inline notice shown above product title (supports block themes)
Setup / Configuration
Step 1: Configure global plugin settings
Go to:
WooCommerce → Settings → WooRole Access
Available settings:
1. Restriction Message
– The message displayed when a user is blocked.
2. Redirect Unauthorized Users
– If enabled, blocked users will be redirected to the URL below.
3. Redirect URL
– Recommended: My Account page or a custom “Join Membership” page.
4. Multi-Category Strategy
– Determines behavior when a product belongs to multiple restricted categories:
– Union (OR): allowed roles from any restricted category (recommended default)
– Intersection (AND): user must match all restricted categories
– Priority Category: use only the product’s “Primary Category”
5. Default Primary Category (for Priority Strategy)
– Used as a default selection for products when Priority Strategy is enabled.
Step 2: Restrict categories (recommended first)
Go to:
Products → Categories → Add/Edit Category
Set:
Allowed Roles (multi-select)
Behavior:
* If a category has Allowed Roles set, products in that category are restricted depending on their Product Access Mode.
Step 3: Restrict individual products (when needed)
Go to:
Products → Edit Product → Product data → General
Fields:
1. Access Mode
– Inherit from Categories (default)
– Manual Override
– Combine (Manual + Categories)
2. Allowed Roles (Manual)
– Used only for Manual Override or Combine
3. Primary Category (for Priority Strategy)
– Used only when global Multi-Category Strategy = Priority Category
How Access Mode Works
Inherit from Categories
The product uses category Allowed Roles only.
* If no categories have restrictions, product is unrestricted.
Manual Override
The product ignores category restrictions and uses Allowed Roles (Manual) only.
Combine (Manual + Categories)
The product is accessible if the user matches either:
* Product manual roles OR
* Category roles
Multi-Category Strategy (Conflict Handling)
When a product belongs to multiple categories with different Allowed Roles:
1) Union (OR)
– Allowed roles are combined from all restricted categories.
– Prevents accidental lockouts. Recommended for most stores.
2) Intersection (AND)
– Allowed roles are the overlap of restricted category roles.
– Can lock products if categories disagree (use carefully).
3) Priority Category
– Only one category drives access.
– Select a Primary Category in product settings.
– Optionally set a Default Primary Category globally to reduce per-product setup.
Blocking Behavior
If a user is not authorized:
* Product may be hidden from catalog (theme dependent)
* User cannot add to cart
* User cannot proceed with checkout if restricted items are in the cart
* Notice is injected above the product title (block-theme friendly)
* Optional redirect can be enabled
Example: Restrict a Category to Subscriber Only
Go to Products → Categories
Edit the category (example: “Members Only”)
In Allowed Roles, select: subscriber
Save
All products in that category will be restricted based on their Access Mode:
– Inherit: category restriction applies
– Manual: product manual roles apply instead
– Combine: both apply
Example: Restrict a Product to Editor Only
Go to Products → Edit Product
Product Data → General
Access Mode: Manual Override
Allowed Roles (Manual): editor
Save
Result: only users with editor role can view/purchase.
Privacy Policy
Role Membership Access for WooCommerce does not collect, store, or transmit any personal data.
This plugin operates entirely within the WordPress and WooCommerce environment and uses existing user roles and product/category settings to control access.
No data is sent to external servers.
No tracking, analytics, or cookies are added by this plugin.
No personal or sensitive user information is stored outside of WordPress.
If you choose to use optional external links (such as PayPal or Buy Me a Coffee), you will be redirected to third-party services that operate under their own privacy policies.
For questions or concerns, please visit:
https://www.jrtwebsolutions.com
