Magento 2 Buy Now
mageprince/module-buynow 57
Adds a "Buy Now" button to product pages, allowing customers to skip the cart and proceed directly to checkout. Simplifies the purchase process for faster transactions.
Build Tests
Code Quality
Release Discipline
Release history audited up to v1.5.0
Tested on Magento 2.4.9
Recent Test History
Each release is tested against the latest Magento version at that time.
Top Contributors
View LeaderboardShare This Module's Status
README
Loaded from GitHubMagento 2 Buy Now
The Buy Now extension for Magento 2 streamlines the purchase process by adding a “Buy Now” button on product pages. With a single click, customers can skip the cart and go straight to checkout, making quick purchases faster and more convenient.
Hyvä Theme compatible – works out of the box on Hyvä, no compat module needed. Mage-OS compatible – supports Mage-OS as well as Magento Open Source and Adobe Commerce.
Admin Configuration: Admin > Stores > Configuration > MagePrince > Buy Now
🚀 Installation Instructions
1. Install via composer
Run the following command in the Magento 2 root folder:
composer require mageprince/module-buynow
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
2. Install manually (Not recommended)
Copy the content of the repo to the app/code/Mageprince/BuyNow folder and run the following command in the Magento 2 root folder:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
🎨 Theme support
| Location | Luma | Hyvä |
|---|---|---|
| Product view page | ✅ | ✅ |
| Category product list | ✅ | ✅ |
| Search results and advanced search results | ✅ | ✅ |
| Custom templates (with the snippet below) | ✅ | ✅ |
| Related, upsell, cross-sell, wishlist | ❌ | ❌ |
- Luma uses the core add to cart forms and RequireJS. No template overrides.
- Hyvä works out of the box, with no compat module. The module adds
hyva_*layout handles with Alpine/Tailwind-friendly templates and no RequireJS. The buttons use classes the Hyvä default theme already compiles (btn btn-primary), so no Tailwind rebuild is needed.
⚠️ Notice
We do not provide support for placing the Buy Now button on related products, upsell blocks, wishlist, or any other custom locations, as this would require overriding Magento core .phtml files — something we strongly advise against in extension development. Many free and paid Buy Now modules override core files, which can lead to maintenance and upgrade issues.
If you need the button in one of these places, add it to your own theme's template with the snippet below.
Add Buy Now in custom template
To add the button to a custom product template, use the following code snippet:
$buyNowBtnHtml = $block->getLayout()
->createBlock(\Mageprince\BuyNow\Block\Product\ListProduct::class)
->setProduct($_item)
->setTemplate('Mageprince_BuyNow::buynow.phtml')
->toHtml();
echo $buyNowBtnHtml;
- Change
$_itemto the current product object. - Hyvä theme: use the template
Mageprince_BuyNow::hyva/buynow.phtmlinstead. It renders a Hyvä-styled button (btn btn-primary). - Button title: the button uses the title set in the admin configuration. To override it for one placement, add
->setButtonTitle('Your title')before->toHtml(). - Don't place it inside another form. The snippet renders its own
<form>, and HTML forms cannot be nested. Put it outside the add to cart form, for example after its closing</form>tag. On Hyvä, the whole product item in product lists and sliders is a<form>, so place the snippet outside the item.
The screenshot below shows how to use the code in a Luma template.
Sample template: vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml
🤝 Contribution
Want to contribute to this extension? The quickest way is to open a pull request on GitHub. Contributions are welcome and are accepted under the MIT License.
🛠 Support
If you encounter any problems or bugs, please open an issue on GitHub.
📸 Screenshots
Product view page
Product list page
Custom product template with buy now code
📄 License
This extension is open source and released under the MIT License.
This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.