定制 aoropeza/customerpartner 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

aoropeza/customerpartner

Composer 安装命令:

composer require aoropeza/customerpartner

包简介

Module for managing Customer Partners and specific login flows.

README 文档

README

This module enables the creation of unique Partner URLs that facilitate the automatic assignment of visitors to specific Customer Groups upon registration or login.

Business Context

The core function of this module is to establish a 1:1 mapping between a specific URL and a Magento Customer Group.

Example Scenario:

  • Partner A (e.g., eBay): You create a partner entry with URL key ebay linked to the "eBay Customers" group.
    • URL: http://yourstore.com/partner/ebay
    • Result: Any user registering or logging in via this URL is assigned to the "eBay Customers" group.
  • Partner B (e.g., Amazon): You create a partner entry with URL key amazon linked to the "Amazon Customers" group.
    • URL: http://yourstore.com/partner/amazon
    • Result: Any user registering or logging in via this URL is assigned to the "Amazon Customers" group.

Key Features:

  1. URL Registration: Administrators can register specific URL keys (e.g., ebay, amazon).
  2. Group Assignment:
    • New Users: If a visitor registers an account after visiting a partner URL, they are immediately assigned to the linked Customer Group.
    • Existing Users: If an existing customer logs in via a partner URL, their account is updated to belong to the linked Customer Group.
  3. Partner Specificity: Each URL is unique to a specific partner and maps to a unique Customer Group context.

Note: This module handles the assignment logic only. Any specific offers, pricing, or restrictions associated with the Customer Group must be configured separately using standard Magento features (e.g., Cart Price Rules, Catalog Price Rules).

Installation

Composer

To install the module via Composer:

composer require aoropeza/customerpartner
bin/magento module:enable Aoropeza_CustomerPartner
bin/magento setup:upgrade
bin/magento setup:di:compile

Usage

Admin Configuration

  1. Go to the Magento Admin Panel.
  2. Navigate to the Aoropeza Customer Partner grid.
  3. Create New Partner:
    • Name: The name of the partner (e.g., "eBay").
    • URL Key: The unique URL segment (e.g., ebay).
    • Customer Group: The specific group to assign (e.g., "eBay Customers").
    • Is Active: Enable/Disable the link.

Frontend Flow

  1. A user accesses the partner URL: http://yourstore.com/partner/{url_key}.
  2. The module sets a tracking cookie for that specific partner.
  3. Registration: When the user creates an account, the system reads the cookie and assigns the new account to the partner's Customer Group.
  4. Login: If a user logs in, the system reads the cookie and updates their existing account to the partner's Customer Group.

API Reference

The module exposes standard REST endpoints for managing Customer Partner entities.

Base URL

/rest/V1/aoropeza-customerpartner/customer_partner

Endpoints

1. Create Customer Partner

POST /rest/V1/aoropeza-customerpartner/customer_partner

Request Payload
{
  "customerPartner": {
    "name": "Summer VIP",
    "url_key": "summer-vip",
    "customer_group_id": 4,
    "is_active": 1,
    "description": "Exclusive access for summer partners"
  }
}
Response Example
{
    "entity_id": 15,
    "name": "Summer VIP",
    "url_key": "summer-vip",
    "customer_group_id": 4,
    "is_active": 1,
    "description": "Exclusive access for summer partners",
    "created": "2026-01-12 10:00:00",
    "updated": "2026-01-12 10:00:00"
}

2. Update Customer Partner

PUT /rest/V1/aoropeza-customerpartner/customer_partner/{id}

Request Payload
{
  "customerPartner": {
    "name": "Summer VIP Updated",
    "is_active": 0
  }
}
Response Example
{
    "entity_id": 15,
    "name": "Summer VIP Updated",
    "url_key": "summer-vip",
    "customer_group_id": 4,
    "is_active": 0,
    "description": "Exclusive access for summer partners",
    "created": "2026-01-12 10:00:00",
    "updated": "2026-01-12 12:30:00"
}

3. Get Customer Partner Details

GET /rest/V1/aoropeza-customerpartner/customer_partner/{id}

Request Payload

None

Response Example
{
    "entity_id": 15,
    "name": "Summer VIP Updated",
    "url_key": "summer-vip",
    "customer_group_id": 4,
    "is_active": 0,
    "description": "Exclusive access for summer partners",
    "created": "2026-01-12 10:00:00",
    "updated": "2026-01-12 12:30:00"
}

4. Search/List Customer Partners

GET /rest/V1/aoropeza-customerpartner/customer_partner/search

Request Payload

Parameters passed via query string (SearchCriteria). Example: ?searchCriteria[filter_groups][0][filters][0][field]=is_active&searchCriteria[filter_groups][0][filters][0][value]=1

Response Example
{
    "items": [
        {
            "entity_id": 15,
            "name": "Summer VIP",
            "url_key": "summer-vip",
            "customer_group_id": 4,
            "is_active": 1,
            "description": "Exclusive access for summer partners",
            "created": "2026-01-12 10:00:00",
            "updated": "2026-01-12 10:00:00"
        }
    ],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "is_active",
                        "value": "1",
                        "condition_type": "eq"
                    }
                ]
            }
        ]
    },
    "total_count": 1
}

5. Delete Customer Partner

DELETE /rest/V1/aoropeza-customerpartner/customer_partner/{id}

Request Payload

None

Response Example
true

aoropeza/customerpartner 适用场景与选型建议

aoropeza/customerpartner 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「customer」 「login」 「partner」 「b2b」 「magento2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 aoropeza/customerpartner 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-19