Advanced Affiliate Module for Magento 2

€114.16 €92.81
Expandable module
M2-AFFILIATE
PayPal PayPal
Przelew Przelew

YOU CAN TRUST US

25 years of experience in e-commerce and Magento 2

Tooltip

Fast delivery

Tooltip

Efficient implementation process

Tooltip

Simple and transparent complaint process

Tooltip

Working with clients worldwide

Tooltip

Free module updates

Tooltip

Payment by bank transfer

Tooltip

1. What this module is

The module extends Magento 2 with a complete affiliate system that runs directly inside your store. This means the store owner manages partners, commissions, settlements, and promotional assets from the Magento Admin Panel, while partners use a dedicated dashboard inside their customer account.

In practice, the module lets you run multiple partnership models at the same time:

  • a classic affiliate program based on tracking links,
  • a referral program based on unique partner codes,
  • a hybrid model: affiliate link plus discount code,
  • a partner program for store customers, agencies, implementers, and creators.

2. Key business value

The primary value is combining sales, attribution, settlements, and partner management in one place. The store does not need to maintain an external affiliate platform, manually export orders, or reconcile partners in spreadsheets.

The module provides the store owner with:

  • a new sales channel,
  • full control over partnership rules,
  • transparent commission and payout handling,
  • clear affiliate performance reporting,
  • the ability to safely launch the program for mid scale and large scale stores.

The partner gets:

  • a personal referral code,
  • a personal affiliate link,
  • a ready dashboard to monitor activity,
  • commission and payout visibility,
  • access to promotional materials and banners.

3. Who this module is for

The module is a strong fit for stores that want to build a partner network without external affiliate platforms, or that want full control over data and settlement processes.

It works especially well when your affiliate program is intended for:

  • customers referring friends,
  • content creators,
  • bloggers and publishers,
  • specialists and consultants,
  • implementation partners,
  • software houses and agencies,
  • resellers and B2B sales reps,
  • brand ambassadors and communities.

4. Core module features

4.1. Affiliate registration

The module provides an application form for the affiliate program. A customer can apply independently by entering basic contact details, a website or channel URL, and a short note about the planned promotion.

After the form is submitted:

  • an affiliate account is created,
  • a unique referral_code is generated,
  • the application status is set to Pending,
  • the admin can be notified about a new application,
  • the customer can receive an application confirmation.

4.2. Partner approval

The administrator can approve an affiliate from the Magento Admin Panel. After approval:

  • the partner status changes to Active,
  • the partner can fully use the program,
  • an affiliate coupon can be activated,
  • the customer can receive an approval notification.

Each affiliate receives their own affiliate link based on the referral_code. The link goes through a tracking controller and records visit attribution. After a click, the system can:

  • store affiliate attribution in a cookie,
  • create a visit record,
  • create an attribution record,
  • connect a later order to a specific affiliate.

4.4. Affiliate code and discount coupon

The module also supports a model where referral_code can work as a cart discount code.

The administrator can set the following field on the affiliate account:

  • Affiliate Coupon Discount (%)

If the value is greater than zero, the system:

  • synchronizes a native Magento Cart Price Rule,
  • sets the coupon code equal to referral_code,
  • applies a percentage discount in the cart,
  • treats usage of the code as the affiliate source of the order.

This allows the affiliate to promote:

  • a standard affiliate link,
  • the discount code alone,
  • both mechanisms together.

This is one of the most practical revenue features, because many store owners expect a partner to drive traffic and also provide a clear price benefit for the end customer.

4.5. Order attribution

The module can attribute an order to an affiliate based on:

  • a click on an affiliate link,
  • active attribution stored in session or cookie,
  • use of an affiliate code in the cart,
  • a logged in customer connected to active attribution.

The following data is stored at the order level:

  • affiliate_id,
  • affiliate_attribution_id,
  • affiliate_referral_code,
  • is_affiliate_order,
  • affiliate_commission_amount,
  • affiliate_commission_status.

This enables reporting the sales source directly on quote and sales_order.

4.6. Commission calculation

A commission is created automatically for an affiliate order. In the current model:

  • commission is calculated as a percentage of the order subtotal,
  • the default rate comes from module configuration,
  • the system prevents commission duplication for the same order and affiliate,
  • the result is stored in the commission table and on the order.

Supported commission statuses include:

  • pending,
  • approved,
  • ready_for_payout,
  • paid,
  • rejected,
  • cancelled,
  • charged_back.

4.7. Hold period and automatic approval

The module supports a commission hold period. This means the commission does not have to be immediately payout ready. It can remain pending for a configured time window and then be auto approved by cron.

This is especially important for:

  • return risk,
  • manual order verification,
  • sales models with delayed completion,
  • protecting the program from abuse.

4.8. Affiliate payouts

The partner can request a payout if the minimum threshold is met and the approved balance is sufficient.

The payout workflow includes:

  • submitting a payout request,
  • assigning commissions to a payout,
  • switching commission status to ready_for_payout,
  • marking the payout as paid,
  • switching commission statuses to paid.

This enables the store owner to run payouts in an organized and auditable way.

4.9. Fraud prevention

The module includes a basic anti fraud layer to eliminate the most obvious abuses.

This includes:

  • blocking self referral,
  • marking commissions as rejected when abuse is detected,
  • handling fraud cases,
  • recording rejection reasons,
  • a dedicated fraud case view in the admin area.

Additionally, the module supports:

  • order cancellations,
  • chargebacks,
  • refunds via creditmemo,
  • commission status updates after refunds.

4.10. Notifications

The module has its own queue and notification processing system. It can store operational events and send email messages.

Supported cases include:

  • new affiliate application,
  • application submission confirmation,
  • affiliate approval,
  • commission events,
  • payout events,
  • fraud alerts.

4.11. Affiliate portal

The partner uses an extended dashboard inside the Magento customer account. The dashboard is not only a commission list but a full operational panel.

The affiliate dashboard includes:

  • program participation status,
  • referral code,
  • full affiliate link,
  • default target path,
  • commission summary,
  • commission history,
  • payout access,
  • program rules content,
  • ready promotional snippets,
  • banner preview,
  • AI banner generator.

4.12. AI banner generator

The module includes an AI assisted feature that lets the affiliate create a ready promotional banner based on a brief.

The user can provide:

  • a text brief,
  • visual direction,
  • colors,
  • style,
  • optional image URL,
  • optional target link.

The system passes to the AI layer:

  • the user brief,
  • the referral link,
  • the target path,
  • technical requirements for the response format.

The generated banner HTML can be saved on the affiliate account and used as a ready promotional asset.

4.13. Reporting

The module supports reports and CSV exports for key program areas:

  • commissions,
  • payouts,
  • fraud cases,
  • AI insights.

This supports both daily operations and partner performance analysis.

5. Admin panel

The module extends Magento Admin with configuration and operations for the affiliate program.

The administrator can access:

  • global program settings,
  • commission settings,
  • payout settings,
  • affiliate portal settings,
  • notification settings,
  • fraud settings,
  • AI settings,
  • reporting settings.

Additionally, operational sections are available in the admin area:

  • Affiliate Commissions,
  • Affiliate Payouts,
  • Affiliate Fraud Cases,
  • Affiliate Reports.

On the customer grid and in customer edit, affiliate data is visible, such as:

  • program participation,
  • affiliate status,
  • affiliate balance,
  • referral code,
  • affiliate coupon discount percentage.

6. How affiliation works in practice

  1. The partner receives their link.
  2. The customer clicks the link and lands in the store.
  3. The system stores the visit and attribution.
  4. The customer places an order.
  5. The order is attributed to the affiliate.
  6. A commission is created.
  7. After the hold period, the commission can be approved.
  8. After conditions are met, the partner can request a payout.

6.2. Cart affiliate code scenario

  1. The partner publishes their affiliate code.
  2. The customer enters the code in the cart.
  3. Magento applies the discount from the cart rule.
  4. The module recognizes the code as an affiliate code.
  5. The order is attributed to the affiliate.
  6. A commission is created based on program rules.

6.3. Hybrid scenario

The customer can enter the store through an affiliate link and later use the affiliate discount code. This model combines classic tracking with a clear benefit for the end customer.

7. Security areas

The module is prepared for production rollout and includes:

  • audit logging,
  • return and cancellation handling,
  • self referral blocking,
  • notification queue,
  • mechanisms to prevent commission duplication,
  • secure storage of AI configuration,
  • limiting the data sent to the AI layer,
  • diagnostics for integration issues.

8. AI integration

The AI layer is optional and does not block the core affiliate program. It can be used for:

  • an affiliate assistant,
  • insight generation,
  • banner generation,
  • product knowledge retrieval via vector_store_id.

The module does not need to maintain its own product knowledge base for AI if the store already uses an external module that manages product knowledge and Vector Store.

9. Sales use cases

The module can be sold as a solution for multiple project types:

  • B2C stores with a referral program,
  • premium stores building a brand ambassador network,
  • B2B businesses with a partner sales program,
  • digital and software focused stores,
  • agency implementations where the client needs a full partner program without external SaaS.

Key selling points include:

  • full data control,
  • no subscription to an external affiliate platform,
  • native Magento 2 integration without intermediaries,
  • support for affiliate links and affiliate coupons,
  • a ready partner portal,
  • a path to extend with AI features.

10. Top advantages

The main advantages of this solution are:

  • runs directly in Magento 2,
  • supports both links and affiliate codes,
  • supports affiliate linked discount coupons,
  • enables partner management inside Magento customer accounts,
  • includes a real commission and payout workflow,
  • includes basic security and auditing,
  • provides a modern affiliate dashboard,
  • ready for further enterprise grade development.

11. System requirements

The module is intended for:

  • Magento Open Source / Adobe Commerce 2.4.7+
  • PHP 8.2 / 8.3

It requires compatible Magento modules related to:

  • Customer,
  • Quote,
  • Sales,
  • SalesRule,
  • Cms,
  • Email,
  • Backend,
  • Store.

12. Implementation scope

The module can be implemented in phases:

  • start with affiliate links and commissions,
  • extend with payouts,
  • extend with affiliate coupons,
  • extend with AI and affiliate content,
  • further extend with advanced commission rules and fraud scoring.

This makes it suitable both for MVP implementations and long term affiliate program development.

13. Summary

Kowal_Affiliate is a mature affiliate module for Magento 2 that enables you to launch and run a complete partner program inside your own store. It combines classic affiliate links, referral codes, discount coupons, commissions, payouts, basic fraud prevention, reporting, and a modern partner portal.

From a sales perspective, this is not just an add on for referral links but a complete partner layer for Magento 2 that can be offered as:

  • a standalone module,
  • part of a store implementation,
  • part of a growth or performance package,
  • a foundation for more advanced partner and ambassador programs.

In practice, it addresses real store needs such as:

  • an affiliate program in Magento 2,
  • discount codes for partners,
  • commission settlement,
  • a partner portal,
  • production ready sales operations.

Kowal_Affiliate - installation and configuration guide

This document describes how to install, enable, and perform the initial configuration of the Kowal_Affiliate module for Magento 2. It covers both technical requirements and practical steps required to launch an affiliate program in the store.

1. System requirements

The module is intended for:

  • Magento Open Source / Adobe Commerce 2.4.7+
  • PHP 8.2 or 8.3

The Magento project should have at least the following modules available:

  • Magento_Store
  • Magento_Cms
  • Magento_Customer
  • Magento_Email
  • Magento_Quote
  • Magento_Sales
  • Magento_SalesRule
  • Magento_Backend

2. Installation methods

The module can be deployed as a standard Composer package.

2.1. Installation via Composer

The module is distributed as a Composer package. An example process looks like this:

composer require kowal/module-affiliatebin/magento module:enable Kowal_Affiliatebin/magento setup:upgradebin/magento setup:di:compilebin/magento cache:flush

2.3. Production mode

If the store runs in production mode, after installation it is recommended to also run:

bin/magento setup:static-content:deploy

3. What the module creates during installation

During installation, the module:

  • creates its own database tables related to affiliation,
  • extends quote and sales_order with affiliate fields,
  • adds customer attributes used for affiliate management,
  • creates a default CMS page for the partner program,
  • prepares system configuration and cron jobs,
  • registers email templates and admin panel assets.

3.1. Default CMS page

After installation, an example partner program page is created:

identifier: affiliate-programtitle: Affiliate Partnership Program

The page is generic and can be used in production after minor content personalization.

The patch is idempotent:

  • if a page with the given identifier already exists, the module will not overwrite it.

4. Where to find module configuration

The configuration panel is available at:

Stores -> Configuration -> Affiliate Program

Main sections:

  • General
  • Commission
  • Payouts
  • Affiliate Portal
  • Notifications
  • Fraud
  • AI
  • Reporting

5. Initial configuration after install

After enabling the module, the following configuration order is recommended:

  1. enable the module globally,
  2. configure affiliate registration,
  3. configure commissions and hold period,
  4. set the minimum payout threshold,
  5. fill in affiliate portal content,
  6. configure admin notifications,
  7. optionally configure AI,
  8. run a test for registration, affiliate click, and order attribution.

6. Detailed configuration

6.1. General

Enable Module

Global module toggle.

If disabled:

  • affiliate tracking should not work,
  • the registration form should not work,
  • commissions and payouts will not be processed.

Recommendation:

  • Yes in production after testing is complete,
  • No only to temporarily disable the program.

Enable Affiliate Registration

Enables the affiliate application form on the storefront.

If disabled:

  • new partners cannot self register,
  • the administrator can still manually mark a customer as an affiliate.

Defines the lifetime of cookie based attribution after clicking an affiliate link.

Examples:

  • 30 for a standard affiliate program,
  • 7 for short campaigns,
  • 60 or 90 only if allowed by your program terms.

Default Redirect Path

Fallback path used when the tracking link does not include a valid target.

Examples:

  • /
  • promotions
  • catalog/category/view/id/12

6.2. Commission

Enable Commissions

Enables commission calculation for affiliate orders.

If disabled:

  • attribution can still be stored,
  • but no commission table entry will be created.

Default Commission Rate (%)

Default percentage commission rate.

Example:

  • 10 means a 10 percent commission on the current calculation base.

Commission Hold Period (days)

Number of days a commission remains in pending status.

After this period, cron can automatically approve the commission.

Recommendation:

  • 14 as a safe default,
  • 0 only for very simple programs with no return risk.

6.3. Payouts

Enable Payouts

Enables the payout workflow for affiliates.

If disabled:

  • the partner cannot submit a payout request,
  • the administrator can still review commissions but cannot process payouts in the module.

Minimum Payout Amount

Minimum balance required to request a payout.

Examples:

  • 100
  • 250
  • 500

6.4. Affiliate Portal

This section controls the content shown in the affiliate dashboard.

Dashboard Intro

Short description at the top of the affiliate dashboard.

It should explain:

  • where to find the affiliate link,
  • where to see commissions,
  • how the dashboard works.

Program Rules

Visible partnership rules for affiliates.

Best practice:

  • one rule per line,
  • clear and unambiguous statements.

Default title for an example promotional asset.

Short description below the banner title.

Default target path for affiliate links and banners.

Examples:

  • /
  • promotions/spring
  • catalog/category/view/id/24

6.5. Notifications

Enable Notifications

Enables the internal notification system and notification queue.

Admin Notification Email

Administrator email address that should receive the most important operational messages.

If left blank:

  • the module may use Magento general email as a fallback in selected flows.

Notification Log Retention (days)

Defines how long notification log entries should be stored before cleanup.

6.6. Fraud

Enable Fraud Checks

Enables basic anti fraud checks.

Block Self Referral

Blocks commission when the ordering customer is also the affiliate attributed to the same order.

6.7. AI

The AI section is optional and not required for the core affiliate program.

Enable AI

Main toggle for AI features.

OpenAI API Key

API key used to communicate with OpenAI.

The field is stored in encrypted configuration.

AI Model Name

Model used for AI features.

The model list can be fetched from OpenAI after the API key is saved.

OpenAI Request Timeout (seconds)

Maximum time to wait for an OpenAI response.

Practical recommendation:

  • 60 seconds for more stable production operation.

Enable AI Diagnostic Logging

Enables diagnostic logging of AI requests and responses.

Useful for:

  • integration,
  • testing,
  • analyzing timeouts and response errors.

AI Diagnostic Max Chars

Maximum length of the logged preview payload.

Enable Affiliate Assistant

Enables the affiliate assistant if the store wants to use this feature.

Enable Weekly AI Reports

Allows generating recurring AI summaries.

Enable Product Knowledge Retrieval

Enables product knowledge retrieval from Vector Store.

Enable Program Knowledge Retrieval

Enables knowledge retrieval for affiliate program rules, FAQ, and documentation.

Product Vector Store Scope

Defines how product_vector_store_id is resolved.

Product Vector Store ID

Vector Store identifier if the store uses retrieval.

Redact Personal Data

Removes or masks personal data before sending prompts to the AI layer.

6.8. Reporting

Enable Reporting

Enables report generation and CSV exports.

Export Directory

Directory path where generated exports should be saved.

Example:

var/export/affiliate

7. Configuring a customer as an affiliate

After installation, the module extends Magento customer edit with affiliate fields.

In customer edit, you can manage:

  • Affiliate Participant
  • Affiliate Status
  • Affiliate Referral Code
  • Affiliate Website URL
  • Affiliate Notes
  • Affiliate Balance
  • Affiliate Coupon Discount (%)

7.1. Affiliate Participant

Indicates whether the customer is part of the affiliate program.

7.2. Affiliate Status

Key statuses:

  • Pending
  • Active
  • Suspended
  • Rejected
  • Blocked

7.3. Affiliate Balance

The balance is calculated automatically from approved and payout ready commissions.

The field:

  • is visible in customer edit,
  • should not be edited manually,
  • updates automatically after commission changes.

7.4. Affiliate Coupon Discount (%)

This field assigns the affiliate a percentage discount that will work with their referral_code.

If you enter a value greater than 0, the module:

  • creates or updates a Magento cart rule,
  • sets the coupon equal to the affiliate code,
  • allows customers to use the code as a cart coupon,
  • attributes the order to the affiliate based on coupon_code.

Example:

  • the affiliate code is FMX1FBXXY3
  • the administrator enters 5
  • the customer uses FMX1FBXXY3 as the coupon
  • Magento applies a 5 percent discount
  • the module attributes the order to the affiliate.

8. Module cron jobs

The module uses cron jobs in the default group.

8.1. Auto approve commissions

job: kowal_affiliate_auto_approve_commissionsschedule: */15 * * * *

The job:

  • checks pending commissions,
  • after the hold period changes them to approved.

8.2. Process notifications

job: kowal_affiliate_process_notificationsschedule: */10 * * * *

The job:

  • processes the notification queue,
  • marks entries as sent,
  • for the email channel, sends transactional emails.

8.3. Cleanup notification log

job: kowal_affiliate_cleanup_notification_logschedule: 30 2 * * *

The job:

  • removes old notification log entries according to retention.

8.4. Weekly AI insights

job: kowal_affiliate_generate_weekly_ai_insightsschedule: 0 6 * * 1

The job:

  • generates weekly AI insights if enabled.

9. CLI commands

The module provides service commands:

bin/magento kowal:affiliate:auto-approvebin/magento kowal:affiliate:process-notificationsbin/magento kowal:affiliate:cleanup-notificationsbin/magento kowal:affiliate:generate-ai-insightsbin/magento kowal:affiliate:export-report

The most useful during initial launch are:

bin/magento kowal:affiliate:process-notificationsbin/magento kowal:affiliate:auto-approve

10. First test after installation

After configuration, a simple end to end test is recommended.

10.1. Affiliate registration test

  1. Open the affiliate registration form.
  2. Submit the application.
  3. Verify the affiliate account was created.
  4. Verify the customer has status Pending.
  5. Verify notification entries were created.

10.2. Activation test

  1. Open customer edit in the admin panel.
  2. Set affiliate status to Active or use the approve action.
  3. Verify the customer can see the affiliate dashboard.
  1. Copy the affiliate link from the dashboard.
  2. Enter the store through that link.
  3. Add a product to cart.
  4. Place an order.
  5. Verify the order has:
    • affiliate_id
    • affiliate_referral_code
    • is_affiliate_order = 1

10.4. Affiliate coupon test

  1. Set Affiliate Coupon Discount (%) for the affiliate, for example 5.
  2. Save the customer.
  3. Ensure the affiliate has status Active.
  4. In the cart, enter their Referral Code as a coupon.
  5. Place an order.
  6. Verify:
    • the discount was applied,
    • the order was attributed to the affiliate,
    • a commission was created.

10.5. Payout test

  1. Approve the commission or wait for auto approval.
  2. Check the affiliate balance.
  3. Submit a payout request.
  4. Mark the payout as paid in the admin panel.

11. Most common issues after install

11.1. No commission after an order

Check:

  • whether the order has affiliate_id,
  • whether commissions are enabled,
  • whether the module is running after the fix that creates commission after affiliate data is saved on the order,
  • whether a record appears in kowal_affiliate_commission.

11.2. Customer grid does not show the current affiliate balance

Check:

  • whether the customer_grid index was refreshed,
  • whether reindexRow runs after saves,
  • whether the value in customer edit matches the value in the grid.

If needed, run:

bin/magento indexer:reindex customer_grid

11.3. AI does not respond

Check:

  • whether Enable AI is enabled,
  • whether a valid OpenAI API Key was saved,
  • whether the model was selected,
  • whether the timeout is not too low,
  • whether var/log shows OpenAI request errors.

11.4. Notifications are not sent

Check:

  • whether Magento cron is running,
  • whether Enable Notifications is enabled,
  • whether entries are saved to kowal_affiliate_notification_log,
  • whether you can run manually:
bin/magento kowal:affiliate:process-notifications

For a first production rollout, the following setup is recommended:

  • Enable Module = Yes
  • Enable Affiliate Registration = Yes
  • Tracking Cookie Lifetime = 30
  • Enable Commissions = Yes
  • Default Commission Rate = 10
  • Commission Hold Period = 14
  • Enable Payouts = Yes
  • Minimum Payout Amount = 100
  • Enable Notifications = Yes
  • Block Self Referral = Yes
  • Enable AI = No as a starting point if the store does not need AI from day one

13. Summary

After proper installation and configuration, Kowal_Affiliate enables a complete partner program in Magento 2, including:

  • affiliates,
  • referral links,
  • affiliate codes,
  • affiliate discount coupons,
  • commissions,
  • payouts,
  • notifications,
  • partner dashboard,
  • basic security and automation.
Release notes and change history for Kowal_Affiliate. Includes feature additions, performance improvements, bug fixes, and compatibility updates for Magento Open Source and Adobe Commerce 2.4.7+ on PHP 8.2 and 8.3.
Write Your Own Review
You're reviewing:Advanced Affiliate Module for Magento 2
Your Rating
Aktualizacja preferencji plików cookie