Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

snmd73's avatar

Using Spark Coupons WITHOUT Site wide promotions

Hello,

Is there a way to use Spark coupons WITHOUT using site wide promotions? I have removed the v-if and v-model, which keeps the coupon input, but it doesn't work.

I want to allow users to add coupons only if they have them.

This is what I have right now: {{__('Coupon Code')}}

                                <div class="col-md-6">
                                    <input type="text" class="form-control" name="coupon"  :class="{'is-invalid': registerForm.errors.has('coupon')}">

                                    <span class="invalid-feedback" v-show="registerForm.errors.has('coupon')">
                                        @{{ registerForm.errors.get('coupon') }}
                                    </span>
                                </div>
                            </div>
0 likes
1 reply
snmd73's avatar
snmd73
OP
Best Answer
Level 1

As soon as I posted this I figured it out. For those wondering, I removed the v-if from the form-group div and added back the v-model. Final code:

                    <div class="form-group row" >
                                <label class="col-md-4 col-form-label text-md-right">{{__('Coupon Code')}}</label>
                                <div class="col-md-6">
                                    <input type="text" class="form-control" v-model="registerForm.coupon" name="coupon"  :class="{'is-invalid': registerForm.errors.has('coupon')}">

                                    <span class="invalid-feedback" v-show="registerForm.errors.has('coupon')">
                                        @{{ registerForm.errors.get('coupon') }}
                                    </span>
                                </div>
                            </div>

Please or to participate in this conversation.