magenable / module-purchase-partner-url

magenable/module-purchase-partner-url

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

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Warning Tests: N/A Security: Pass MIT

Purchase From Partner

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.

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

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

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
purchase-partner-url-result-view

  • 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
purchase-partner-url-result-view-2

  • 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).

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
Versions
Version Stability QA Status Compatibility Released
1.5.7 stable Pass Magento 2.4.7-2.4.9 Details 2026-06-16 03:52:09
1.5.6 stable Not tested Not yet tested Details 2025-07-07 02:32:22
1.5.5 stable Not tested Not yet tested Details 2025-03-10 04:38:13
1.5.4 stable Not tested Not yet tested Details 2024-12-19 08:49:16
1.5.3 stable Not tested Not yet tested Details 2024-08-23 06:03:11
1.5.2 stable Not tested Not yet tested Details 2024-04-16 02:57:46
1.5.0 stable Not tested Not yet tested Details 2023-02-16 12:00:07
1.4.3 stable Not tested Not yet tested Details 2023-01-13 03:29:22
1.4.2 stable Not tested Not yet tested Details 2022-05-11 13:37:55
1.4.1 stable Not tested Not yet tested Details 2022-04-07 02:06:32
1.4.0 stable Not tested Not yet tested Details 2022-02-06 03:12:28
1.3.0 stable Not tested Not yet tested Details 2021-11-09 05:33:59
1.2.2 stable Not tested Not yet tested Details 2021-09-09 01:54:10
1.2.1 stable Not tested Not yet tested Details 2021-08-27 03:20:20
1.2.0 stable Not tested Not yet tested Details 2021-08-26 05:23:29
1.0.0 stable Not tested Not yet tested Details 2021-04-06 04:12:02

Requires 3

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

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
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. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — 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.

Static analysis results
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's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.

PHPStan results by Magento and PHP version
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 for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
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

Integration tests results by Magento and PHP version
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

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
MIT
Authors
  • Magenable

More from magenable

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.