PHPackages                             doroshko/wish-reward - 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. doroshko/wish-reward

ActiveMagento2-module

doroshko/wish-reward
====================

A module that provides functionality for collecting wishes from customers and rewards them with a discount, which they receive by spinning a wheel of fortune

1.0.1(1y ago)34MITJavaScriptPHP ~7.4.3|~8.0.0

Since Dec 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/FrankieSR/WishReward)[ Packagist](https://packagist.org/packages/doroshko/wish-reward)[ RSS](/packages/doroshko-wish-reward/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Magento 2 Module: Christmas &amp; New Year Wish with Lottery Wheel
==================================================================

[](#magento-2-module-christmas--new-year-wish-with-lottery-wheel)

This module for **Magento 2** implements the following functionality:
A customer writes a Christmas or New Year wish, which is validated using a trained model (currently supports validation only for English greetings). After the wish is validated, the customer gets an opportunity to spin a lottery wheel and potentially win a discount, or they can receive a fixed discount for their wish (configurable in the admin panel).

Initial CTA modal

[![Customer Wish Reward](docs/images/cta-example.png "CTA Example")](docs/images/cta-example.png)

Main modal

[![Customer Wish Reward](docs/images/modal-example.png "Modal Example")](docs/images/modal-example.png)

---

How to install a module
-----------------------

[](#how-to-install-a-module)

`composer require doroshko/wish-reward`

or

`git clone git@github.com:FrankieSR/WishReward.git app/code/Doroshko/WishReward`

then `bin/magento mod:en Doroshko_WishReward``bin/magento setup:upgrade`

---

Features
--------

[](#features)

1. **Wish Submission and Validation**

    - Customers can write their Christmas or New Year wishes.
    - Wishes are validated using a trained machine learning model (currently supports English greetings only).
2. **Lottery Wheel Functionality**

    - If enabled, customers can spin a lottery wheel with customizable sectors to win discounts.
3. **Fixed Discount Option**

    - If the lottery wheel is disabled, a fixed discount is applied based on a pre-configured cart price rule.

---

Admin Settings
--------------

[](#admin-settings)

The module includes the following settings configurable in the Magento 2 admin panel:

### **General Settings**

[](#general-settings)

1. **Enable Module**:

    - Enables or disables the module.
2. **Enable Lottery Wheel**:

    - Enables or disables the lottery wheel.
    - If disabled, a fixed discount is applied based on the `Default Rule ID`.
3. **Default Rule ID**:

    - Specifies the default cart price rule ID to apply if the lottery wheel is disabled.
4. **Wheel Sectors**:

    - Customizable sectors for the lottery wheel.

---

### **Wheel Sectors Configuration**

[](#wheel-sectors-configuration)

The `Wheel Sectors` field allows you to define the sectors of the lottery wheel with the following customizable attributes:

- **label**: Text displayed on the sector (e.g., "10% Discount").
- **rule\_id**: Cart price rule ID associated with the sector (null for non-winning sectors).
- **probability**: Probability of the sector being selected.
- **color** *(optional)*: Custom color for the sector.

#### **Example Configuration**

[](#example-configuration)

```
[
  {"label": "No win, sorry", "rule_id": null, "probability": 25},
  {"label": "10% coupon", "rule_id": 1, "probability": 20},
  {"label": "20% coupon", "rule_id": 2, "probability": 15},
  {"label": "10% coupon", "rule_id": 1, "probability": 20},
  {"label": "30%", "rule_id": 3, "probability": 5},
  {"label": "10%", "rule_id": 1, "probability": 20, "color": "red"},
  {"label": "30%", "rule_id": 3, "probability": 5},
  {"label": "No win, sorry", "rule_id": null, "probability": 25}
]
```

More details in app/code/Doroshko/WishReward/Model/ProbabilityCalculator.php
----------------------------------------------------------------------------

[](#more-details-in-appcodedoroshkowishrewardmodelprobabilitycalculatorphp)

### **How Winning Probability is Calculated**

[](#how-winning-probability-is-calculated)

The winning sector is determined based on the **probability** value assigned to each sector. The formula used for calculating probabilities is based on **weighted random sampling**. For example:

```
Winning Sector = Weighted Random Selection of Sectors Based on Probabilities

```

Sectors with higher probability values are more likely to be selected.

---

### **How It Works**

[](#how-it-works)

1. **Wish Submission**:

    - A customer writes a wish and submits it.
    - The wish is validated to ensure it matches a Christmas or New Year greeting.
2. **Lottery Wheel (Optional)**:

    - If enabled, the customer spins the lottery wheel.
    - Based on the selected sector, a cart price rule is applied to generate a discount coupon.
3. **Fixed Discount (Optional)**:

    - If the wheel is disabled, a fixed discount is applied using the `Default Rule ID`.
4. **Winning or Losing**:

    - Sectors without a `rule_id` represent non-winning sectors. In such cases, a message is displayed indicating no discount was won.

---

Installation and Configuration
------------------------------

[](#installation-and-configuration)

1. **Install the module** in your Magento 2 environment.
2. Navigate to **Stores &gt; Configuration &gt; Wish Reward Settings** to configure the module:
    - Enable/Disable the module.
    - Configure the lottery wheel or set a default discount rule.
3. Customize the wheel sectors under **Wheel Sectors** with labels, rule IDs, probabilities, and optional colors.
4. Save the configuration and test the functionality on your storefront.

---

Notes
-----

[](#notes)

- The module currently supports **English wish validation only**. Future updates may include support for additional languages.
- Ensure that the **cart price rules** referenced in `rule_id` are properly configured in the admin panel to apply discounts.

---

License
-------

[](#license)

This module is released under the MIT License.
Feel free to use, modify, and distribute this module as needed.

---

Enjoy spreading festive joy with this interactive and engaging module for Magento 2! 🎄🎁

Contact:

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance43

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~11 days

Total

2

Last Release

490d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

1.0.1PHP ~7.4.3|~8.0.0

### Community

Maintainers

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

---

Top Contributors

[![FrankieSR](https://avatars.githubusercontent.com/u/30129002?v=4)](https://github.com/FrankieSR "FrankieSR (23 commits)")

---

Tags

magento2magento2-modulepopupwheel-of-fortune

### Embed Badge

![Health badge](/badges/doroshko-wish-reward/health.svg)

```
[![Health](https://phpackages.com/badges/doroshko-wish-reward/health.svg)](https://phpackages.com/packages/doroshko-wish-reward)
```

###  Alternatives

[fastly/magento2

Fastly CDN Module for Magento 2.4.x

1564.2M1](/packages/fastly-magento2)[mage-os/module-automatic-translation

Automatic AI content translation for Mage-OS.

277.1k](/packages/mage-os-module-automatic-translation)[zepgram/module-rest

Technical module to industrialize API REST call with dependency injection pattern using Guzzle library

1326.2k](/packages/zepgram-module-rest)[graycore/magento2-graphql-introspection-cache

1015.2k](/packages/graycore-magento2-graphql-introspection-cache)[mage-os/mageos-common-async-events

Send REST requests to external endpoints asynchronously. This module implements the most common events like order creation and customer change.

147.7k2](/packages/mage-os-mageos-common-async-events)[mage-os/module-inventory-reservations-grid

Add a grid with the list of inventory reservations.

126.8k](/packages/mage-os-module-inventory-reservations-grid)

PHPackages © 2026

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