mageprince/module-buynow
Composer 安装命令:
composer require mageprince/module-buynow
包简介
Magento2 Buy Now Module
README 文档
README
Magento 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.
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
⚠️ 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.
Add Buy Now in custom template
If you wish to add the button to custom product templates, use following code snippet:
$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
🤝 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
Custom product template with buy now code
mageprince/module-buynow 适用场景与选型建议
mageprince/module-buynow 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.64k 次下载、GitHub Stars 达 82, 最近一次更新时间为 2018 年 08 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mageprince/module-buynow 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mageprince/module-buynow 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 82
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2018-08-03