# magefan/module-auto-related-product

> Extend native Magento Up-Sells, Cross-Sells, and Related products

`composer require magefan/module-auto-related-product`

Canonical URL: https://packagento.com/magefan/module-auto-related-product

## At a glance

- **Vendor**: magefan (https://packagento.com/magefan.md)
- **Latest version**: 2.4.6 — released 2025-11-14
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/magefan/module-auto-related-product and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require magefan/module-auto-related-product:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Extend native Magento Up-Sells, Cross-Sells, and Related products

## README

[![Total Downloads](https://poser.pugx.org/magefan/module-auto-related-product/downloads)](https://packagist.org/packages/magefan/module-auto-related-product)
[![Latest Stable Version](https://poser.pugx.org/magefan/module-auto-related-product/v/stable)](https://packagist.org/packages/magefan/module-auto-related-product)

<img align="right" width="120" height="120" src="https://cm.magefan.com/mf_webp/jpg/media/catalog/product/cache/103e1b2520de2a36a364b0391bff6bdc/l/o/long-auto-related-products_1.webp">

[Magento 2 Auto-related Products](https://magefan.com/magento-2-automatic-related-products) extension is a tool that allows you to not only improve your customers' overall experience but increase sales and drive more customers with tempting offers. This extension enables you to add related products, cross-sells, and up-sells automatically based on a variety of conditions. 

You don’t have to monotonously add related products to each item on the catalog if you can use a smart algorithm that does it for you.

<img  align="right" width="120" height="70" src="https://magefan.com/media/wysiwyg/made_in_ukraine.jpg">

<a href="https://magefan.com/magento-2-automatic-related-products"><img width="190" height="70" src="https://cm.magefan.com/wysiwyg/products/download-magefan-extensions.png"></a>

### Useful Links
  * [User Guide](https://magefan.com/magento-2-automatic-related-products/documentation)
  * [Change Log](https://magefan.com/magento-2-automatic-related-products/change-log)
  * [FAQs](https://magefan.com/magento-2-automatic-related-products#pattr-faq)

### 🇺🇦 Stand with Ukraine! [How can you help?](https://magefan.com/blog/join-our-donations)

### Requirements
  * Magento Community 2.3.0-2.4.x (CE, EE, ECE, B2B)
  * [Magefan Community Extension](https://github.com/magefan/module-community) >= v2.1.20. Please install this extension first if you use installation via FTP.
  * **Note** that the extension is free only for the Magento Community (Open Source) Edition. For Magento EE, ECE, and B2B you need to purchase the license.

### Editions & Pricing
  
<a href="https://magefan.com/magento-2-automatic-related-products/pricing">
          <img
            src="https://cm.magefan.com/wysiwyg/products/auto-related-products-pricing-plans.png"
            alt="Pricing for Magento 2 Automatic Related Products Extension" />
        </a>
  
### Benefits
* More targeted related products
* Increased sales
* Better product recommendations
* Improved customer experience


### Features
#### Smart product recommendations

Adding related, cross-sell and up-sell products to your catalog items is a tedious and time-ineffective process that requires you to go from one product page to another. Much faster is to use the smart product recommendation tool like Automatic Related Products for Magento 2 by Magefan. This extension allows you to enable and add related product blocks for other products, categories, shopping cart, and even CMS pages automatically.

You can boost the conversion rate and provide a better shopping experience with just a few clicks.

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/wysiwyg/products/people-who-viewed-this-also-viewed-that.png">
</p>


#### Attribute-based related products conditions

To make the most out of your sales strategy and show products customers would really be interested in, you have to set up custom conditions to display them. The Auto-related Products Extension allows you to add cross-sell,up-sell, and related products based on page type and URL as well as multiple product and cart attributes.


#### “Same as” product display condition

If you want to optimize and upsell products based on common features like category, material, size, etc, there is the “Same as” product condition. It boosts your related product management and enables you to configure even more closely-focused conditions. There is probably no limit to the number of other conditions you can use along with the “Same as” one. You can create as many rules as you need for the best experience and better sales.

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/catalog/magento-best-sellers.png">
</p>

#### Auto-related products block position

Where you display the related products on the page is as important as the conditions you display them under. Even if you set the right conditions, related, up-sell, and cross-sell products might not play their part if displayed at the far bottom of the page or at the very top. Auto Related Products for Magento 2 allows you to choose among 20 possible page positions to display related items for smart recommendations.

<p align="center">
  <img width="860" height="428" src="https://cm.magefan.com/wysiwyg/products/auto-related-products-block-magento.png">
</p>

#### Customer group-based rules

Since related products alone are not going to do the trick, you have to be more specific about the customers you show them to. Targeting the right people with the right offers is a key to an effective sales campaign. That’s why Auto-related Products Extension for Magento has an option to define what customer group should the related product be displayed to. You can create similar rules and tweak them a little to fit certain customer group requirements and needs. 

#### Automatic related products widget

Magento 2 automatic related products widget is one more exceptional feature of the Auto Related Products module that exceeds the default Magento functional. It is one of those options that make displaying up-sell, cross-sell, and related products on any page of your store possible. You can create a rule and apply it with the widget on any CMS page of a website. Homepage, wishlist, customers account - promote more products on more pages for better conversion rates.

#### Auto-related products block display

_(README truncated for .md surface. Full README on https://packagento.com/magefan/module-auto-related-product.)_

## Recent Versions

| Version | Released |
|---|---|
| 2.4.6 | 2025-11-14 |
| 2.4.5 | 2025-08-26 |
| 2.4.4 | 2025-06-02 |
| 2.4.3 | 2025-05-06 |
| 2.4.2 | 2025-04-04 |
| 2.4.1 | 2024-09-23 |
| 2.4.0 | 2024-07-17 |
| 2.3.2 | 2024-06-25 |
| 2.3.1 | 2024-04-18 |
| 2.3.0 | 2024-04-02 |

Showing 10 of 26 versions. Full release history on https://packagento.com/magefan/module-auto-related-product.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magefan/module-community | >=2.2.17 |

## Quality

Latest release (2.4.6) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 135 | 135 warnings (ruleset: Magento2) — 39 auto-fixable with phpcbf |
| PHPMD | Warning | 32 | 32 rule violations (IfStatementAssignment:7, UnusedFormalParameter:7, NPathComplexity:6, CyclomaticComplexity:5, UnusedLocalVariable:3) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 3 | valid; 3 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 50 | 50 | – | – |
| 2.4.8 | – | 59 | 59 | – |
| 2.4.9 | – | – | 59 | 59 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["magefan/module-auto-related-product"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

magefan is a Magento 2 vendor on Packagento. See https://packagento.com/magefan.md for their full catalogue.

