mikki / module-fortune-wheel
Server-side Fortune Wheel for Magento newsletter subscribers. Magento picks the reward; the storefront only animates.
Package info
github.com/MykolaRudnev/mikki-fortune-wheel
Type:magento2-module
pkg:composer/mikki/module-fortune-wheel
Requires
- php: ^8.2
- magento/framework: *
- magento/module-backend: *
- magento/module-config: *
- magento/module-newsletter: *
- magento/module-sales-rule: *
- magento/module-store: *
- magento/module-ui: *
Requires (Dev)
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Server-side Fortune Wheel for Magento newsletter subscribers.
Magento picks the reward and creates the coupon. The storefront only animates to that result.
Demo
Captured on Magento 2.4.9 + Hyvä (mydemomagento.ddev.site).
| Admin campaigns | Storefront wheel | After spin |
|---|---|---|
![]() |
![]() |
![]() |
Spin animation:
Mobile:
Features
- Magento Open Source & Adobe Commerce 2.4.7+
- Luma / Blank storefront
- Optional Hyvä compatibility package
- Multistore campaigns
- Weighted rewards via Cart Price Rules (existing or created from admin)
- Unique
FW-****-****coupons - One spin per campaign + email hash (survives cookies / incognito)
- PixiJS 8 WebGL wheel (lazy-loaded), CSS fallback,
prefers-reduced-motion - FPC / Varnish safe (placeholder only in cached HTML; form key read from JS)
- No external tracking, no CDN scripts
Security model
Browser: "Spin please"
Magento: validate token → lock participation → choose reward → create coupon → mark played
Browser: animate to returned segment_id
DevTools cannot change probabilities. A replayed POST returns the same coupon.
Install
Until Packagist is set up, point Magento at the GitHub repo:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/MykolaRudnev/mikki-fortune-wheel"
}
]
}
composer require mikki/module-fortune-wheel:dev-main bin/magento module:enable Mikki_FortuneWheel bin/magento setup:upgrade bin/magento cache:flush
Hyvä (optional)
The Hyvä package is in hyva/ of this repo. After requiring the main module, add a path repository and require it:
{
"repositories": [
{
"type": "path",
"url": "vendor/mikki/module-fortune-wheel/hyva"
}
]
}
composer require mikki/module-fortune-wheel-hyva:@dev bin/magento module:enable Mikki_FortuneWheelHyva bin/magento setup:upgrade
Or copy hyva/src into app/code/Mikki/FortuneWheelHyva and enable the module manually.
Enable under Stores → Configuration → Mikki → Fortune Wheel, then create a campaign under Marketing → Fortune Wheel → Campaigns.
Default rewards create disabled Cart Price Rules. Enable those rules before enabling a campaign.
Newsletter consent
This extension does not replace the merchant's newsletter consent mechanism. Magento newsletter remains the source of truth. The wheel is a promotional benefit after subscription.
Frontend build
The Pixi renderer is committed at src/view/frontend/web/js/wheel.bundle.js. Merchants do not need Node.
To rebuild:
npm install npm run build
Support development
The module does not send any data outside Magento.
License
MIT — see LICENSE.
Security
See SECURITY.md.




