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

devstevehowe's avatar

Coupon Field Not Showing

Hey all, am I missing something? I can't find where you would "enable" the coupon code field in "register-stripe.blade.php". I see the v-if="query.coupon" in the register-stripe form but not anywhere in docs to enable. Can someone point me to the right direction?

0 likes
7 replies
ejdelmonico's avatar

@devstevehowe Maybe this:

Spark::promotion('coupon-code'); method within your SparkServiceProvider

/**
     * Define or retrieve an application wide promotion for new registrations.
     *
     * @param  string|null  $coupon
     * @return string|void
     */
    public static function promotion($coupon = null)
    {
        if (is_null($coupon)) {
            return static::$promotion;
        } else {
            static::$promotion = $coupon;
        }
    }

find it in src/Configuration/ManagesAvailablePlans.php

devstevehowe's avatar

I put in Spark::promotion(); and alas the field doesn't show. It does if I remove the v-if="query.coupon" but I am not wanting to do that as it seems to me to defeat the purpose of the intention.

EventFellows's avatar

You just add it to your URL as ?coupon=abc as far as I remember. this way you can have a custom setup as you prefer and not a global promotion for everybody.

devstevehowe's avatar

We recently moved from vanilla laravel to spark, and have multiple campaigns running with "use code XXXXXXX" for "XX% off" so having to go back through and put in ?coupon=XXXXXXX seems counter productive. I'd like to just have the field available. I may have to edit and just remove the v-if statement and run it that way.

EventFellows's avatar

that works but then you will have your users start searching the web for coupons if you openly point them to the fact that there might be some.

Just remove the v-if in case that is no problem for you. there does not seem to be any deeper meaning to it if you look at the vuejs code on how it is handling it.

1 like
devstevehowe's avatar

Thats what I did, and only reason for question was I really wanted to follow the intended purpose of the code. Thanks all for the help!

Please or to participate in this conversation.