<div class="totalRow coupons fullWidth">


    <div class="sectionTitle" v-if="!basket.coupon_message">
        Discount code
    </div> <!-- .sectionTitle -->

    <div class="costTitle">

        <div class="couponMessage" v-if="basket.coupon_message">

            <div v-html="basket.coupon_message"></div>

            <div class="couponButton">
                <a href="#" @click.prevent="callUpdate('clear_coupon')">Remove Code</a>
            </div> <!-- .couponButton -->

        </div> <!-- .couponMessage -->

        <div class="couponForm" v-else>

            <div class="row">

                <div class="inputWrap buttonInline">

                    <input type="text"
                           name="code"
                           id="discount"
                           v-model="basket.coupon_code"
                           class="text"
                    />

                    <button type="submit"
                            @click.prevent="validateCoupon()"
                            id="couponCodeSubmit"
                            name="submit[apply_code]"
                            class="button">
                        Apply Code
                    </button>

                </div> <!-- .inputWrap buttonInline -->

            </div> <!-- .row -->

        </div> <!-- .couponForm -->


    </div><!-- .costTitle -->

    <div class="cost">
        <span v-html="'-' + multi_currency(basket.coupon_deduct)" v-if="basket.coupon_deduct"></span>
    </div> <!-- .cost -->


    <div
            class="errorRow"
            v-if="hasField('errors.coupon_error')"
    >

        <div class="error">

            <p v-html="errors.coupon_error"></p>

        </div> <!-- .alert error -->

    </div> <!-- .errorRow -->

    <div
            class="successRow"
            v-if="hasField('messages.coupon_success')"
    >

        <div class="success">

            <p v-html="messages.coupon_success"></p>

        </div> <!-- .success -->

    </div> <!-- .successRow -->

</div>




{#
<tr v-if="hasField('errors.coupon_error')">
    <td colspan="2">
        <div class='error'>
            [% errors.coupon_error %]
        </div>
    </td>
</tr>
<tr v-if="hasField('messages.coupon_success')">
    <td colspan="2">
        <div class='success'>
            [% messages.coupon_success %]
        </div>
    </td>
</tr>

<tr class="discount"
    v-if="!hide_inputs"
>
    <td class="alignRight">
        <span v-if="basket.coupon_message">
            [% basket.coupon_message %]
            <i class="far fa-trash" @click="callUpdate('clear_coupon')"></i>
        </span>
        <span v-else>
            <label for="discount">
                Voucher Code
            </label>
        </span>
    </td>
    <td>
        <div v-if="basket.coupon_message" >
            -<span v-html="multi_currency(basket.coupon_deduct)"></span>
        </div>

        <div class="row"
             v-else>
            <div class="buttonInline">
                <div class="inputWrap">
                    <input type="text"
                        name="code"
                        id="discount"
                        v-model="basket.coupon_code"
                        class="text"
                    />
                </div>
                <button type="submit"
                        @click.prevent="validateCoupon()"
                        id="couponCodeSubmit"
                        name="submit[apply_code]"
                        class="button">
                    Apply Code
                </button>
            </div> <!-- .buttonInline -->
        </div> <!-- .row -->
    </td>
</tr>
#}


{#
<tr v-if="hide_inputs && basket.coupon_message">
    <td>
        [% basket.coupon_message %]
    </td>
    <td>
        <span>
            -<span v-html="multi_currency(basket.coupon_deduct)"></span>
        </span>
    </td>
</tr>
#}
