Template Tags: Discounts & Coupons/Vouchers
CartThrob supports both discounts (automatically applied by discount logic) and coupons/vouchers (applied by submitted coupon code).
Coupons can be added/cleared from the active cart. Discounts are calculated from active discount rules and current cart state.
Add, Apply, and Clear Coupons/Vouchers
- add_coupon_form Create a dedicated form to submit a
coupon_code. Do not nest this form inside another CartThrob form tag (also used on Checkout page). - clear_coupon_codes Clear all coupon codes from the active cart session.
Discount/Coupon Totals and Details
- cart_discount Output current total discount amount (coupon + discount effects) (also used on Checkout page).
- cart_discount_percent_of_subtotal Output current discount as a percentage of subtotal.
- cart_discount_percent_of_total Output current discount as a percentage of total.
- cart_subtotal_minus_discount Output subtotal after discount subtraction (also used on Cart page).
- coupon_count Output number of coupon codes currently in cart.
- coupon_info Output details for coupon codes currently in cart.
- discount_info Output currently active/applied discount details.
Supporting Coupon Flows
Coupons can also be applied during broader cart/checkout form submissions using a coupon_code input field:
- checkout_form Apply
coupon_codeduring checkout processing (also used on Checkout page). - update_cart_form Apply
coupon_codewhile updating cart rows/customer fields (also used on Cart page and Checkout page). - clear_cart Clears coupon codes as part of full cart clear (also used on Cart page).