beself/magento2-module-customer-enhancements

Magento 2 module that adds a B2B flag to customer groups and a favorite product type attribute for customers.

1.0.0 2025-08-25 06:49 UTC

This package is not auto-updated.

Last update: 2025-09-09 05:26:13 UTC


README

Overview

Magento 2 module that extends Customer and Customer Group entities with additional attributes, admin grid visibility, configuration-driven options, and frontend display.

Features

  • Customer Group

    • Adds a new column is_b2b (Yes/No) to distinguish B2B (distributor/wholesaler) groups.
    • Editable in the Customer Group form.
    • Displayed in the Customer Groups grid with Yes/No labels.
  • Customer Attribute

    • Adds a new attribute favorite_product_type.
    • Type: select field.
    • Options are managed from Stores → Configuration → Customers → Favorite Product Types.
    • Options can be entered as comma-separated or multi-line values.
    • Editable in Customer form.
    • Visible in Customers grid.
  • System Configuration

    • New group Favorite Product Types under Stores > Configuration > Customers > Customer Configuration.
    • Textarea field to define product types separated by commas.
    • frontend validation prevents invalid formats.
    • Configurable options are used by the customer attribute source model.
  • Frontend (Customer Account)

    • Dashboard block "Additional Information" displays:
      • Whether the logged-in customer belongs to a B2B group.
      • The customer’s favorite product type.

Installation

Via Composer

  1. Run the following commands in your Magento root directory:
    composer require beself/magento2-module-customer-enhancements
    bin/magento module:enable Beself_CustomerEnhancements
    bin/magento setup:upgrade

Manual Installation

  1. Create the directory: app/code/Beself/CustomerEnhancements
  2. Download and extract the module contents into the directory
  3. Run the following commands:
    bin/magento module:enable Beself_CustomerEnhancements
    bin/magento setup:upgrade

Usage

Admin

  • Customer Groups

    • Edit a group → toggle Is B2B.
    • Column visible in the groups grid.
  • Customers

    • Edit customer → choose Favorite Product Type.
    • Column visible in the customers grid.
  • Configuration

    • Navigate to Stores → Configuration → Customers → Customer Configuration -> Favorite Product Types.
    • Enter values separated by commas or new lines (e.g.):
      Cardio equipment, Weight training equipment, Yoga and Pilates
      

Frontend

  • Customer logs in → My Account → Dashboard:
    • Additional Information box shows B2B status and favorite product type.

Requirements

Software Version
Magento 2.4.6
PHP 8.1.27

License

This module is licensed under the MIT License.