Download the PHP package thelia/order-minimum-amount-module without Composer
On this page you can find all versions of the php package thelia/order-minimum-amount-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package order-minimum-amount-module
Order Minimum Amount
Refuses an order whose cart total is below a minimum amount. Thelia 3.
Installation
Version 3 needs Thelia 3. Thelia 2 shops stay on 2.x.
Settings
Back office, module configuration, or from the console:
- Minimum amount: postage excluded, discounts deducted.
0means no minimum. - Cart total compared: taxes included (default, as in 2.x) or excluded.
A shop upgraded from 2.x keeps its amount (same minimum_amount key) and compares
taxes included until the setting is changed.
How the order is refused
The module declares a checkout step, order_minimum_amount, with no screen: it never
shows in the tunnel, and it is checked when the order is placed (theme and front API).
A cart below the minimum is refused with:
- the violation code
order-minimum-amount-not-reached; - a translated message giving the minimum and the amount left to add;
- the details
minimumAmount,cartTotal,remainingAmount,taxesIncluded.
Twig
order_minimum_amount() returns the minimum of the cart in session, or null without
a cart. The total is computed once per call, the minimum of a customer once per request.
Fields: minimumAmount, cartTotal, remainingAmount, taxesIncluded,
currencyCode (amounts as decimal strings with two decimals), reached.
A minimum per customer
Another module gives a customer a minimum of their own by answering
OrderMinimumAmount\Event\CustomerMinimumAmountEvent. The event is dispatched only when
the cart belongs to a customer, at most once per customer and per request. Its amount
replaces the global minimum and is compared in the configured mode (taxes included or
not). 0 means no minimum for this customer. Nobody answering means the global minimum.
When several listeners answer, the last one to set the amount wins.
An amount that is not a positive decimal with at most two decimals is an error.