bogo / module-buyonegetone
Buy One Get One Free module for Magento 2
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:magento2-module
Requires
- php: ~8.2.0||~8.3.0
- magento/framework: 103.0.*
- magento/module-catalog: 104.0.*
- magento/module-checkout: 100.4.*
- dev-main
- 1.5.32
- 1.5.31
- 1.5.30
- 1.5.29
- 1.5.28
- 1.5.27
- 1.5.26
- 1.5.25
- 1.5.24
- 1.5.23
- 1.5.22
- 1.5.21
- 1.5.20
- 1.5.19
- 1.5.18
- 1.5.17
- 1.5.16
- 1.5.15
- 1.5.14
- 1.5.13
- 1.5.12
- 1.5.11
- 1.5.10
- 1.5.9
- 1.5.8
- 1.5.7
- 1.5.6
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.4.9
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- dev-feature/bogo-redesign
- dev-develop
This package is auto-updated.
Last update: 2025-05-04 05:52:20 UTC
README
This module adds Buy One Get One Free (BOGO) functionality to your Magento 2.4.7 store.
Features
- Enable/disable BOGO offers per product
- Configure eligible customer groups
- Set maximum number of free items per product
- Schedule BOGO offers with start/end dates
- Automatic stock checking
- Custom BOGO labels on products
- Compatible with Magento 2.4.7
- Supports PHP 8.2 and 8.3
Installation
# 清除composer缓存 composer clearcache # 添加GitHub仓库(这样可以立即获取最新版本) composer config repositories.bogo vcs https://github.com/rigdoge/magento-bogo.git # 安装新版本 composer require "bogo/module-buyonegetone:1.4.4" # 清理缓存并重新编译 rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* var/generation/* generated/* php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f
1. Using Composer (Recommended)
在你的 Magento 项目的根目录下运行:
# 方法 1:直接安装(推荐) composer require bogo/module-buyonegetone # 方法 2:如果需要指定版本 composer require bogo/module-buyonegetone:1.4.0 # 方法 3:如果遇到冲突,可以先添加依赖再更新 composer require bogo/module-buyonegetone --no-update composer update bogo/module-buyonegetone --with-dependencies
注意:
- 确保你的
composer.json
中已经配置了https://repo.magento.com/
- 如果安装特定版本,建议使用最新的稳定版本(当前是 1.4.0)
2. Enable the Module
After installation, enable the module by running:
bin/magento module:enable Bogo_BuyOneGetOne bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
Version Compatibility
Magento Version | Module Version | PHP Version |
---|---|---|
2.4.7 | 1.1.x | 8.2, 8.3 |
Troubleshooting
If you encounter any issues during installation:
-
Clear the cache:
bin/magento cache:flush
-
If you see composer conflicts, try:
# 只更新 BOGO 模块和其依赖 composer update bogo/module-buyonegetone --with-dependencies # 或者清理 composer 缓存后重试 composer clearcache composer require bogo/module-buyonegetone
-
For permission issues:
chmod -R 777 var/ generated/ pub/static/
Version History
v1.1.2 (Latest)
- Fixed BOGO items not being added correctly for subsequent cart additions
- Improved handling of new item detection
- Optimized cart update logic
v1.1.1
- Fixed issue with BOGO items not being added on subsequent cart updates
- Optimized cart item handling logic
- Removed redundant code and improved maintainability
v1.1.0
- Major refactor: improved cart handling
- Replaced observer with plugin for better performance
- Fixed free item quantity synchronization
- Improved handling of multiple cart updates
v1.0.2
- Fixed free item quantity calculation
- Added maximum items limit enforcement
v1.0.1
- Fixed cart item addition issues
- Improved error handling
v1.0.0
- Initial stable release
Installation
Via Composer
Version Constraints Explained
^1.1.0
: Installs the latest stable version >= 1.1.0 and < 2.0.0 (Recommended)~1.1.0
: Installs the latest stable version >= 1.1.0 and < 1.2.01.1.0
: Installs exactly version 1.1.0*
: Installs the latest version (including breaking changes)dev-develop
: Installs the latest development code
Install Latest Stable Version (Recommended)
composer require bogo/module-buyonegetone:^1.1.0
Install Specific Version
composer require bogo/module-buyonegetone:1.1.0
Install Development Version
composer require bogo/module-buyonegetone:dev-develop
Post-Installation Steps
bin/magento module:enable Bogo_BuyOneGetOne bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
Upgrade
Understanding Upgrade Commands
composer update
composer update bogo/module-buyonegetone
This command updates the package based on the version constraint in your composer.json:
- If you have
^1.0.0
: Updates to latest 1.x.x version - If you have
~1.0.0
: Updates to latest 1.0.x version - If you have
*
: Updates to the latest version - If you have
dev-develop
: Updates to latest development code
composer require
composer require bogo/module-buyonegetone:^1.1.0
This command explicitly updates to the specified version constraint, regardless of what's in your composer.json
Regular Upgrade (Based on composer.json)
composer update bogo/module-buyonegetone bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
Upgrade to Latest Version (Recommended)
composer require bogo/module-buyonegetone:^1.1.0 bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
Switch to Development Version
composer require bogo/module-buyonegetone:dev-develop bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
Uninstallation
Method 1: Remove via Composer
# Disable the module bin/magento module:disable Bogo_BuyOneGetOne # Remove the module composer remove bogo/module-buyonegetone # Clean up bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
Method 2: Manual Cleanup
# Disable the module bin/magento module:disable Bogo_BuyOneGetOne # Remove module files rm -rf app/code/Bogo/BuyOneGetOne # Remove module from config rm -f app/etc/config.php bin/magento module:enable --all # Clean up bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
Configuration
- Go to Admin > Stores > Configuration > Papa BOGO Extensions > Buy One Get One Free
- Enable the module and configure:
- Customer groups
- Maximum free items
- Active date range
- Display settings
Product Configuration
- Edit a product in Admin > Catalog > Products
- Find "Enable Buy One Get One Free" under the Promotions tab
- Set to "Yes" to enable BOGO for the product
Troubleshooting
After Installation/Upgrade
- Clear cache and generated files:
rm -rf var/cache/* var/page_cache/* generated/* bin/magento cache:clean bin/magento cache:flush
- If you see 404 errors in admin:
bin/magento setup:static-content:deploy
After Uninstallation
- If you experience any issues after uninstallation, clear all caches:
rm -rf var/cache/* var/page_cache/* generated/* bin/magento cache:clean bin/magento cache:flush
Requirements
- Magento 2.4.7
- PHP ~8.2.0 || ~8.3.0
Support
For support, please email support@tschenfeng.com
License
This project is licensed under the MIT License - see the LICENSE file for details.