Ecommerce for Statamic

Coupon response

When you try to apply or remove a coupon, you’ll want to provide the customer with some feedback.

Variables

success
True if the coupon was successfully added/removed.
applied
True if coupon was applied.
removed
True if the coupon was removed.
invalid
True if the coupon couldn’t be added because it doesn’t exist.
existing
True if the coupon couldn’t be added because you already have one applied.
code
The code you entered. (Not available after removing a coupon)
existing_code
The code already applied to the cart. (Availble only when a coupon is already applied)

Example

{{ bison:coupon_response }}
  {{ if success }}
    <div class="success message">
      {{ if applied }}Your coupon ({{ code }}) was applied!{{ endif }}
      {{ if removed }}Your coupon code was removed{{ endif }}
    </div>
  {{ else }}
    <div class="error message">
      {{ if invalid }}The code you entered ({{ code }}) doesn't exist.{{ endif }}
      {{ if existing }}You already have a code entered. ({{ existing_code }}) Please remove the first one.{{ endif }}
    </div>
  {{ endif }}
{{ /bison:coupon_response }}


Problem with this page? Edit it on Github.