Download the PHP package orangecat/module-company without Composer

On this page you can find all versions of the php package orangecat/module-company. 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

Orangecat_Company

Module: Orangecat_Company 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. Frontend User Guide
  9. Developer Guide
  10. REST API
  11. Frontend Routes Reference
  12. DevOps & Integrator Notes

Overview

Orangecat_Company is the core B2B module of the Orangecat suite. It introduces the concept of a Company entity into Magento 2 — a legal business unit that groups multiple customers under a shared identity with role-based access control.

The module handles:

Position in the Orangecat B2B Dependency Chain

All other B2B modules depend on this one. It must be installed and enabled first.


Theme Compatibility

Theme Status Notes
Luma Supported "Create a Company" link placed in header.links. Standard .phtml templates.
Breeze Evolution Supported Custom template breeze/company-register-link.phtml. Link placed in top.links.
Hyvä Supported Alpine.js-compatible templates. Link placed in header.customer.logged.out.links. Custom CSS loaded from web/css/hyva/module.css.

Each theme has its own layout handles and templates. No cross-theme interference.


Requirements


Installation

Via Git Submodule (recommended for this project)

Enable the Module

Run inside the PHP container (reward shell):


What Gets Installed

Database Tables

Table Description
mycompany Company flat table — name, legal name, email, tax ID, address, status, website
mycompany_role Company roles with JSON permissions
mycompany_customer Link table joining companies, customers, and roles. Also stores per-user purchase limits.

mycompany columns: entity_id, name, name_legal, email, tax_id, address, city, country, region, postalcode, telephone, status, website_id, created_at, updated_at

mycompany_customer columns: link_id, company_id, customer_id, role_id, max_purchase_amount, max_period_amount

A customer can belong to only one company (unique constraint on customer_id).

Customer EAV Attribute

Attribute Type Purpose
approve_account int (boolean) Controls whether a customer can log in. 1 = approved, 0 = pending/blocked. Visible in Admin > Customer grid and form.

Default Roles

Installed automatically via data patch:

Role ID Name Permissions
1 Company Admin all
2 Company Manager manage_users, view_orders
3 Company Buyer place_order

CMS Page

A placeholder CMS page is created at URL key company-terms (Company Terms and Conditions). Edit its content via Admin > Content > Pages before going live.


Configuration

Path: Stores > Configuration > Orangecat > Company (B2B)

Email Notification

Field Description Default
Enable New Company Notification Send email to admin(s) when a new company is registered No
Notification Email Address Comma-separated list of recipient email addresses —
Email Template Template for the admin notification New Company Registration Notification
Company - New Account No Password Template Email sent to the company admin when their account is created (no password set) New Company Customer - No Password
Company - Status Change Template Email sent to the company email when its status changes Company Status Change Notification

Config paths:

Customers

Field Description Default
Allow Frontend Customer Registration If No, hides "Create an Account" and blocks /customer/account/create (returns 404) No
Require Approval for Customer If Yes, newly registered customers start with approve_account = 0 and cannot log in until manually approved. Only available when registration is allowed. Yes

Config paths:


Store Admin Guide

Managing Companies

Path: Admin menu > Companies > Companies

The company grid supports:

Company Statuses

Status Value Meaning
Pending 0 Submitted via frontend, awaiting review
Approved 1 Active — associated customers can log in
Suspended 2 Temporarily blocked
Rejected 3 Registration denied

Changing status to Approved/Suspended/Rejected triggers the Status Change email to the company's email address (if the template is configured).

Company Form Fields

Field Required Notes
Company Name Yes Display name
Legal Name No Legal/registered name
Company Email Yes Must be unique. Must differ from the admin's email.
Tax / VAT ID No Must be unique if provided
Address, City, Region, Postal Code, Country No
Telephone No
Status Yes See statuses above

Assigning Customers to a Company

From the Company edit form, use the Customer Assignment section to select a customer as the Company Admin via a grid chooser. The customer is linked with Role ID 1 (Company Admin).

Alternatively, open any Customer in Admin > Customers > All Customers and use the Company Assignment tab:

Business rules enforced on save:

  1. A company can have only one Company Admin (Role ID 1). Attempting to assign a second admin is blocked.
  2. A company must always have one Admin. Changing the only admin's role or removing them is blocked. Assign a replacement admin first.

Approving Customers

When Require Approval for Customer is enabled, new registrations set approve_account = 0 (and force logout to prevent auto-login).

To approve:

  1. Admin > Customers > All Customers
  2. Open the customer
  3. Set Approve Account to Yes
  4. Save

Unapproved customers attempting to log in see:

"Your account is not enabled or your company has not yet been enabled."


Frontend User Guide

Company Registration

Guests can register a new company at: /company/account/create

The "Create a Company" link appears in the header for guests (not visible when logged in).

Registration form fields:

Section Fields
Company Information Company Name, Legal Name, Company Email, Tax ID, Address, City, Region, Postal Code, Country, Telephone
Company Administrator First Name, Last Name, Email

Validations applied:

After submission, the company is created with Pending status. The admin's customer account is created without a password. A confirmation page is shown and an email is sent to the admin(s) if notification is enabled.


Company User Management (Company Admin only)

Accessible via Account Dashboard > Company Users — visible only to users with the Company Admin role.

Available actions:

Non-admin company members are redirected to the account dashboard if they try to access this section.


Developer Guide

Module Structure

Service Contracts

CompanyRepositoryInterface

CompanyManagementInterface

RoleRepositoryInterface

Standard CRUD + getList for RoleInterface.


Key Models

Orangecat\Company\Model\Company

Extends AbstractModel. Constants:

Orangecat\Company\Model\Config

Helper for reading all module config values. Inject and use:


Plugins

Plugin Target Type Purpose
RegistrationRestriction Customer\Controller\Account\Create & CreatePost before Throws 404 if registration is disabled
RegisterLink Customer\Block\Account\RegisterLink after Hides "Create an Account" if registration is disabled
CompanyRegisterLinkVisibility Block\Account\CompanyRegisterLink after Controls "Create a Company" link visibility for guests
CustomerRegistration (Hyvä) Hyva\Theme\ViewModel\CustomerRegistration after Hides registration via Hyvä's ViewModel when disabled
LoginPost Customer\Controller\Account\LoginPost around Blocks login for unapproved customers
CustomerRepositoryInterfacePlugin CustomerRepositoryInterface around Prevents deletion of a company admin
CustomerRepositoryInterfaceSavePlugin CustomerRepositoryInterface after Persists company assignment data on customer save
TransportBuilderPlugin Mail\Template\TransportBuilder around Swaps email template for company users (no-password flow)

Observers

Observer Event Area Purpose
AutoApproveCustomer customer_register_success frontend Sets approve_account = 1 or 0 based on config. Forces logout if not approved.
SaveCompanyObserver adminhtml_customer_save_after adminhtml Reads customer[company_id] and customer[role_id] from POST and saves the company link. Enforces single-admin and mandatory-admin rules.

Adding Hyvä Layout Support

Hyvä-specific layout handles use the hyva_ prefix. This module provides:

Templates for Hyvä are under view/frontend/templates/hyva/ and view/frontend/templates/users/edit_hyva.phtml / list_hyva.phtml.

Do not put Hyvä templates in view/hyva/ — this project uses view/frontend/templates/hyva/ as the convention.


Email Templates

Template ID File Trigger
mycompany_email_email_template new_company.html New company registered (sent to store admin)
mycompany_email_company_no_password_template company_account_new_no_password.html Company admin account created without password
company_user_welcome company_user_welcome.html New company user added
mycompany_email_company_status_change_template company_status_change.html Company status changed

Templates are in view/frontend/email/. Customize via Admin > Marketing > Email Templates.


ACL Resources

Resource ID Title Location
Orangecat_Company::company_manage Company Management Admin top-level
Orangecat_Company::company Companies Under Company Management
Orangecat_Company::config Company Settings Under Stores > Settings

REST API

All endpoints require admin authorization (Orangecat_Company::company resource).

Endpoints

Method URL Action
POST /V1/mycompany/ Create company
PUT /V1/mycompany/:entity_id Update company
GET /V1/mycompany/:companyId Get company by ID
DELETE /V1/mycompany/:companyId Delete company
GET /V1/mycompany/ Search companies (with searchCriteria)

Example: Create Company

Example: Search with Filter


Frontend Routes Reference

Route Controller Access
GET /company/account/create Controller\Account\Create Guests only
POST /company/account/createPost Controller\Account\CreatePost Guests only
GET /company/account/success Controller\Account\Success Public
GET /company/users Controller\Users\Index Company Admin only
GET /company/users/create Controller\Users\Create Company Admin only
POST /company/users/save Controller\Users\Save Company Admin only
GET /company/users/edit Controller\Users\Edit Company Admin only
POST /company/users/delete Controller\Users\Delete Company Admin only
POST /company/users/status Controller\Users\Status Company Admin only

DevOps & Integrator Notes

Deployment Checklist

Integration Token Scope

Minimum permissions for an ERP or external integration reading company data:

Disabling Without Uninstalling

Warning: all dependent modules (Orangecat_CompanyCredit, Orangecat_CompanyMethods, Orangecat_Prices, etc.) must be disabled first.

Data Integrity


All versions of module-company with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
magento/framework Version >=103.0
orangecat/core 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 contains the following files

Loading the files please wait ...