PHPackages                             leat/magento2-loyalty - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. leat/magento2-loyalty

ActiveMagento2-component[Utility &amp; Helpers](/categories/utility)

leat/magento2-loyalty
=====================

Magento 2 module for Leat loyalty program

v1.1.0(8mo ago)0361[1 issues](https://github.com/leat-api/magento/issues)MITPHPPHP ^8.3

Since Apr 16Pushed 5mo ago4 watchersCompare

[ Source](https://github.com/leat-api/magento)[ Packagist](https://packagist.org/packages/leat/magento2-loyalty)[ RSS](/packages/leat-magento2-loyalty/feed)WikiDiscussions main Synced 1mo ago

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

Leat Loyalty for Magento 2
==========================

[](#leat-loyalty-for-magento-2)

Overview
--------

[](#overview)

Leat Loyalty for Magento 2 is a comprehensive integration package that connects your Magento 2 store with the Piggy.eu loyalty platform. This integration enables powerful loyalty features including points earning, rewards redemption, prepaid balance, gift products, and referral systems.

The package consists of five modules that work together to provide a complete loyalty solution:

- **Leat\_Loyalty**: Core functionality for Leat loyalty integration
- **Leat\_LoyaltyFrontend**: Frontend components and widgets
- **Leat\_LoyaltyAdminUI**: Admin interfaces and backend functionality
- **Leat\_LoyaltyAsync**: Asynchronous integration with Piggy.eu
- **Leat\_AsyncQueue**: Robust asynchronous job processing system

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- Magento 2.4.7+ (framework &gt;=103.0.7) with the Magento repository (repo.magento.com) configured
- [Piggy PHP SDK](https://github.com/Piggy-Loyalty/piggy-php-sdk) ^3.12
- Composer

Installation
------------

[](#installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

1. Require the package:

```
composer require leat/magento2-loyalty
```

2. Enable the modules:

```
bin/magento module:enable Leat_Loyalty Leat_LoyaltyFrontend Leat_LoyaltyAdminUI Leat_LoyaltyAsync Leat_AsyncQueue
```

3. Run Magento setup upgrade:

```
bin/magento setup:upgrade
```

4. Compile Magento (production mode):

```
bin/magento setup:di:compile
```

5. Deploy static content (production mode):

```
bin/magento setup:static-content:deploy
```

6. Clear the cache:

```
bin/magento cache:clean
bin/magento cache:flush
```

Configuration
-------------

[](#configuration)

### API Credentials

[](#api-credentials)

1. Navigate to **Stores &gt; Configuration &gt; Leat Loyalty &gt; Leat Loyalty &gt; Connection**
2. Enter your Leat API credentials:
    - **Personal Access Token**: Your Leat API key
    - **Shop UUID**: Your Leat shop identifier
3. Test the connection using the "Test Connection" button
4. Save the configuration

### Store Configuration

[](#store-configuration)

1. Navigate to **Stores &gt; Configuration &gt; Leat Loyalty &gt; Leat Loyalty &gt; General Configuration**
2. Enable Leat Connection
3. Select which customer groups should be integrated with Leat
4. Save the configuration

### Additional Settings

[](#additional-settings)

- **Credits Display**: Configure under **Stores &gt; Configuration &gt; Leat Loyalty &gt; Leat Loyalty &gt; Credits Display**
- **Order Configuration**: Configure under **Stores &gt; Configuration &gt; Leat Loyalty &gt; Leat Loyalty &gt; Order Configuration**
- **Prepaid Balance**: Configure under **Stores &gt; Configuration &gt; Leat Loyalty &gt; Leat Loyalty &gt; Prepaid Balance**
- **Refer a Friend**: Configure under **Stores &gt; Configuration &gt; Leat Loyalty &gt; Leat Loyalty &gt; Refer a Friend**

Module Descriptions
-------------------

[](#module-descriptions)

### Leat\_Loyalty

[](#leat_loyalty)

The core module that provides the foundation for the Leat loyalty integration:

- Customer synchronization with Leat contacts
- Order synchronization and credit calculation
- Prepaid balance management
- Coupon/rewards redemption
- Gift product cart price rules

[Detailed Documentation](src/module-loyalty/README.md)

### Leat\_LoyaltyFrontend

[](#leat_loyaltyfrontend)

Provides frontend components and widgets for customer interaction:

- Loyalty page with activity log
- Prepaid balance slider in checkout
- Referral system with sharing options
- Gift products display in cart
- Your Coupons widget

[Detailed Documentation](src/module-loyalty-frontend/README.md)

### Leat\_LoyaltyAdminUI

[](#leat_loyaltyadminui)

Extends Magento's admin area with Leat-specific features:

- Data synchronization interface
- Connection testing system
- Gift product cart price rule UI
- Leat coupon type integration
- Validation framework for data integrity

[Detailed Documentation](src/module-loyalty-admin-ui/README.md)

### Leat\_LoyaltyAsync

[](#leat_loyaltyasync)

Handles asynchronous communication between Magento and Leat:

- Specialized queue types for Leat API operations
- Builder services for common integrations
- Retry logic and error reporting
- Performance optimization

[Detailed Documentation](src/module-loyalty-async/README.md)

### Leat\_AsyncQueue

[](#leat_asyncqueue)

Provides a robust asynchronous job processing system:

- Job and request management
- Sequential processing
- Retry handling with progressive delays
- Performance optimization

[Detailed Documentation](src/module-async-queue/README.md)

Key Features
------------

[](#key-features)

### Customer Synchronization

[](#customer-synchronization)

The integration automatically synchronizes customer data with Leat:

- Creates Leat contacts for Magento customers
- Syncs customer profile updates (name, email, address)
- Stores contact UUID for reliable identification

### Order Synchronization

[](#order-synchronization)

Orders are automatically synchronized to Leat:

- Transactions created for each order item

### Prepaid Balance

[](#prepaid-balance)

Allows customers to use their loyalty balance as payment:

- Interactive slider in checkout
- Real-time total recalculation
- Validation to prevent overuse
- Complete integration with Magento checkout

### Gift Product Promotions

[](#gift-product-promotions)

Enhanced cart price rules for gift products:

- Add gift products to cart based on rules
- Support for both simple and configurable products
- Percentage-based discounts
- Quantity limits based on rule settings

### Referral System

[](#referral-system)

Complete referral functionality:

- Personalized referral links
- Social sharing options
- Referral popup for new visitors
- Email notifications

### Frontend Widgets

[](#frontend-widgets)

Rich set of frontend components:

- Loyalty widget with authentication
- Activity log showing transaction history
- Your Coupons widget for reward redemption
- Progress button component for visual feedback

Cron Jobs
---------

[](#cron-jobs)

The integration sets up several cron jobs:

- **Order Export**: Exports new orders to Leat (hourly)
- **Contact Update**: Updates contact information (daily)
- **Queue Processing**: Processes the async queue (every 15 minutes)
- **Queue Alert**: Sends alerts for queue errors (Monday at 10 AM)
- **Queue Cleanup**: Cleans up successful jobs (monthly)

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

#### Connection Issues

[](#connection-issues)

If you experience connection issues with the Leat API:

1. Verify your API credentials in the configuration
2. Test the connection using the "Test Connection" button
3. Check your server's outbound connectivity to api.piggy.eu
4. Check the log files in the `var/log/leat/` directory for specific error messages

#### Queue Processing Issues

[](#queue-processing-issues)

If jobs are not being processed:

1. Ensure cron is properly configured and running
2. Check the log files in the `var/log/leat/` directory for errors
3. Verify the queue tables in the database are not corrupted
4. Run `bin/magento cron:run --group=leat_async_queue` and `bin/magento cron:run --group=leat_integration` manually to test

#### Synchronization Issues

[](#synchronization-issues)

If customer or order data is not syncing:

1. Check if the stores are properly configured in the Leat settings
2. Verify the customer has a contact UUID assigned
3. Check the log files in the `var/log/leat/` directory for synchronization errors

### Logging

[](#logging)

The integration writes log files to the `var/log/leat/` directory. These logs contain detailed information about:

- Loyalty operations
- API communications
- Queue processing
- Error messages and exceptions

You can check these logs for troubleshooting and monitoring the integration's activities.

Support and Resources
---------------------

[](#support-and-resources)

- **GitHub Repository**: Piggy-Loyalty/magento
- **Technical Support**:
- **Documentation**: Refer to individual module README files for detailed documentation

License
-------

[](#license)

MIT License - see composer.json for details.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance67

Regular maintenance activity

Popularity8

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~139 days

Total

2

Last Release

256d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/154dd12213659d82e4616e99ce1f24f53c35a47f57811224b53383cbb2bcbf55?d=identicon)[EdingerMike](/maintainers/EdingerMike)

---

Top Contributors

[![martijn-tl](https://avatars.githubusercontent.com/u/133650941?v=4)](https://github.com/martijn-tl "martijn-tl (6 commits)")[![EdingerMike](https://avatars.githubusercontent.com/u/12659917?v=4)](https://github.com/EdingerMike "EdingerMike (5 commits)")[![boldsidney](https://avatars.githubusercontent.com/u/26161010?v=4)](https://github.com/boldsidney "boldsidney (4 commits)")[![rensnitert](https://avatars.githubusercontent.com/u/82369811?v=4)](https://github.com/rensnitert "rensnitert (1 commits)")

---

Tags

magento2loyaltypiggyleat

### Embed Badge

![Health badge](/badges/leat-magento2-loyalty/health.svg)

```
[![Health](https://phpackages.com/badges/leat-magento2-loyalty/health.svg)](https://phpackages.com/packages/leat-magento2-loyalty)
```

###  Alternatives

[magepal/magento2-googletagmanager

Google Tag Manager (GTM) for Magento 2 with Advance Data Layer

2671.5M4](/packages/magepal-magento2-googletagmanager)[lillik/magento2-price-decimal

Magento 2 Price Decimal Precision

111147.5k](/packages/lillik-magento2-price-decimal)[magepal/magento2-reindex

Reindex your Magento2 store quickly and easily from backend/admin, instead of command line.

112649.7k1](/packages/magepal-magento2-reindex)[opengento/module-gdpr

Gdpr Compliance Module for Magento 2

14481.5k](/packages/opengento-module-gdpr)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69344.4k](/packages/run-as-root-magento2-prometheus-exporter)[smile/module-store-locator

Smile Store Locator

51516.6k4](/packages/smile-module-store-locator)

PHPackages © 2026

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