Skip to main content
Version: Thelia 3

Sale

Sale loop provides an access to sale operations defined on your shop.
{loop type="sale" name="the-loop-name" [argument="value"], [...]}

Arguments​

ArgumentDescriptionDefaultExample
activeA boolean value, to get only active (1) or inactive sales (0) or both (*)1active="1"
currencyA currency id, to get the price offset defined for this currencyThe current shop currencycurrency="1"
excludeA single or a list of sale ids to excluded from results.exclude="2", exclude="1,4,7"
idA single or a list of sale ids.id="2", id="1,4,7"
orderA list of values see sorting possible valuesstart-dateorder=" random"
productA single or a list of product IDs. If specified, the loop will return the sales in which these products are selectedproduct="2", product="1,4,7"

Plus the global arguments and search arguments

Outputs​

VariableValue
$ACTIVEtrue if the sale is active, false otherwise
$AUDIENCE_MODE0 for a public sale, 1 for a sale reserved for named customers
$CHAPOthe sale chapo
$DESCRIPTIONthe sale description
$COUNTDOWN_LEAD_HOURSthe number of hours before the end date the countdown starts, in mode 1
$COUNTDOWN_MODE0 never, 1 from the lead hours before the end, 2 from the opening
$COUNTDOWN_REMAINING_SECONDSthe seconds left before the end date, or nothing when there is no countdown to show
$DISPLAY_INITIAL_PRICEtrue if the products initial price should be displayed, false otherwise
$END_DATEthe sale end date
$HAS_END_DATEtrue if the sale has a end date, false otherwise
$HAS_START_DATEtrue if the sale has a start date, false otherwise
$HIDE_PRODUCTS1 if a reserved sale hides its products from everyone it is not open to
$IDthe content id
$IS_TRANSLATEDcheck if the content is translated
$LOCALEthe locale (e.g. fr_FR) of the returned data
$POSTSCTIPTUMthe sale postscriptum
$PRICE_OFFSET_SYMBOLthe offset unit symbol, % for a percentage, the currency symbol for an amount
$PRICE_OFFSET_TYPEthe price offset type, P for a percentage, A for an amount
$PRICE_OFFSET_VALUEthe price offset value, as a percentage (0-100) or a constant amount.
$SALE_LABELthe sale advertising label
$SHOULD_DISPLAY_COUNTDOWN1 if the countdown has to be shown right now
$START_DATEthe sale start date
$TITLEthe sale title
$URLthe rewritten url of the sale page
Reserved sales

Since Thelia 3.1 a sale can be reserved for named customers, and the loop only returns a reserved sale to a customer it is open to. Price sorting still reads the raw catalogue columns, so the price of a reserved sale does not take part in it. See Reserved Sales and Countdown.

Plus the global outputs

Order possible values​

Arguments

Ascending valueDescending valueSorted fields
activeactive-reverseactive
alphaalpha-reversetitle
createdcreated-reversedate of sale creation
end-dateend-date-reverseend date
idid-reverseid
labellabel-reverselabel
start-datestart-date-reversestart date
updatedupdated-reversedate of sale update