Skip to content
  1. Extras
  2. ms3FirstTimeBuyerDiscount

ms3FirstTimeBuyerDiscount

Component for MiniShop3: automatic first-order discount. When the customer has zero paid orders, a discount (percent or fixed amount) is applied to the cart. For logged-in users user_id is used; for guests — email/phone from the order draft Address. Paid order statuses come from ms3_status_for_stat (with ms3_status_new taken into account).

Features

  • First-order discount — applied during cart calculation (event msOnGetCartCost), no template changes
  • Discount type — percent of total or fixed amount in shop currency
  • Identifying “first” buyer — by user_id for users, by email/phone for guests, using statuses from ms3_status_for_stat
  • Discount combination — setting ftb_allow_combination can block FTB when the cart already has another discount
  • EventsftbOnBeforeApply (cancel or override amount), ftbOnApply (logging, analytics)
  • Checkout banner — snippet ms3ftbDiscountBanner + frontend eligibility check by email/phone
  • Extensibility — override service in container ms3ftb_discount, extend FtbDiscountService

System requirements

RequirementVersion
MODX Revolution3.x
PHP8.1+
MySQL5.7+ / MariaDB 10.3+

Dependencies

  • MiniShop3 — cart, orders, event msOnGetCartCost, setting ms3_status_for_stat

Installation

Via ModStore

  1. Connect the ModStore repository
  2. Go to Extras → Installer and click Download Extras
  3. Ensure MiniShop3 is installed
  4. Find ms3FirstTimeBuyerDiscount and click Download, then Install
  5. Manage → Clear cache

After installation

Configure the discount in Settings → ms3firsttimebuyerdiscount.

See: Quick start.

Terms

TermDescription
First-Time BuyerLogged-in user or guest with zero orders in statuses from ms3_status_for_stat (with ms3_status_new)
Paid orderOrder in one of the statuses listed in ms3_status_for_stat (e.g. "Paid", "Delivered")
DiscountAmount or percent subtracted from cart total in msOnGetCartCost