Skip to content

v1.0.0-alpha

Pre-release
Pre-release

Choose a tag to compare

@loevgaard loevgaard released this 27 Oct 13:20
02bbf70

The first alpha of 1.0, a ground-up rewrite of the plugin for Sylius 1.13 and up. It is a clean break from 0.12.x, with no automatic data migration: read UPGRADE-1.0.md before upgrading a live store.

This is an alpha: the plugin is feature complete for 1.0, but its configuration, services and templates may still change before 1.0.0. Please report what you run into in the issues.

Install

composer require "setono/sylius-gift-card-plugin:^1.0@alpha"

Requires Sylius 1.13 or 1.14, PHP >= 8.1, Symfony ^6.4 and Twig below 3.29. If your application has Twig 3.29 or newer locked, add --with-all-dependencies so Composer can move it back to 3.28 (the README's Twig below 3.29 explains why). The README covers the rest of the setup.

Highlights

  • Redeeming a gift card creates a payment against the order instead of a negative adjustment, so the order total stays intact. An order the cards pay in part stays awaiting payment until the customer pays the rest.
  • The customer chooses the amount, within a configurable minimum and maximum, and the delivery: virtual cards are emailed, physical ones ship through Sylius' shipping.
  • Designs: a translatable resource with front and back images, picked by the customer on a gift card product page of the plugin's own, with a live preview of the card. PDFs render with dompdf from an ordinary Twig template.
  • A balance ledger: every balance change is an append-only transaction, naming the order or the admin behind it. Admins adjust balances with a reason, and an outstanding balance report sums the usable cards per currency.
  • Gift cards in any currency the channel offers: a customer browsing in a display currency buys a card for the amount typed in it, and a card pays an order in another currency at the shop's exchange rate.
  • A reworked admin: one status per card, grid filters, links between cards, orders and designs, one-click gift card product and payment method setup, and a warning on every page while something gift cards need is missing.
  • Safer codes: at least 12 significant characters, an unambiguous alphabet, and rate limited redemption that gives the same message whatever the reason a code was refused.
  • Works with both of Sylius' state machine adapters (winzou and Symfony Workflow), and configures itself through prepend().

Removed

  • The API layer (API Platform / sylius/api-bundle). Stay on 0.12.x if you need it.
  • The GiftCardConfiguration entities and the database-stored PDF template, the public balance lookup page, the shop account's gift card section and the shop's PDF download.

Fixed

  • With an admin path other than /admin, 0.12 served the plugin's admin pages outside the admin firewall, the gift card list with every code included. They now sit under the admin path.

The CHANGELOG lists every change.

Full Changelog: v0.12.0...v1.0.0-alpha