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.3.2(3y ago)65167.1k↓16.8%30[4 issues](https://github.com/code4business/freeproduct2/issues)[1 PRs](https://github.com/code4business/freeproduct2/pulls)OSL-3.0PHPPHP ~7.1 || ~8.1

Since Nov 7Pushed 3y 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 1mo ago

READMEChangelog (4)Dependencies (1)Versions (18)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:

-
-

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

[](#requirements)

- PHP 7.4, 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

46

—

FairBetter than 93% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 82.4% 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 ~141 days

Recently: every ~212 days

Total

15

Last Release

1139d ago

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

1.2.0PHP &gt;=7.1

1.3.0-betaPHP ~7.1 || ~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)")[![AurelienLavorel](https://avatars.githubusercontent.com/u/5844661?v=4)](https://github.com/AurelienLavorel "AurelienLavorel (2 commits)")[![amenk](https://avatars.githubusercontent.com/u/1087128?v=4)](https://github.com/amenk "amenk (2 commits)")[![peterjaap](https://avatars.githubusercontent.com/u/431360?v=4)](https://github.com/peterjaap "peterjaap (2 commits)")[![Crissov](https://avatars.githubusercontent.com/u/6200185?v=4)](https://github.com/Crissov "Crissov (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

[magepal/magento2-googletagmanager

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

2671.5M4](/packages/magepal-magento2-googletagmanager)[mageplaza/magento-2-blog-extension

Magento 2 Blog extension

123708.2k5](/packages/mageplaza-magento-2-blog-extension)[magepal/magento2-reindex

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

112649.7k1](/packages/magepal-magento2-reindex)[lillik/magento2-price-decimal

Magento 2 Price Decimal Precision

111147.5k](/packages/lillik-magento2-price-decimal)[opengento/module-gdpr

Gdpr Compliance Module for Magento 2

14481.5k](/packages/opengento-module-gdpr)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

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

PHPackages © 2026

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