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
The extension for Magento PWA Studio can be found here: https://www.npmjs.com/package/@magenable/purchase-partner-url
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
This module is compatible with Swissup/breeze themes
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
Run the following command in Magento 2 root folder
composer update magenable/module-purchase-partner-url
bin/magento setup:upgrade
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
.
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.
- 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.
- 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.
- 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).