PHPackages                             code4business/freeproduct2 - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. code4business/freeproduct2

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

code4business/freeproduct2
==========================

Adds a sales rule action to add a product to cart. Can be used to create sales rules to add gifts to cart.

1.4.0(1mo ago)66175.0k↓33.9%31[4 issues](https://github.com/code4business/freeproduct2/issues)[1 PRs](https://github.com/code4business/freeproduct2/pulls)OSL-3.0PHPPHP ~7.4 || ~8.1

Since Nov 7Pushed 1mo ago9 watchersCompare

[ Source](https://github.com/code4business/freeproduct2)[ Packagist](https://packagist.org/packages/code4business/freeproduct2)[ Docs](https://github.com/code4business/freeproduct2)[ RSS](/packages/code4business-freeproduct2/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (2)Versions (19)Used By (0)

Freeproduct
===========

[](#freeproduct)

An extension that allows configuring sales rules to add free products to cart. This is the Magento 2 version of the same extension that can be found [here](https://github.com/code4business/freeproduct). The development and the function of the original Magento1 extension is described in the following two websites:

-
-

Contributors
------------

[](#contributors)

This repository is not run by code4business anymore, but Simon Sprankel and Ole Schäfer of CustomGento stepped up to keep freeproduct alive.

Requirements
------------

[](#requirements)

- PHP 7.4, PHP &gt;= 8.1
- Magento &gt;= 2.4.3-p1

Generally the last full release -1 version is tested and made to work. Older versions are not actively supported.

Supported Product Types
-----------------------

[](#supported-product-types)

The extension only supports simple and virtual product types, other types or custom options are not supported. The reason is that other product types need additional information that can only be added with IDs. This leads to a way more complicated module; we want to keep this module clean and easy.

Instalation
-----------

[](#instalation)

Go to the Magento 2 root directory and run the following commands in the shell:

```
composer require code4business/freeproduct2
bin/magento module:enable C4B_FreeProduct
bin/magento setup:upgrade

```

Configuration
-------------

[](#configuration)

Sales rules for carts are configured in *Marketing-&gt;Cart Price Rules*:

- In the Actions tab, the Apply field should be set to Add a Gift
- Gift SKU: Product that will be added. Only simple and virtual products without (required) custom options are supported. Multiple comma-separated SKUs can be specified
- Discount Amount: The qty of added gifts
- The gift item is added once for the whole cart

Action **Add a Gift (for each cart item)** works similarly but will add the gift item for each product in cart. The qty of said product is also taken into consideration.

This action usually needs conditions to match only specific items *(Apply the rule only to cart items matching the following conditions)*.

Limitations:
------------

[](#limitations)

- Gift products are added during discount total processing, after subtotal and shipping totals. Because of that gift products will not be included in any shipping calculations.
- Only simple and virtual products without required custom options are supported.

Current localizations:
----------------------

[](#current-localizations)

- de\_DE
- es\_ES
- fr\_FR
- nl\_NL
- pt\_PT
- sl\_SI

License
-------

[](#license)

[Open Software Licence 3.0 (OSL-3.0)](http://opensource.org/licenses/osl-3.0.php)

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance91

Actively maintained with recent releases

Popularity48

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 67.7% 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 ~208 days

Recently: every ~346 days

Total

16

Last Release

37d ago

PHP version history (4 changes)1.0.0PHP &gt;=7.0

1.2.0PHP &gt;=7.1

1.3.0-betaPHP ~7.1 || ~8.1

1.4.0PHP ~7.4 || ~8.1

### Community

Maintainers

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

---

Top Contributors

[![domeglic](https://avatars.githubusercontent.com/u/8225737?v=4)](https://github.com/domeglic "domeglic (42 commits)")[![kapilpandya22](https://avatars.githubusercontent.com/u/191165783?v=4)](https://github.com/kapilpandya22 "kapilpandya22 (9 commits)")[![AurelienLavorel](https://avatars.githubusercontent.com/u/5844661?v=4)](https://github.com/AurelienLavorel "AurelienLavorel (2 commits)")[![peterjaap](https://avatars.githubusercontent.com/u/431360?v=4)](https://github.com/peterjaap "peterjaap (2 commits)")[![amenk](https://avatars.githubusercontent.com/u/1087128?v=4)](https://github.com/amenk "amenk (2 commits)")[![sprankhub](https://avatars.githubusercontent.com/u/930199?v=4)](https://github.com/sprankhub "sprankhub (1 commits)")[![Crissov](https://avatars.githubusercontent.com/u/6200185?v=4)](https://github.com/Crissov "Crissov (1 commits)")[![krambrock](https://avatars.githubusercontent.com/u/662074?v=4)](https://github.com/krambrock "krambrock (1 commits)")[![laurent35240](https://avatars.githubusercontent.com/u/473193?v=4)](https://github.com/laurent35240 "laurent35240 (1 commits)")[![solangegamboa](https://avatars.githubusercontent.com/u/3474054?v=4)](https://github.com/solangegamboa "solangegamboa (1 commits)")

---

Tags

magento2gift sales rule

### Embed Badge

![Health badge](/badges/code4business-freeproduct2/health.svg)

```
[![Health](https://phpackages.com/badges/code4business-freeproduct2/health.svg)](https://phpackages.com/packages/code4business-freeproduct2)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[magepal/magento2-googletagmanager

Google Tag Manager (GTM) for Magento 2 with Advance Data Layer

2691.6M5](/packages/magepal-magento2-googletagmanager)[boldcommerce/magento2-ordercomments

Magento 2 Module to add a comment field above the place order button in the checkout

170768.1k](/packages/boldcommerce-magento2-ordercomments)[mageplaza/magento-2-blog-extension

Magento 2 Blog extension

122748.9k5](/packages/mageplaza-magento-2-blog-extension)[magemojo/m2-ce-cron

Replacement package for Magento 2 Cron Functionality

163331.1k](/packages/magemojo-m2-ce-cron)[magepal/magento2-reindex

Reindex your Magento2 store quickly and easily from backend/admin, instead of command line.

111705.0k1](/packages/magepal-magento2-reindex)

PHPackages © 2026

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