Download the PHP package orangecat/module-company-sales-rep without Composer

On this page you can find all versions of the php package orangecat/module-company-sales-rep. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package module-company-sales-rep

Orangecat_CompanySalesRep

Assigns a Magento admin user as a sales representative to a B2B company and displays their contact details on the customer account dashboard.

Module: Orangecat_CompanySalesRep Version: 1.0.0 License: OSL-3.0 Author: Oliverio Gombert [email protected]


Table of Contents

  1. Overview
  2. Theme Compatibility
  3. Requirements
  4. Installation
  5. What Gets Installed
  6. Configuration
  7. Store Admin Guide
  8. Company Member Guide (Frontend)
  9. Developer Guide
  10. REST API
  11. Frontend Routes Reference
  12. DevOps & Integrator Notes

Overview

Orangecat_CompanySalesRep extends Orangecat_Company to allow store admins to assign a designated admin user as the sales representative for each B2B company. Company members can then see their rep's name, email, telephone, and WhatsApp directly on the customer account dashboard.

The module handles:

Position in the Orangecat B2B Dependency Chain

Orangecat_Company and Magento_User must both be installed and enabled before this module.


Theme Compatibility

Theme Status Notes
Luma Supported Dedicated template sales_rep.phtml. Uses standard .box markup. Layout handle customer_account_index.xml.
Hyvä Supported Dedicated template sales_rep_hyva.phtml with Tailwind CSS card layout. Layout handle hyva_customer_account_index.xml.
Breeze Evolution Partial No dedicated Breeze layout. Falls back to the Luma template via customer_account_index.xml, which Breeze inherits. Functional but unstyled in Breeze card conventions. Add a breeze_customer_account_index.xml layout and a dedicated template to apply Breeze-native styling.

Requirements

Dependency Version / Notes
Magento 2.4.x
PHP >= 8.1
Orangecat_Company Must be enabled first
Magento_User Core admin user module (bundled with Magento)
magento/framework Bundled with Magento

Installation

Via Git Submodule (recommended for this project)

Enable the Module

Run inside the PHP container (reward shell):


What Gets Installed

Database Columns

This module does not create new tables. It adds columns to two existing tables.

mycompany (extended from Orangecat_Company)

Column Type Nullable Notes
sales_rep_id INT UNSIGNED Yes FK → admin_user.user_id. Set to NULL on admin user delete.

admin_user (core Magento table)

Column Type Nullable Notes
telephone VARCHAR(50) Yes Sales rep phone number, used for tel: links.
whatsapp VARCHAR(50) Yes Sales rep WhatsApp number, used for wa.me/ links.

EAV Attributes

None.

Data Patches

None. No default records, roles, or CMS pages are created.


Configuration

This module has no system configuration (no entries in core_config_data). All settings are per-entity.

Per-Company Setting

Field Storage Notes
Sales Representative mycompany.sales_rep_id Set in the company edit form under the General fieldset.

Per-Admin User Settings

Field Storage Notes
Telephone admin_user.telephone Set in the admin user edit form. Used for tel: links on frontend.
WhatsApp admin_user.whatsapp Set in the admin user edit form. Used for https://wa.me/ links on frontend.

Store Admin Guide

Assigning a Sales Representative to a Company

  1. Navigate to Companies > Companies (or the path defined by Orangecat_Company).
  2. Open a company record.
  3. In the General fieldset, locate the Sales Representative dropdown.
  4. Select the admin user to assign. The list shows all active admin users as "First Last (username)". Select -- Unassigned -- to remove a rep.
  5. Save the company.

The dropdown only lists currently active admin users. If an admin user is deactivated or deleted after assignment, sales_rep_id is automatically set to NULL (via the ON DELETE SET NULL foreign key constraint), and the sales rep card will no longer appear on the customer dashboard.

Adding Contact Details to an Admin User

  1. Navigate to System > Permissions > All Users.
  2. Open the admin user record.
  3. In the Account Information tab, locate the Telephone and WhatsApp fields added by this module.
  4. Enter the contact details and save.

These fields are optional. Only fields with values are rendered on the customer dashboard.


Company Member Guide (Frontend)

Sales Representative Card

Company members who are logged in can view their assigned sales representative's contact information on the My Account dashboard.

URL: /customer/account/

If a sales rep has been assigned to the company, a Sales Representative card is displayed alongside the standard account information blocks. The card shows:

Fields are only shown if they contain a value. The card does not appear if:


Developer Guide

Module Structure

Key Classes

Class Role
Block\Customer\Account\Dashboard\SalesRep Extends Template. Lazy-loads sales rep from session + company + admin_user. Exposes hasSalesRep(), getSalesRepName(), getSalesRepEmail(), getSalesRepTelephone(), getSalesRepWhatsApp().
Model\Source\AdminUsers Implements OptionSourceInterface. Returns all active admin users sorted by first name as [['value' => id, 'label' => 'First Last (username)']]. Includes an "-- Unassigned --" option with empty value.

SalesRep Block — Public Methods

Observers

None. This module registers no observers.

Plugins

Plugin Class Target Hook Purpose
Plugin\CompanyDataProviderPlugin Orangecat\Company\Ui\Component\Form\Company\DataProvider afterGetData Reads sales_rep_id from CompanyRepository and injects it into the company form data array.
Plugin\CompanyRepositoryPlugin Orangecat\Company\Api\CompanyRepositoryInterface beforeSave Reads sales_rep_id from the current HTTP request and sets it on the company object before persistence. Converts empty string to null.
Plugin\User\Edit\Tab\MainPlugin Magento\User\Block\User\Edit\Tab\Main afterGetForm Appends telephone and whatsapp text fields to the admin user edit form. Re-applies model data to populate saved values.

All three plugins are registered in etc/adminhtml/di.xml (adminhtml scope only).

JS Components

None. This module has no custom JavaScript.

Email Templates

None. This module sends no emails.

ACL Resources

None. This module defines no ACL resources. Access to the company form and admin user form is governed by Orangecat_Company and Magento_User ACL respectively.

Adding Custom Logic


REST API

This module exposes no REST API endpoints. Sales rep assignment is managed exclusively through the admin UI. The sales_rep_id field is available on the company object retrieved via Orangecat_Company REST endpoints (it is a raw data field on the company model).


Frontend Routes Reference

This module defines no frontend routes. The sales rep card is rendered as a block within the existing /customer/account/ page via layout XML.


DevOps & Integrator Notes

Deployment Checklist

Integration Token Scope

This module adds no ACL resources. To manage company sales rep assignments via the Orangecat_Company REST API, the integration token requires whatever ACL the Company module mandates for company save operations.

Disabling Without Uninstalling

Disabling hides the sales rep card from the dashboard and removes the Sales Representative field from the company form. The database columns (mycompany.sales_rep_id, admin_user.telephone, admin_user.whatsapp) are retained — no data loss.

Data Integrity Notes


All versions of module-company-sales-rep with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
magento/framework Version *
orangecat/module-company Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package orangecat/module-company-sales-rep contains the following files

Loading the files please wait ...