# Empire Sale Badge (PrestaShop)

**SKU:** `EMP-PS-SALE-FREE` · **Price:** Free · **License app:** `Free (GPL-compatible / Empire Free)` · **Version:** 1.2.0

## Overview

Badge reducere %/sumă pe listări produs — formă, poziție, excluderi.

Built for production stores and content sites that need EmpireX reliability: clear admin UX, safe defaults, and documentation you can hand to a developer or agency without guesswork.

This **v1.1.0 Expert Upgrade** expands configuration, hardens sanitization, and (for commercial SKUs) validates licenses against the Empire Shop API (`/api/licenses/validate`).

## Requirements / Compatibility

- Platform: **PrestaShop**
- PHP: 7.4+ / 8.x (as supported by your platform)
- HTTPS recommended for license validation (paid)
- Capability / ACL: administrator (WP `manage_options` / PS Admin / OC modify permission)

## Installation

1. Download ZIP from Empire Shop.
2. **Modules → Module Manager → Upload a module**.
3. Install & Configure.
4. If paid: enter license key (``) and Save.

## Configuration

| Setting | Description |
|---------|-------------|
| Mode | %/amount |
| Shape | circle/rect |
| Position | TL/TR |
| Exclude cats | IDs |

## Features

- % or amount badge
- Circle/rect shape
- Position CSS
- Exclude categories
- Empire colors
- Product list + product
- RO format
- Cache-safe
- Free

## How it works

The module registers platform hooks/filters, stores settings in native storage (WP options / PS Configuration / OC settings), and renders front-end output only when enabled. Paid modules call the Empire license endpoint with `app_slug` + `machine_id` (site fingerprint) and cache a positive result to limit remote calls.

## Best practices

- Test on staging before production.
- Keep a backup of settings/rules before bulk edits.
- After go-live, spot-check mobile + desktop.
- For SEO modules: validate structured data with Google Rich Results / Schema validators.
- For conversion modules: measure ATC/checkout conversion before/after.

## Troubleshooting FAQ

**Q: Settings do not save.**  
A: Confirm admin ACL / `manage_options` (WP) or employee permissions (PS/OC). Disable conflicting security plugins temporarily.

**Q: Front-end output missing.**  
A: Check master Enabled toggle, theme overrides, and (paid) license status. Clear caches (LiteSpeed/Cloudflare/OPCache).

**Q: License shows invalid.**  
A: Verify key belongs to app `Free (GPL-compatible / Empire Free)`, site not over activation limit, and server can reach `https://empirex.tech/api/licenses/validate`.

**Q: Conflict with another plugin/module?**  
A: Disable other similar features (second TOC, second sticky ATC, etc.). Empire modules use prefixed handles/classes.

**Q: How do I uninstall cleanly?**  
A: Use platform uninstall. WP includes `uninstall.php` where applicable; PS/OC delete Configuration keys on uninstall.

## Changelog

- **v1.2.0** — Deepen: license gates / assets / expanded UX.
- **v1.1.0** — Expert Upgrade: expanded settings, docs, hardening, license API (paid), catalog polish.
- **v1.0.0** — Initial public release on Empire Shop.

## Support

Email: **operations@empirex.tech**  
Product: https://empirex.tech/shop/empire-sale-badge-ps  
Docs: https://empirex.tech/docs/modules/empire-sale-badge-ps.md
