CS-Cart Add-on · Documentation ·

CS-Cart GroupLock
User Group Visibility Control

CS-Cart's user group system handles categories, products, and pages — but stops short on menus, and gives you no control over what happens when the wrong user hits a restricted URL. GroupLock closes both gaps without touching a single core file.

Version 2.8 CS-Cart 4.x · Ultimate · Multi-Vendor Hook-based — no core edits

01 What it does

GroupLock works directly on top of CS-Cart's native user group system — no new concepts, no parallel infrastructure. The same user groups you already manage in Customers → User groups are now enforced everywhere.

🔒
Menu visibility by user group
Show or hide any storefront navigation menu item based on user group membership or sign-in status. CS-Cart has zero native support for this — GroupLock adds it via the top_menu_form_post hook.
⚙️
Configurable fallback per rule
Choose what happens when a user outside the allowed groups hits a restricted item: hide it entirely, redirect to sign-in, or show a custom access-denied message. Per rule, not globally.
👥
Multi-group rules
One rule, multiple allowed groups. A product visible to both Wholesale and VIP Members is a single rule — not two workarounds or duplicate entries.
📂
Categories, products, pages, menus
Apply rules to any storefront element: navigation menu items, categories, individual products, and CMS pages — all managed from a single admin panel.
🛡️
URL protection
Even if a user knows the direct URL to a restricted category or product, GroupLock enforces access at query level — not just in the UI — via injected SQL conditions.
🔗
Native architecture
Three CS-Cart hooks. No core file edits. No new group types. Rules stored in two lightweight tables. Upgrade-safe by design — no cache flush required after saving a rule.

02 What GroupLock adds vs. CS-Cart core

CS-Cart's native user group system is solid for catalog visibility. GroupLock makes it complete.

FeatureCS-Cart CoreWith GroupLock
Category visibility by user group✓ Native✓ + configurable fallback
Product visibility by user group✓ Native✓ + configurable fallback
CMS page visibility by user group✓ Native✓ + configurable fallback
Menu item visibility by user group✗ Not supported✓ Full control
Guest → sign-in redirect on restricted URL✓ Native
Registered user, wrong group → outcome✗ Silent 404✓ Configurable
Custom access-denied message✗ Not supported✓ Per rule
Multiple user groups per rule✗ Not supported✓ Per rule
No core file modifications✓ Hook-based only

03 Requirements

RequirementValueNotes
CS-Cart core version4.xTested on CS-Cart 4.13.1 through 4.20.x
Supported editionsCS-Cart, Ultimate, Multi-VendorWorks identically on all editions
User groupsExisting groups requiredCreate groups first at Customers → User groups before adding rules
DatabaseMySQL / MariaDBCreates two lightweight tables: ?:gl_rules and ?:gl_rule_groups
Core file editsNoneHook-based only — upgrade-safe

04 Installation

1

Purchase and download

Get GroupLock from the CS-Cart Marketplace and download the .zip archive.

2

Install via Admin Panel

Go to Add-ons → Manage Add-ons → +, select the downloaded .zip and click Upload & Install. GroupLock creates its two database tables automatically.

3

Verify user groups exist

Navigate to Customers → User groups and confirm the groups you want to use in rules are active. GroupLock cannot create groups — it uses your existing ones.

4

Configure default fallback

Go to Add-ons → Manage Add-ons → GroupLock → Settings and set your store-wide default fallback behavior. Individual rules can override this per item.

5

Add your first rule

Navigate to Website → GroupLock and click Add rule. Select the item type, the specific item, the allowed user groups, and the fallback. Save — the rule takes effect immediately on the next page render.

Rules apply on page render — no cache flush required after saving. Changes are live immediately.

05 Settings

All settings at Add-ons → Manage Add-ons → GroupLock → Settings.

SettingDefaultDescription
Default fallback behaviorHideWhat happens when a user outside the allowed groups accesses a restricted item. Applied to all rules unless the rule sets its own fallback. Options: Hide, Redirect to sign-in, Show custom message.
Custom access-denied messageThis content is restricted to specific user groups.The message shown when a rule's fallback is set to "Show custom message". Supports plain text.
Protect category URLsYesEnforce GroupLock rules when a restricted category URL is accessed directly — not just in listings.
Protect product URLsYesEnforce GroupLock rules when a restricted product URL is accessed directly.

06 Managing rules

Navigate to Website → GroupLock to view and manage all visibility rules. Each rule defines:

FieldDescription
Item typeWhat the rule applies to: Navigation menu item, Category, Product, or CMS page.
ItemThe specific menu item, category, product, or page. Selected via CS-Cart's native pickers for categories and products; dropdown for menu items.
Allowed user groupsOne or more user groups that are permitted to see this item. Users in at least one of the selected groups get access. Everyone else hits the fallback.
Fallback for other usersWhat to do when a user outside the allowed groups encounters this item. Overrides the default setting per rule.
StatusActive or Disabled. Disabled rules are ignored — useful for testing without deleting.
ℹ️
An item with no rule is fully visible to everyone. GroupLock only restricts items that have an active rule assigned. There is no global "lock everything" mode — control is per item.

07 Fallback behavior

When a user outside the allowed groups encounters a restricted item, GroupLock applies one of three fallback actions — configurable per rule, with a store-wide default.

Hide
The item is removed from listings and navigation entirely. The user sees a clean storefront with no trace of the restricted content. Direct URL access is blocked — category and product pages return access denied.
Redirect to sign-in
The user is redirected to CS-Cart's sign-in page. Useful for content available to registered users — prompts guests to log in. For menu items, the link is overridden to point to the sign-in page.
Show custom message
The restricted category or product page renders a custom access-denied message instead of the content. The message text is set in Settings. Useful for B2B catalogs where users know the restriction exists.

08 Rule types

GroupLock supports four item types. Each is handled at the appropriate CS-Cart hook point.

Navigation menu item
Enforced via top_menu_form_post hook before menu render. CS-Cart has no native group support for menus — this is GroupLock's most unique feature. Identify items by selecting from the menu dropdown in the rule form.
Category
Enforced via get_categories hook — restricted categories are excluded at SQL level with a NOT IN condition. Direct URL access is also blocked when Protect category URLs is enabled.
Product
Enforced via get_products hook — restricted products are excluded at SQL level. Direct URL access blocked when Protect product URLs is enabled. Works alongside CS-Cart's native product user group filtering.
CMS page
Enforced at the frontend page controller level. Restricted CMS pages apply the configured fallback when a user outside the allowed groups attempts to access them. Identified by page ID (visible in the URL when editing a page in the admin).
ℹ️
Category and product rules inject NOT IN (?n) conditions directly into CS-Cart's SQL queries — restrictions are enforced at the database level, not filtered in PHP after retrieval. There is no performance overhead proportional to catalog size.

09 Multi-Vendor support

GroupLock works identically on CS-Cart Multi-Vendor. The storefront controllers are the same, the user group system is the same, and the same gaps exist across all vendor storefronts.

AspectDetails
Menu visibilityMenu rules apply across all vendor storefronts without additional configuration.
Category / product rulesRules are scoped by company_id internally. A rule set for the root store does not bleed into vendor storefronts.
Vendor-type user groupsVendor privilege user groups (used for backend vendor panel access) are separate from customer-facing groups and are not affected by GroupLock rules.
Admin accessGroupLock is managed from the root admin panel. Vendors do not have access to GroupLock rule management.

10 Use cases

B2B and wholesale stores

Registered wholesalers sign in and see pricing, products, and navigation sections that guests never reach. Create rules that hide your wholesale catalog categories from guests and redirect non-wholesale registered users to a sign-in or contact page. The menu reflects their group from the moment they sign in — no extra logic, no theme hacks.

How to hide a CS-Cart menu item for guests

Go to Website → GroupLock → Add rule. Set Item type to Navigation menu item, select the menu and item from the dropdown, select your registered customer group(s) as the allowed groups, set Fallback to Hide. Save. Guests will no longer see the menu item — registered users in the allowed groups see it normally.

How to redirect guests to sign-in on restricted categories

Add a rule with Item type Category, select the category, set the allowed groups to your registered/wholesale group, and set Fallback to Redirect to sign-in. Enable Protect category URLs in settings. Guests who browse to the category URL are redirected to the CS-Cart sign-in page automatically.

Tiered customer access (VIP, Standard, Guest)

Create rules that show exclusive categories and products only to your VIP Members group, standard catalog to all registered users, and a public subset to guests. Each group gets a clean, relevant storefront — not a storefront full of 404s and dead links. Use the "Show custom message" fallback on VIP pages so registered non-VIP users understand why content is restricted.

Member-only or private catalogs

Apply GroupLock rules to all catalog categories with the allowed group set to your registered customer group. Guests hitting any product or category URL are redirected to sign in. Registered users in the wrong group see the custom message. The rule map is cached per request — no repeated database queries per page.

Ready to take control of your storefront visibility?

Get GroupLock on the CS-Cart Marketplace — hook-based, no core edits, live immediately.

Get on CS-Cart Marketplace ↗

11 FAQ

Does CS-Cart support user group visibility for navigation menus natively?
No. CS-Cart's native user group system controls categories, products, and CMS pages — but has no support for storefront navigation menus. GroupLock adds this via the top_menu_form_post hook, which fires before the menu is rendered.
What happens to a registered user in the wrong group when they hit a restricted URL?
Without GroupLock, CS-Cart shows a silent 404. With GroupLock, you choose: hide the item from listings, redirect to the sign-in page, or display a custom access-denied message — configurable per rule.
Can one rule apply to multiple user groups?
Yes. Each rule accepts multiple allowed user groups. A product visible to both Wholesale and VIP Members is one rule — users in at least one of the selected groups get access.
Does GroupLock modify CS-Cart core files?
No. GroupLock uses CS-Cart's native hook system exclusively — top_menu_form_post, get_categories, and get_products. No core files are modified. It is upgrade-safe by design.
Are restrictions enforced at the URL level or just in listings?
Both. Categories and products are excluded from listings at SQL level via NOT IN conditions. When Protect category URLs and Protect product URLs are enabled, direct URL access is also blocked — the fallback applies there too.
Does GroupLock work with CS-Cart Multi-Vendor?
Yes. GroupLock works identically on CS-Cart Multi-Vendor. Rules are scoped by company internally. Vendor-type user groups used for backend panel access are separate and are not affected.
Do I need to flush the CS-Cart cache after saving a rule?
No. Rules apply on page render — the rule map is cached per request in the Registry, not in CS-Cart's block cache. Changes are live immediately after saving.
What happens if I uninstall GroupLock?
Uninstalling removes both tables (?:gl_rules and ?:gl_rule_groups) and all stored rules. The storefront returns to default CS-Cart behavior — no residual effect on menus, categories, or products.