Search by

mikki / module-fortune-wheel

MykolaRudnev

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

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-09-23 15:40 UTC

This package is auto-updated.

Last update: 2026-09-23 15:43:44 UTC


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
Admin campaigns grid Fortune wheel modal Coupon result

Spin animation:

Fortune wheel spin

Mobile:

Mobile wheel

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

☕ Buy Me a Coffee

The module does not send any data outside Magento.

License

MIT — see LICENSE.

Security

See SECURITY.md.