mageprince / module-buynow

mageprince/module-buynow

Magento2 Buy Now Module

  • Prince Patel
magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass MIT

Are you the maintainer of mageprince?

Packagento pulls mageprince's Composer packages from the public registry so buyers can find them here.

Claim the namespace to take ownership, publish new releases directly, and start charging for premium versions.

Claim this namespace →

Magento 2 Buy Now

Latest Stable Version Total Downloads Monthly Downloads Magento 2.4 Hyvä compatible Mage-OS compatible License

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ä Hyvä Theme compatible – works out of the box on Hyvä, no compat module needed.

Mage-OS 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 $_item to the current product object.
  • Hyvä theme: use the template Mageprince_BuyNow::hyva/buynow.phtml instead. 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

5ad4baf6-5897-4ea4-adda-8244126524c3

🤝 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

Product list page

Product List Page

Custom product template with buy now code

Custom Product Template

📄 License

This extension is open source and released under the MIT License.

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
1.5.0 stable Fail Magento 2.4.7-2.4.9 Details 2026-10-21 17:53:56
1.4.0 stable Fail Not yet tested Details 2024-05-12 05:45:59
1.3.0 stable Not tested Not yet tested Details 2020-03-22 10:29:08
1.2.0 stable Not tested Not yet tested Details 2019-10-13 08:23:28
1.1.0 stable Not tested Not yet tested Details 2018-08-26 16:07:44
1.0.0 stable Not tested Not yet tested Details 2018-08-03 18:25:04

No dependencies declared

This package's composer.json doesn't declare any required, suggested, replaced, or conflicting packages.

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 7 7 warnings (ruleset: Magento2), 7 auto-fixable with phpcbf
PHPMD Pass 0
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (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.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 6 6
2.4.8 6 6
2.4.9 6 6

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
Homepage
https://github.com/mageprince/magento2-buynow
Authors

More from mageprince

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.