Skip to content

Discounts ​

Discounts and promo codes for your salon: a code clients type when they book, or a price lowered by itself for a first visit, quiet hours or the last minute, with limits per client and in all; the deposit and the bill follow, taxes on what is left.

kitloom/booking-discounts · admins: kitloom/booking-discounts-filament, kitloom/booking-discounts-nova

Video lessons ​

Recorded in the Filament admin; the Nova admin works the same way.

Discounts and promo codes for your salon. A discount lowers what a visit costs, in one of two ways:

  • a code your client types when booking — WELCOME15 for a first visit, AUTUMN for a season;
  • by itself, wherever its conditions hold: quiet mornings, a time booked at the last minute, a first visit, chosen services or staff.

A promo code is simply a discount that asks for a code: both are made on the same form.

The admin is kitloom/booking-discounts-filament or kitloom/booking-discounts-nova.

A discount ​

A promo code for a first visit
Quiet hours and the last minute

Each discount has:

  • a name your client reads ("First visit", "Tuesday mornings");
  • a code, or none. Letters, digits, - and _. A client may type it in any case: welcome15 is WELCOME15. Two discounts never share a code;
  • what it takes off: a percentage, or an amount in the bookings' currency.

Then the conditions, every one of them optional. A discount applies only where all of the ones you set hold:

  • Services — all of them, or the ones you choose. With add-ons too, the add-ons booked together with a chosen service are lowered as well.
  • Staff — only visits with the people you choose.
  • Dates — the first and the last day it runs. A Black Friday code runs four days.
  • Days and hours — the hours of the week a visit starts in: Tuesday and Wednesday, 9:00 to 12:00. Several stretches may be set.
  • Last minute — a visit booked at most this many hours before it starts.
  • First visit — only a client who has never had a visit marked done. They are looked up by their card, their email and their phone. A guest booking with a new email counts as new, as everywhere else on the site.
  • Smallest visit — the visit costs at least this, before the discount.

And the limits:

  • Uses in all — 100 for the first hundred clients.
  • Uses per client — a new code is used once per client unless you say otherwise, counted by their card or their email.
  • Where — everywhere; online (the site and the app); or at the salon (a booking made at the front desk, the till).

A discount is never deleted: switch it off, and what it took off stays on the visits it lowered.

One discount a visit ​

A visit gets one discount, never two added up:

  • A code typed that applies wins.
  • Without one, the client gets the largest of the discounts that apply by themselves.
  • A code that does not apply is refused with why: "This discount is for a first visit", "This discount has been used up", "This discount starts on 27 November".

What the client sees ​

  • The time picker marks the times a discount lowers by itself: −20 % on a quiet Tuesday morning, on a time at the last minute.
  • The booking form has Have a code? while one of your discounts has a code. Discounts → Settings → Ask for a code on the booking form turns it off, so codes are taken at the front desk only.
  • The price shows what the visit cost, the discount by name and what is left. The confirmation and the reminder, the booking's page and the account say the same.

The money ​

  • The booking's price is what the client pays: the discount is out of it. Each service of the visit keeps its own price, so the bill at the till shows both: the services, then "First visit −12.00".
  • A deposit, or a payment in full when booking, is taken on what is left.
  • Taxes are worked out on what is left too: a discount the salon gives lowers the GST and the other taxes on the bill. A gift card is different. It is a way of paying, and the bill stays as it is. Ask your accountant if you are unsure how your books should show discounts.
  • Moved to another time with the same person, a visit keeps its discount as booked.
  • Moved to a colleague whose prices are their own, the discount's rule falls on their prices: 10 % stays 10 %. Quiet hours and the last minute are judged when the visit is booked, so a move never takes a discount away.
  • A visit of a series: the visits after the first get no discount by themselves. Give one at the front desk if you like.

At the till ​

A discount at the till

With kitloom/booking-checkouts:

  • The visit's bill shows its services at their own prices and the discount under them: "First visit (WELCOME15) −12.00".
  • Discount code takes a code a client gives at the till: a walk-in's, one forgotten when booking. It counts as a use like one typed online, and a code meant only for online booking is refused there.
  • Give a discount (the till's own) or a code typed there takes the place of the visit's discount. The use of the one taken off is given back, so the client may use that code another time.

Uses ​

Each time a discount lowers a visit is a use:

  • held while the visit is ahead;
  • kept once the visit happened, and also when the client did not come;
  • given back when the booking is cancelled, declined or never paid for. The client may then use the code again, and it counts nowhere.

The limits count the held and the kept.

In the admin ​

What discounts gave, and switching one off
  • Discounts lists them: the name and when it applies, the code or Applies by itself, what it takes off, the uses counted against the limit, on or off. New discount opens the form, in four parts: What, On what, When, Limits.
  • A discount's page gives its details and the uses, newest first, each with its booking, the client's email, what it took off and where it stands (held, used, given back).
  • Switch off and Switch on are on the page and in each row's menu. A discount is never deleted.
  • Discounts this month, over the list and on the Filament dashboard, shows what discounts took off this month, how many visits had one, and how many came with a first-visit discount. kitloom-booking-discounts.filament.dashboard keeps it off the dashboard. In Nova it is a metric on the Discounts list.

Who may do what ​

Set up discounts and promo codes (manage_booking_discounts) — administrators and editors have it when the module first appears. A code a client types needs nothing. A discount picked at the front desk needs only what booking there needs.

For the developer ​

  • Data:
    • booking_discounts (model Models\Discount, registry key booking_discount): the code as typed in code, found by its upper case in code_key. Lists (services, staff, the hours of a week) are JSON.
    • booking_discount_uses (Models\DiscountUse, booking_discount_use): one row per booking at most, held → used / released.
  • Writers and readers:
    • DiscountWriter is the only writer of both. save() and setActive() ask manage_booking_discounts. hold() counts the limits again under a lock on the discount's row, inside the booking's transaction.
    • Discounts picks the discount for a visit and says why a code does not apply. It is bound per request, so a day's times in a picker read the discounts once.
  • The bookings: they ask through their Contracts\VisitDiscount, which this module binds (Visits\SalonDiscounts; the bookings' own Discounts\NoDiscount lowers nothing and refuses a code):
    • offer($plan, $start, DiscountAsk) is asked inside the staff member's lock, and the answer goes onto the VisitPlan, so price() and a quoted deposit are what is left;
    • hold() keeps the use;
    • of($booking) is what the summary, the emails and the till read;
    • reprice() follows a move to other prices.
  • REST (bookings/v1):
    • POST bookings takes code;
    • the salon's own booking takes code or discount (an id);
    • POST bookings/quote answers the price before and after, the discount, and what is paid now;
    • GET slots marks each time with discount (−20 %) or null.

Tests ​

tests/ runs inside a kitloom application: DiscountsTest (codes, conditions, limits, the picker, a move, uses), DiscountWriterTest and the integrations' tests.

Read more ​

kitloom — sites on Laravel, built for you and run with AI.
Contact · Services · License · Refunds · Privacy · Community · YouTube · [email protected]