Purchase From Partner is a Magento PWA Studio extension 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 exlusive to retail partners. The extension 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.
Prerequisite: In Magento 2 instance should be installed next module: https://packagist.org/packages/magenable/module-purchase-partner-url
- Add dependency to PWA Studio project
yarn add @magenable/purchase-partner-url
- Wrap the module in your local-intercept.js file
const { Targetables } = require('@magento/pwa-buildpack');
const targetables = Targetables.using(targets);
const purchasePartnerUrl = require('@magenable/purchase-partner-url/src/targets');
purchasePartnerUrl(targetables);
- Re-build your PWA project
yarn upgrade @magenable/purchase-partner-url
You can specify partner links for any products, even for products that are not available currently for purchasing in venia-ui storefront (for example bundle product):
For more information about configuration see readme in the next module https://packagist.org/packages/magenable/module-purchase-partner-url.