justbetter / magento2-customer-pricing

justbetter/magento2-customer-pricing

Customer specific pricing module for Magento 2

  • Vincent Boon
magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass MIT

JustBetter Customer Pricing

Magento 2 module that enables prices for specific customers.

Features

  • Allows for storing customer specific prices in the database via the API
  • Sets the customer specific prices on category and product pages
  • Sets the customer specific prices in the cart and checkout

Installation

composer require justbetter/magento2-customer-pricing
bin/magento setup:upgrade

How does it work?

Magento 2 provides a final price event (catalog_product_get_final_price) in which we can override the product price in the checkout / cart.

For the product and category pages we hook into the catalog_product_collection_load_after to set the final price of the products.

We store the customer prices in a database table called customer_pricing.

Updating Prices

This module provides an API endpoint for updating prices.

Make a POST request to: customer-pricing/{sku} with the following payload:

{
  "customerPrices": [
    {
      "customer_id": 10,
      "quantity": 10,
      "price": 9.99
    },
    {
      "customer_id": 20,
      "quantity": 1,
      "price": 8.99
    }
  ]
}

Current Limitations

Due to the simplicity of this module there are several limitations.
We accept non-breaking PR's to accept functionality.

Website / store specific pricing

This module currently does not support pricing for specific stores / websites because we do not store a website/store id with each price.

No adding/updating in the Magento 2 backend

It is currently only possible to view and delete customer specific prices in the backend.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
1.2.4 stable Fail Magento 2.4.7-2.4.9 Details 2026-01-27 10:49:05
1.2.3 stable Not tested Not yet tested Details 2025-07-18 06:25:30
1.2.2 stable Not tested Not yet tested Details 2024-10-02 09:13:12
1.2.1 stable Not tested Not yet tested Details 2024-08-02 10:44:18
1.2.0 stable Not tested Not yet tested Details 2024-07-19 13:27:24
1.1.2 stable Not tested Not yet tested Details 2024-05-31 10:48:29
1.1.1 stable Not tested Not yet tested Details 2024-03-01 11:04:56
1.1.0 stable Not tested Not yet tested Details 2024-02-01 14:39:04
1.0.4 stable Not tested Not yet tested Details 2024-01-17 07:11:41
1.0.3 stable Not tested Not yet tested Details 2023-07-25 09:12:29
1.0.2 stable Not tested Not yet tested Details 2023-07-10 14:18:17
1.0.1 stable Not tested Not yet tested Details 2023-06-26 11:10:14
1.0.0 stable Not tested Not yet tested Details 2023-06-22 09:21:40

Requires 5

Package Constraint
ext-json *
magento/module-catalog *
magento/module-customer *
magento/module-eav *
justbetter/magento2-core ^1.0

Requires-dev 2

Package Constraint
bitexpert/phpstan-magento ^0.11.0
phpstan/phpstan ^1.10

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Fail 16 4 errors, 12 warnings (ruleset: Magento2) — 3 auto-fixable with phpcbf
PHPMD Warning 1 1 rule violation (UnusedFormalParameter:1)
Cpd Pass 0
Composer validate Info 3 valid; 3 advisory notes (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 5 5
2.4.8 5 5
2.4.9 5 5

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
MIT
Authors

More from justbetter

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.