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, no subscription

One coupon code for several rules
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?

Buy the module and we install it for you: free of charge for existing Degriz customers, by time spent for others. Building a new store? Add it to your project in the Konfigurator.

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 purchase we send you the access key by e-mail. Keep it 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? Write to us and we will issue a new one; the old one stops working. [email protected]

Technical details

Compatibility.

Just the facts.

Code
degriz_sharedcoupon
Platform
Magento 2
Licence
One-off
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

For existing Degriz customers we install the module free of charge. For other buyers we charge the installation by time spent.

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 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 production installation of Magento, no subscription.

Write to us

For existing Degriz customers we install the module free of charge, for others by time spent. 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] · 040 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