PHPackages                             viraxpress/restriction - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. viraxpress/restriction

ActiveMagento2-module

viraxpress/restriction
======================

ViraXpress Restriction Extension for Magento2

1.0.0(1mo ago)00Apache-2.0PHPPHP ~8.1.0||~8.2.0||~8.3.0||~8.4.0

Since Apr 17Pushed todayCompare

[ Source](https://github.com/viraxpress/Restriction)[ Packagist](https://packagist.org/packages/viraxpress/restriction)[ RSS](/packages/viraxpress-restriction/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

ViraXpress Restriction (Magento 2)
==================================

[](#viraxpress-restriction-magento-2)

A Magento 2 extension to create flexible access restrictions for products, category pages, CMS pages, and CMS blocks, with customer group and store-scoped rules.

Description
-----------

[](#description)

`ViraXpress_Restriction` lets admins define restriction rules that control frontend user access and behavior based on:

- Customer group
- Store view(s)
- Date range (`start_at`, `end_at`)
- Restriction target types: products, categories, CMS pages, CMS blocks
- Response action: show an error message or redirect URL

Active restrictions apply in real-time via frontend event observers.

Features
--------

[](#features)

- Admin UI under Stores &gt; Manage Restriction &gt; Restriction Rule
- Enable/disable module globally via system configuration (`VX Restriction > General > Enable Manage Restriction`)
- Create/ edit/ delete rule records in grid UI
- Restrict by:
    - specific products
    - product categories (and filter product collections globally)
    - CMS pages
    - CMS blocks
- Add-to-cart blocking for restricted product rules

Compatibility
-------------

[](#compatibility)

- Magento 2.4.x

Installation
------------

[](#installation)

1. Install the extension via Composer:

    ```
    composer require viraxpress/restriction
    ```
2. Run the following commands from your Magento root directory:

    ```
    php bin/magento module:enable ViraXpress_Restriction
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    php bin/magento cache:flush
    ```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

Navigate to **Stores &gt; Configuration &gt; VX Restriction &gt; General** and set **Enable Manage Restriction** to `Yes`.

### Managing Restriction Rules

[](#managing-restriction-rules)

Go to **Stores &gt; Manage Restriction &gt; Restriction Rule** and click **Add New Restriction Rule**.

- Set a title, date range, store view, and customer group for the rule.
- Choose a response type — `Error Message` (with custom text) or `Redirect` (with a target URL).
- Enable **Restrict Products** and select specific products.
- Enable **Restrict Categories** to block access to category pages and filter their product collections.
- Enable **Restrict CMS Pages** or **Restrict CMS Blocks** to hide specific pages or blocks.

### How It Works

[](#how-it-works)

- On each frontend request, observers check if the current customer's group matches an active rule within its date range and store view scope.
- Exact product matches take priority over `all` wildcard matches.
- On a match, the user is either shown an error message or redirected to the configured URL.
- Disabling the module globally bypasses all observer checks without requiring rule deletion.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance95

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dfa4cf8adc10a78f5b538cdf399be5d1059c4cfecf5ca5e38e44351bcaf84367?d=identicon)[viraxpress](/maintainers/viraxpress)

---

Top Contributors

[![viraxpress](https://avatars.githubusercontent.com/u/179798477?v=4)](https://github.com/viraxpress "viraxpress (2 commits)")

### Embed Badge

![Health badge](/badges/viraxpress-restriction/health.svg)

```
[![Health](https://phpackages.com/badges/viraxpress-restriction/health.svg)](https://phpackages.com/packages/viraxpress-restriction)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
