mageprince / module-buynow

mageprince/module-buynow

Magento2 Buy Now Module

  • Prince Patel
magento2-module 2.4.6-2.4.9 Compatible Based on composer requirements only QA: failed GPL-3.0-or-later

Latest Stable Version
Total Downloads
Monthly Downloads
License
Scrutinizer Code Quality
Code Intelligence Status

Magento 2 Buy Now

The Buy Now extension for Magento 2 enhances the shopping experience by allowing customers to make instant purchases with a single click. It adds a "Buy Now" button to product pages, enabling customers to bypass the cart and proceed directly to the checkout page.

Admin Configuration: Admin > Stores > Configuration > MagePrince > Buy Now

How to install

1. Install via composer (packagist.org)

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

Notice

We do not provide support for placing the Buy Now button on related, upsell, wishlist, or any other locations, as it requires overriding core phtml files, which isn't a good idea for an extension. Please be aware that many paid or free versions of the Buy Now module override these core files. Instead, use this piece of code to add the Buy Now button to custom product templates.

$buyNowBtnHtml = $this->getLayout()
    ->createBlock(\Mageprince\BuyNow\Block\Product\ListProduct::class)
    ->setProduct($_item)
    ->setButtonTitle('Buy Now')
    ->setTemplate('Mageprince_BuyNow::buynow.phtml')
    ->toHtml();
echo $buyNowBtnHtml;

Change $_item to current product object.

You can use the code above to display the Buy Now button wherever you want on your product page. Just remember not to paste this code into the add to cart form or any other form. Put the code after </form> tag. Below is a screenshot showing how to use the code.

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.

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

No changelog yet

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

Versions
Version Stability QA Status Released
1.4.0 stable Fail 2024-05-12 05:45:59
1.3.0 stable Not tested 2020-03-22 10:29:08
1.2.0 stable Not tested 2019-10-13 08:23:28
1.1.0 stable Not tested 2018-08-26 16:07:44
1.0.0 stable Not tested 2018-08-03 18:25:04

No dependencies declared

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

QA results
Tool Status Findings Summary
PHPCS Pass 0
PHPStan Fail 7 7 errors (level 4, ruleset: phpstan + bitexpert/phpstan-magento)
Cpd Pass 0
Security Pass 0
License
GPL-3.0-or-later
Homepage
https://github.com/mageprince/magento2-buynow
Authors
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.