PHPackages                             bogo/module-buyonegetone - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bogo/module-buyonegetone

ActiveMagento2-module

bogo/module-buyonegetone
========================

Buy One Get One Free module for Magento 2

1.5.32(1y ago)1191MITPHPPHP ~8.2.0||~8.3.0

Since Feb 2Pushed 1y ago2 watchersCompare

[ Source](https://github.com/rigdoge/magento-bogo)[ Packagist](https://packagist.org/packages/bogo/module-buyonegetone)[ Docs](https://github.com/rigdoge/magento-bogo)[ RSS](/packages/bogo-module-buyonegetone/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (59)Used By (0)

Magento 2 Buy One Get One Free Module
=====================================

[](#magento-2-buy-one-get-one-free-module)

This module adds Buy One Get One Free (BOGO) functionality to your Magento 2.4.7 store.

Features
--------

[](#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
------------

[](#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)

[](#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

[](#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

[](#version-compatibility)

Magento VersionModule VersionPHP Version2.4.71.1.x8.2, 8.3### Troubleshooting

[](#troubleshooting)

If you encounter any issues during installation:

1. Clear the cache:

    ```
    bin/magento cache:flush
    ```
2. If you see composer conflicts, try:

    ```
    # 只更新 BOGO 模块和其依赖
    composer update bogo/module-buyonegetone --with-dependencies

    # 或者清理 composer 缓存后重试
    composer clearcache
    composer require bogo/module-buyonegetone
    ```
3. For permission issues:

    ```
    chmod -R 777 var/ generated/ pub/static/
    ```

Version History
---------------

[](#version-history)

### v1.1.2 (Latest)

[](#v112-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

[](#v111)

- 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

[](#v110)

- 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

[](#v102)

- Fixed free item quantity calculation
- Added maximum items limit enforcement

### v1.0.1

[](#v101)

- Fixed cart item addition issues
- Improved error handling

### v1.0.0

[](#v100)

- Initial stable release

Installation
------------

[](#installation-1)

### Via Composer

[](#via-composer)

#### Version Constraints Explained

[](#version-constraints-explained)

- `^1.1.0`: Installs the latest stable version &gt;= 1.1.0 and &lt; 2.0.0 (Recommended)
- `~1.1.0`: Installs the latest stable version &gt;= 1.1.0 and &lt; 1.2.0
- `1.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)

[](#install-latest-stable-version-recommended)

```
composer require bogo/module-buyonegetone:^1.1.0
```

#### Install Specific Version

[](#install-specific-version)

```
composer require bogo/module-buyonegetone:1.1.0
```

#### Install Development Version

[](#install-development-version)

```
composer require bogo/module-buyonegetone:dev-develop
```

#### Post-Installation Steps

[](#post-installation-steps)

```
bin/magento module:enable Bogo_BuyOneGetOne
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
```

Upgrade
-------

[](#upgrade)

### Understanding Upgrade Commands

[](#understanding-upgrade-commands)

#### composer update

[](#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)

```
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)

[](#regular-upgrade-based-on-composerjson)

```
composer update bogo/module-buyonegetone
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
```

### Upgrade to Latest Version (Recommended)

[](#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

[](#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
--------------

[](#uninstallation)

### Method 1: Remove via Composer

[](#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

[](#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
-------------

[](#configuration)

1. Go to Admin &gt; Stores &gt; Configuration &gt; Papa BOGO Extensions &gt; Buy One Get One Free
2. Enable the module and configure:
    - Customer groups
    - Maximum free items
    - Active date range
    - Display settings

Product Configuration
---------------------

[](#product-configuration)

1. Edit a product in Admin &gt; Catalog &gt; Products
2. Find "Enable Buy One Get One Free" under the Promotions tab
3. Set to "Yes" to enable BOGO for the product

Troubleshooting
---------------

[](#troubleshooting-1)

### After Installation/Upgrade

[](#after-installationupgrade)

- 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

[](#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
------------

[](#requirements)

- Magento 2.4.7
- PHP ~8.2.0 || ~8.3.0

Support
-------

[](#support)

For support, please email

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance42

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

56

Last Release

462d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f0faf7a1450fc1ab820f4c206a676ad505f812bfe05c15a911d98ee607d4dec9?d=identicon)[tschenfeng](/maintainers/tschenfeng)

---

Top Contributors

[![rigdoge](https://avatars.githubusercontent.com/u/118411883?v=4)](https://github.com/rigdoge "rigdoge (163 commits)")

---

Tags

magento2magento2 modulemagento2 extensionbogobuy-one-get-one

### Embed Badge

![Health badge](/badges/bogo-module-buyonegetone/health.svg)

```
[![Health](https://phpackages.com/badges/bogo-module-buyonegetone/health.svg)](https://phpackages.com/packages/bogo-module-buyonegetone)
```

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.5M33](/packages/smile-elasticsuite)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[hyva-themes/magento2-react-checkout

Highly customizable Magento 2 Checkout, built with React

189169.8k1](/packages/hyva-themes-magento2-react-checkout)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69344.4k](/packages/run-as-root-magento2-prometheus-exporter)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[swissup/module-search-mysql-legacy

Legacy mysql search for magento 2.4

10483.0k](/packages/swissup-module-search-mysql-legacy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
