承接 conneqt/module-customer-assortment 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

conneqt/module-customer-assortment

Composer 安装命令:

composer require conneqt/module-customer-assortment

包简介

N/A

README 文档

README

What this module does

conneqt/module-customer-assortment adds customer-specific product visibility to Magento 2.

In short, the module lets you assign products to a customer-specific assortment and then uses that assortment to:

  • filter catalog search results
  • block direct access to product detail pages when a product is not allowed
  • support guest visibility rules for selected products and categories
  • expose REST endpoints for synchronizing assortments from an external system
  • optionally keep product flags and parent-product relations in sync through Magento's message queue

This is useful when not every customer should see the same catalog, or when an ERP/PIM/integration decides which SKUs a customer may buy or search for.

How it works

At a high level, the module works in four layers:

  1. Assortment storage
    Customer-to-product assignments are stored in the conneqt_customer_assortment table declared in etc/db_schema.xml.

  2. Sync and maintenance
    The helpers behind the REST API create, update, remove, and check assortment rows. When enabled, they also publish product update messages so Magento can update derived product state asynchronously.

  3. Storefront enforcement
    Magento search and product-view flows are intercepted so shoppers only see products they are allowed to access.

  4. Admin and configuration
    The module adds configuration fields and a customer admin tab so assortment behavior can be controlled and reviewed from the backend.

Request flow overview

1. Assortment data is stored per customer

The main table is etc/db_schema.xml:

  • customer_id: the external/customer identifier used by the module
  • product_sku: the Magento SKU that belongs to the customer assortment
  • external_id: optional external reference from an upstream system
  • personal_sku: optional customer-specific alias that can be searched

The module also stores customer-specific search terms in conneqt_customer_search_query.

2. API calls or internal code update the assortment

The main write/read helpers are:

REST routes are declared in etc/webapi.xml, while dependency wiring for API implementations lives in etc/di.xml.

3. Product visibility is enforced on the storefront

The most important visibility flow is configured in etc/di.xml:

4. Search is extended with assortment-specific data

The module also extends Magento search behavior:

5. Queue consumers keep product metadata in sync

If automatic updates are enabled, Helper/ProductAdd.php publishes messages to the conneqt.assortment.product.update topic.

Queue configuration is defined in:

The queue handler Model/Queue/Handler/Handler.php can:

  • automatically toggle the customer_specific product attribute
  • automatically add parent products for configurable, bundle, and grouped products

Installation

Install the module with Composer:

composer require conneqt/module-customer-assortment

Then enable and upgrade Magento as usual:

bin/magento module:enable Conneqt_CustomerAssortment
bin/magento setup:upgrade
bin/magento cache:flush

If you use the asynchronous product update flow, make sure the Magento queue consumer for conneqt.assortment.product.update is running in your environment.

Requirements

  • PHP >= 8.1
  • magento/framework
  • magento/module-catalog-search ^102.0
  • cweagans/composer-patches
  • conneqt/m2-base >=1.0

These constraints are declared in composer.json.

Configuration

Configuration is available in the Magento admin at:

Stores → Configuration → Conneqt → Customer Assortment

The fields are declared in etc/adminhtml/system.xml.

Important settings

  • Customer Id Attribute
    Selects which customer attribute the module uses as the assortment identifier. This makes it possible to use an ERP/customer number instead of Magento's internal customer entity ID.

  • Automatically adjust customer specific
    When enabled, product visibility metadata is recalculated after assortment changes so products can be marked as customer-specific automatically.

  • Automatically add parent product to a customers assortment
    When enabled, parent products of assigned simple products can be added automatically through the queue handler.

  • No assortment full access
    Lets logged-in customers without any assortment rows see the full catalog. Guests are still handled by the guest visibility rules.

Product and category attributes added by this module

The data patches in Setup/Patch/Data create the attributes used by the visibility logic:

These attributes are part of the guest and customer-specific visibility checks performed in search and on the product detail page.

Admin UI

The module adds assortment-related admin UI for customer management:

Important files at a glance

FilePurpose
etc/db_schema.xmlDeclares the assortment and customer search query tables.
etc/di.xmlWires API preferences, Magento overrides, and plugins.
etc/webapi.xmlDeclares the REST endpoints for external integrations.
etc/adminhtml/system.xmlAdds the module configuration section in admin.
Helper/ProductAdd.phpMain entry point for inserting/updating assortment rows and publishing queue updates.
Helper/CustomerAssortment.phpReads current-customer assortment state from HTTP context and storage helpers.
Plugin/ElasticsearchPlugin.phpRestricts search results to allowed products and guest-visible items.
Plugin/ProductDetailBlockPlugin.phpBlocks direct PDP access for products outside the active shopper's assortment.
Model/Queue/Handler/Handler.phpProcesses async product updates after assortment changes.
view/adminhtml/ui_component/assortment_listing.xmlDefines the customer assortment grid in admin.

API reference

The REST API documentation has been moved to a separate file:

That file contains the endpoint list, request payloads, and response structure for:

  • add products
  • remove products
  • remove all products
  • get products
  • check whether a customer has a product

Limitations and notes

This module focuses on catalog search and direct product access. Some storefront areas may still need custom integration if they load products outside the standard search and product-view flows.

In particular, review and test:

  • custom product blocks or widgets
  • related products / upsells / cross-sells
  • layered navigation counts
  • configurable and grouped child-product visibility in custom themes
  • compatibility with third-party search, merchandising, or personalization modules

Also note that the module's customerId can be mapped to a custom customer attribute, so it does not have to match Magento's default internal customer entity ID.

conneqt/module-customer-assortment 适用场景与选型建议

conneqt/module-customer-assortment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.22k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 09 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 conneqt/module-customer-assortment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 conneqt/module-customer-assortment 我们能提供哪些服务?
定制开发 / 二次开发

基于 conneqt/module-customer-assortment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2023-09-18