Magento Free Gift with Purchase

Magento free gift with purchase, set up in Magento 2 cart price rules: free products added automatically or chosen by the customer, spend-more notices, gift labels and a report of gifts given. Luma and Hyvä.

  • Magento 2.4.6 – 2.4.9
  • PHP 8.2 – 8.5
  • Hyvä and Luma
  • Version 2.2.0
$169

One-off payment, with 12 months of updates.

What is included

  • Install with Composer, or download a zip from your account
  • Licence for one production domain, staging and development copies included

No subscription or automatic renewal. Keep using the versions included in your update period. Update and licence details

Key features

  • Two new cart price rule actions for gifts
  • Automatic gifts or a gift choice on the cart page
  • Buy X get Y, also at a discount
See all features

Composer package commercegears/module-free-gift

  • Uses the rules you know

    A gift offer is a normal cart price rule: websites, customer groups, dates, coupons, conditions and priority work as usual.

  • Raises the basket value

    The spend-more notice and progress bar show shoppers how far they are from a gift, on the product page, the cart or the top of every page.

  • Gifts stay gifts

    Gift lines are checked whenever the cart totals are collected, also through REST and GraphQL, and their quantity is set by the offer.

All features

What is included

Gift offers

  • "Free gift: add gifts automatically"
  • "Free gift: customer chooses gifts from a list"
  • One or more gift SKUs per rule
  • Buy X get Y and a maximum per cart
  • Free, percentage off, amount off or fixed price

In the cart

  • Gifts added, updated and removed as the cart changes
  • Gift quantity set by the offer
  • Removed gifts stay removed, with "Add it back"
  • Notice when a gift no longer applies
  • Out-of-stock and disabled gifts skipped

Storefront

  • Gift choice on the cart page
  • "You can choose a free gift" in the mini cart
  • Spend-more notice with progress bar
  • "Free gift" label on gift lines everywhere
  • Guest and customer carts, merged without duplicates

Admin and developers

  • Gifts Given report with CSV and XML export
  • CLI to check the gift SKUs of every rule
  • Gift lines checked in REST and GraphQL carts
  • Settings per store view
  • Service contract for gift settings

Feature tour

Everything your shoppers and your team see

01 / 06

Show how close the gift is

"Spend £100.00 more to get a free gift." with a progress bar, on the product page, the cart page or the top of every page.

02 / 06

Added to the cart as soon as the rule applies

The gift appears as its own line at the gift price, labelled with the offer, and is removed again when the cart no longer qualifies.

03 / 06

Let customers pick their gift

The cart page lists the gifts of a "customer chooses" rule. Configurable gifts get a size and colour choice.

04 / 06

Native Hyvä templates

Alpine.js and Tailwind templates for the gift choice, the notice and the mini cart. The Hyvä checkout uses the Luma checkout fallback.

05 / 06

Made for small screens

Gift cards stack into one column on phones, with full-width buttons.

06 / 06

A Free Gift section in the rule form

Gift SKUs, number of gifts, for every X items bought, maximum times per cart and the gift price: free, percentage off, amount off or a fixed price.

Live demo

Try it before you install it

A full Magento store with the module installed, on Luma and on Hyvä. The admin demo signs you in with one click.

Compatibility

Requirements and compatibility

Compatibility of Free Gift
Magento2.4.6 – 2.4.9
PlatformsMagento Open Source and Adobe Commerce (one price)
Storefront themes Luma Blank Hyvä
PHP8.2 – 8.5
Latest version 2.2.0
composer.json requires php ~8.2.0||~8.3.0||~8.4.0||~8.5.0 magento/framework ~103.0.6 commercegears/module-core ^2.2 free, installed by Composer with this module magento/module-backend * magento/module-catalog * magento/module-catalog-inventory * magento/module-checkout * magento/module-config * magento/module-configurable-product * magento/module-customer * magento/module-quote * magento/module-sales * magento/module-sales-rule * magento/module-store * magento/module-ui *

Installation

Up and running in minutes

After you buy, create a Composer key in your account. Then, in the root of your Magento project:

  1. 01Add the repository and your key (once per project)

    composer config repositories.commercegears composer https://repo.commercegears.com
    composer config --auth http-basic.repo.commercegears.com PUBLIC_KEY PRIVATE_KEY
  2. 02Install the module

    composer require commercegears/module-free-gift
  3. 03Enable it

    bin/magento setup:upgrade
    bin/magento setup:di:compile
    bin/magento setup:static-content:deploy
    bin/magento cache:flush

    The last three are only needed in production mode.

Prefer a zip? Every version you are entitled to can be downloaded from My modules. More about Composer access

User guide

Setting up Magento Free Gift with Purchase

The user guide has its own page: how to install Magento Free Gift with Purchase, what each option does and how to use it in your store. Written for version 2.2.0; a copy ships with the module.

In the guide

Read the user guide

Changelog

Release notes

2.2.0

Latest
  • Improvement: cart, mini cart and product notices match the other CommerceGears promo boxes.
  • Improvement: colours follow your Luma or Hyvä theme.
  • New: German translation of the gift chooser and notices.

2.1.1

  • Fix: Luma cart: the order summary and checkout button no longer scroll out of reach

2.1.0

  • Fix: the spend-more notice counts only the products the gift offer applies to
  • New: gift thresholds for other modules, e.g. the Cart Progress Bar shows the same amount as the notice
  • Improvement: Magento 2.4.6 supported

2.0.1

  • Improvement: user guide screenshots and links updated for the CommerceGears name

2.0.0

  • Improvement: renamed to CommerceGears (new Composer package, admin menu and settings paths)

FAQ

Questions, answered

Something else on your mind? The developers who wrote the module answer before and after you buy.

Ask a question →

Already installed it? Open a support ticket

How do I create a free gift offer?

Create a cart price rule under Marketing > Cart Price Rules and choose one of the two gift actions under Actions > Apply: "Free gift: add gifts automatically" or "Free gift: customer chooses gifts from a list". Then enter the gift SKUs in the rule's Free Gift section. Websites, customer groups, dates, coupons, conditions and priority work exactly as for any other cart price rule.

What is the difference between the two actions?

"Add gifts automatically" puts the gift SKUs in the cart as soon as the rule applies. "Customer chooses gifts from a list" shows the gifts on the cart page and the customer picks as many as the rule allows.

Can I run "buy X, get Y" offers?

Yes. Set For Every X Items Bought, for example 2: the gifts are given for every 2 qualifying items (buy 2 get 1, buy 4 get 2). The rule's "Apply the rule only to cart items matching the following conditions" decides which items count. Maximum Times per Cart caps the number of times.

Does the gift have to be free?

No. Gift Price can be free (100% off), a percentage off the gift price, a fixed amount off, or a fixed price, so offers such as "buy one, get the second at 50%" are possible.

Which products can be gifts?

Simple and virtual products (automatic or chosen) and configurable products (chosen, with a size or colour choice on the cart page). Bundle, grouped, downloadable products with links and products with required custom options cannot be gifts. Gifts that are out of stock, disabled or not assigned to the website are skipped.

Can customers change the quantity of a gift?

No. The quantity is set by the offer: the quantity field of a gift line is read-only and larger quantities are reset with a notice.

What happens if a customer removes an automatic gift?

It stays removed for that cart and the cart page offers "Add it back". If you prefer, set Add Removed Gifts Again to Yes and the gift is added again whenever the cart changes.

What happens when the cart no longer qualifies?

The gift line is removed and the cart shows "The free gift (name) has been removed because the offer no longer applies to your cart." This happens for any reason the rule stops applying, for example the subtotal falls below the threshold or a coupon is removed.

How does the "Spend £X more" notice work?

It is based on active gift rules without a coupon whose conditions contain a top-level subtotal condition ("equals or greater than" or "greater than"). It shows the amount still to spend and, optionally, a progress bar, on the product page, the cart page and/or the top of every page. Other conditions of those rules are not evaluated for the notice. When the offer has "Apply to" conditions, the notice counts only the products the offer applies to (Magento 2.4.9 and later, where the offer itself counts only those products); gift lines never count. It is loaded through customer data, so pages stay in the full-page cache.

Are totals, tax and currencies right?

Gift lines are separate cart lines priced through a custom price (0 for free gifts), so subtotal, tax and grand total are right in every currency. Gift lines are not discounted by other rules and do not count towards any rule conditions, so a gift cannot keep its own rule valid.

Can a gift be kept through the API or by reordering?

Gift lines are checked again whenever cart totals are collected, also through REST and GraphQL (cart items, coupons, payment information and order placement). "Reorder" and adding a former gift from a wish list are refused with a message; the offer adds the gift again itself when it applies.

Does it work with Hyvä?

Yes. Hyvä templates are included for the gift choice, the notice and the mini cart (Hyvä 1.3 and later). Hyvä Checkout is not supported; the Luma checkout fallback is.

What is not supported?

Orders created in the admin do not get gifts added, multishipping checkout is not supported for gift lines, and gift settings are not part of the cart price rule REST API (they are kept when a rule is saved through the API).

Which Magento and PHP versions are supported?

Magento Open Source and Adobe Commerce 2.4.6 to 2.4.9, PHP 8.2 to 8.5.

Support

Help from the developers who wrote it

From the blog

Guides and articles