# magenable/module-purchase-partner-url

> A Magento 2 module that allow specify partner url for any product

`composer require magenable/module-purchase-partner-url`

Canonical URL: https://packagento.com/magenable/module-purchase-partner-url

## At a glance

- **Vendor**: magenable (https://packagento.com/magenable.md)
- **Latest version**: 1.5.7 — released 2026-06-16
- **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/magenable/module-purchase-partner-url 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 magenable/module-purchase-partner-url:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

A Magento 2 module that allow specify partner url for any product

## README

**Purchase From Partner** is a Magento 2 module that allows you to replace standard `Add to Cart` button with links to external websites where visitors may purchase the products. Think about Amazon affiliate store, cases when a brand has products available exclusively to retail partners. The module may send events to Google analytics when clicking on the links for tracking/reporting.<br>
There may be one or more partner URL per product. The URLs are defined on product level, so some of your product may have normal Add to cart and some partner links.

The extension is compatible with Magento version 2.3.X and 2.4.X

### PWA Studio
The extension for Magento PWA Studio can be found here: https://www.npmjs.com/package/@magenable/purchase-partner-url

### Hyvä themes
The module for compatibility with the Hyvä theme can be found here:
https://gitlab.hyva.io/hyva-themes/hyva-compat/magento2-magenable-purchase-partner-url

### Breeze themes
This module is compatible with **Swissup/breeze** themes

### Installation

#### Composer:

Run the following command in Magento 2 root folder

```
composer require magenable/module-purchase-partner-url
bin/magento setup:upgrade
bin/magento setup:static-content:deploy
```
### Upgrade

#### Composer:

Run the following command in Magento 2 root folder

```
composer update magenable/module-purchase-partner-url
bin/magento setup:upgrade
```

### User Guide

#### Configuration:

Go to **Stores** > **Settings** > **Configuration** > **Magenable Extensions** > **Purchase Partner URL**.

**General Settings**

Set `Enabled` to **YES** if you want the module to work.

Update `Title of Links` with the required text, if it needs.

Set `Show All Links at Once` to **YES** if you want all buttons to be displayed at once.

Set `Open Link in New Tab` to **NO** if you want link opens in current tab.

**Google Analytics**

Set `Enabled` to **YES** if you want sent events to Google Analytics after partner links clicked .

Update `Event Category` Google Analytic property with the your value, if you wish.

Update `Event Action` Google Analytic property with the your value, if you wish.

After changing any setting you need to flush cache: for it go to **System** -> **Cache Management** and click `Flush Magento Cache`.

![purchase-partner-url-configuration](https://user-images.githubusercontent.com/34573954/131064786-b6c17755-596f-47a7-8f68-15c2ff3276bf.png)

#### Adding Purchase Partner Url:

Open any product and add `Purchase Partner Url` items, fill the fields:

- Link; (required)
- Link Title; (if this field is not filled then the value from the `Title of Links` field from the module configuration is displayed)
- Event Category (Google Analytics); (if this field is not filled then the value from the `Event Category` field from the module configuration is used)
- Event Action (Google Analytics); (if this field is not filled then the value from the `Event Action` field from the module configuration is used)

Then save the product.

![purchase-partner-url-product-fill](https://user-images.githubusercontent.com/34573954/130890434-4b452349-5170-41f0-8b85-2d72d164ed90.png)

#### Storefront view:

- If the only one link set for a product (or enabled setting `Show All Links at Once`), then after clicking on the button users go to a partner website.

![purchase-partner-url-result-list](https://user-images.githubusercontent.com/34573954/131065580-af76c1df-eecd-4007-a67a-cc99ac64d12c.png)
![purchase-partner-url-result-view](https://user-images.githubusercontent.com/34573954/131065583-a9b30954-298e-4ea6-b17b-6f6d1612d657.png)

- If there are multiple links defined for a product (and disabled setting `Show All Links at Once`), after clicking on the button, all partner links appears, after clicking one of them users go to a selected partner website.

![purchase-partner-url-result-list-2](https://user-images.githubusercontent.com/34573954/131065629-91150165-1fec-4419-83e7-97df49cd602e.png)
![purchase-partner-url-result-view-2](https://user-images.githubusercontent.com/34573954/131065635-dd53d9a2-2c06-46d4-9e75-3708e980959d.png)

- Also, after clicking on a link the event is sent to Google Analytics (if this not disabled in configuration of module and Google Analytics module is enabled and configured).

## Changelog

1.5.7 (2026-06-16)
=============
- Tested with Magento v2.4.9 and PHP 8.5

1.5.6 (2025-07-04)
=============
- Tested with Magento v2.4.8-p1

1.5.5 (2025-03-10)
=============
- Tested with Magento v2.4.8

1.5.4 (2024-12-19)
=============
- Tested on Magento v2.4.4-p11, v2.4.5-p10, v2.4.6-p8 and v2.4.7-p3

1.5.3 (2024-08-23)
=============
- Tested with Magento v2.4.6-p7 and v2.4.7-p2

1.5.2 (2024-04-10)
=============
- Tested with Magento 2.4.7 and PHP 8.3

1.5.1 (2024-03-11)
=============
- Tested with Magento 2.4.6-p4

## Recent Versions

| Version | Released |
|---|---|
| 1.5.7 | 2026-06-16 |
| 1.5.6 | 2025-07-07 |
| 1.5.5 | 2025-03-10 |
| 1.5.4 | 2024-12-19 |
| 1.5.3 | 2024-08-23 |
| 1.5.2 | 2024-04-16 |
| 1.5.0 | 2023-02-16 |
| 1.4.3 | 2023-01-13 |
| 1.4.2 | 2022-05-11 |
| 1.4.1 | 2022-04-07 |

Showing 10 of 16 versions. Full release history on https://packagento.com/magenable/module-purchase-partner-url.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magenable/module-base | * |
| magento/framework | >=102.0 |
| php | >=7.1.0 |

## Quality

Latest release (1.5.7) passes 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 | 14 | 14 warnings (ruleset: Magento2) |
| PHPMD | Warning | 13 | 13 rule violations (UnusedFormalParameter:12, MissingImport:1) |
| 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 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### 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=["magenable/module-purchase-partner-url"],
  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

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

