onCouponApplied
Purpose
When It Triggers
Parameters
Parameter
Type
Description
Example
exports['sd-shops']:registerClientHook('onCouponApplied', function(data)
-- Play success sound
PlaySoundFrontend(-1, 'CHALLENGE_UNLOCKED', 'HUD_AWARDS', true)
-- Show savings notification
lib.notify({
title = 'Coupon Applied!',
description = ('%s - Save $%d (%d%% off)'):format(
data.couponCode, data.discountAmount, data.discountPercent
),
type = 'success'
})
-- Log savings
print(('[COUPON] Applied %s: $%d -> $%d (saved $%d)'):format(
data.couponCode, data.previousTotal, data.newTotal, data.discountAmount
))
end)Last updated