All modulesMagento 2 module

One coupon code for several rules

The same coupon code triggers several cart rules, for example a different discount for 1, 2, 3 or 4 pieces.

€150 + VAT · one-off licence, installation optional

www.degriz.eu
One coupon code for several rules: the setup in a cart rule and the effect in the cart
About the module

What it does.

"We want one code for everything, but with a different discount depending on quantity." Magento allows a coupon code on only one rule, so you have to invent a different code for each discount step.

What it looks like in practice

You announce a promotion with the code TONER. One piece gets 5% off, two get 10%, three get 15%. You create three cart price rules with different conditions and enter the same shared code on all of them. The shopper types TONER and the cart applies the rule that matches their quantity.

What changes

  • One code, several rules. You add a "Shared coupon code" to a rule; when a shopper enters that code, all rules with it apply, each with its own conditions.
  • The code is valid if at least one rule matches. The shopper does not get an "invalid code" message if at least one of the rules fits.
  • All rules stay yours. Conditions, discounts, dates and customer groups remain on each rule separately.
  • No theme changes. The calculation happens on the server, so the code works in the cart, at checkout and for orders created in the admin.

Who it is for

For stores that run quantity or tiered promotions with a single code, and for stores that already had the same code on several rules and want to keep it.

How you set it up

You edit the cart price rule in the admin under Marketing › Cart Price Rules. The module adds one field to the rule form and has no other settings or menu. It works with all themes because the calculation happens on the server.

Good to know

  • A rule that already has the code entered stays as it is; for the other rules set the coupon to "Specific Coupon" and leave their own code empty if the form allows it (otherwise use automatic code generation).
  • The rules must be of the "Specific Coupon" type; rules without a coupon do not take part.
  • Normal Magento rules apply: whether rules exclude or continue each other is decided by their priority and the "Discard subsequent rules" setting.
  • The module does not create codes or show them to the customer; it is an addition, not a whole promotion solution.

Want it in your store?

Install it yourself or choose installation and configuration when you order. Building a new store? Add it to your project in the Konfigurator.

Screens

Take a look at every step.

www.degriz.eu
In the cart rule you enter the shared code; the rule's own code stays empty
www.degriz.eu
Every rule keeps its own action, e.g. one takes a percentage off and another grants free shipping
www.degriz.eu
The shopper enters one code and the cart gets both the discount and free shipping
Installation

How to install it.

We install the module from our repository with Composer. We send you the user name and access key for the repository after purchase. If you prefer, we install it for you.

In the root of the Magento 2 store run the commands (replace UPORABNIK and DOSTOPNI_KLJUC with the user name and access key you received):

composer config repositories.degriz composer https://www.degriz.net/konfigurator/composer/packages/composer config --auth http-basic.www.degriz.net UPORABNIK DOSTOPNI_KLJUCcomposer require degriznet/m2_sharedcouponphp bin/magento module:enable Magelan_SharedCouponphp bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento setup:static-content:deploy -fphp bin/magento cache:flush

Setup

In the admin open Marketing › Cart Price Rules.

  1. Create the rules for the individual steps (for example 1, 2, 3 and 4 pieces), each with its own conditions and discount.
  2. On all rules choose Coupon: Specific Coupon and enter the same code in Shared coupon code.
  3. On one rule you can also enter the code in the usual coupon code field; leave the own code empty on the others.
  4. Save, flush the cache and try the code in the cart with different quantities.

Where do I get the user name and the access key?

After the payment we e-mail you a link to create the access key. Keep the key safe: for security it is shown only once and we do not keep it in readable form. The user name (your project code) and all the commands, ready to copy, are in your account under My account > Module licences.

Lost the key? Create a new one in your account under Module licences; the old one stops working.

Technical details

Compatibility.

Just the facts.

Code
degriz_sharedcoupon
Platform
Magento 2
Licence
One-off
Change log

Version 1.0.2 · 24 Nov 2026

  • Clearer instructions on the Shared coupon code field: Specific Coupon with Use Auto Generation ticked, plus a reminder about customer groups, usage limits and the shipping discount.

Version 1.0.0 · 7 Oct 2026

  • First release: one coupon code for several cart price rules; when the customer enters the code, all rules with that shared code apply, each with its own conditions.
After purchase

You are not left alone.

We develop and maintain the module ourselves, so you write to the people who know it line by line.

Installation

Installation and configuration are optional: choose them when you order and the price is added to the order (+ VAT). If more time is needed, we bill the rest separately.

Support

A bug that repeats on a clean Magento with the Luma theme we fix free of charge. Settings, customisations and other themes by time spent.

Updates

The licence includes 12 months of free updates for the Magento versions on the supported list.

We agree on a date after reviewing the request. User guides in the guide centre

One coupon code for several rules

€150 + VAT

One-off licence for one store, no subscription. Installation and configuration are optional.

After payment you get the licence and access to our private repository: immediately with a card or PayPal, with a bank transfer (UPN) as soon as we receive the payment. 12 months of free updates are included.

Write to us

Install it yourself by following the guide, or choose installation and configuration above. If more time is needed, we bill the rest separately. We agree on a date after reviewing the request.

Anže Voh, Degriz

Questions about this module?

Write to us and we will answer personally.

[email protected] · +386 40 807 231

One coupon code for several rules€150 + VATAdd to cart

Online store configurator

Redesigning your store or building a new one?

Put your own quote together in the configurator and see the price straight away. A few minutes, no obligation, no meeting needed.

  • Price straight away
  • No obligation
  • Straight to the developer
Open the configurator

Free and with no obligation

We use cookies for the proper functioning of the site, visit analytics and showing ads tailored to your interests. Read more in our privacy policy. By clicking "Accept all" you agree to the use of all cookies.