Dynamically populate coupon code field

Hello everyone!

Is there a way I could dynamically populate the coupon code field? I tried it by inserting the shortcode from another plugin, but it didn't work. I only see the shortcode in the box after I tweet or share on facebook.

Would anyone know of a solution for this?

Thank you in advance and great plugin!!!

  • dansmonpetitstudio
    • WPMU DEV Initiate

    I don't want to generate coupon codes. I want that field to be populated dynamically.

    I created a custom post type with the plugin types. And I wanted to use one of the custom fields to dynamically populate the coupon code field on the social marketing advert.

    If you leave the "URL to share" field blank, the URL that will be shared is the url the advert is placed on. I thought maybe it would be possible to create the same thing with the coupon code field.

    Anyone know enough about the Social Marketing plugin and plugins in general to know how I could create that?

    Thank you in advance

  • Timothy Bowers
    • Chief Pigeon

    I don't want to generate coupon codes. I want that field to be populated dynamically.

    Ah ok. I see.

    So with you mentioning shortcodes before, you want to include a shortcode there so you can change the promo codes from another plugin admin area (or postype/field you created)?

    Just to clarify in my mind, you will be editing the promo codes elsewhere to be brought through on a shortcode. Would it not be just as easy to edit the existing Social Marting post?

    Just trying to fully understand the situation and intention first so I don't get this one wrong.

    I tried a shortcode in the plugin and noticed it did not display, I'll ask the developer to look at adding support for that.

    Take care.

  • dansmonpetitstudio
    • WPMU DEV Initiate

    I think you understand me well, Timothy.

    In my case, it would not be as easy to edit the social marketing post. It would be better to insert a shortcode in the coupon code field and the short code would pick up the actual coupon code from an invisible field of this custom post type.

    Or I thought, maybe the coupon code field could act in the same manner the url to share field acts so if the field is left blank, it could pick up the code from this custom post type field I would keep invisible to the public.

    I hope this makes sense... It does in my head... If only I knew how to code :wink:

    Thank you Timothy

  • Timothy Bowers
    • Chief Pigeon

    Yeah that makes perfect sense. I'll ping Ve our developer on this one and ask for some feedback. At least allowing shortcodes would be cool, it would enabled others to use things like Podcasting, media players, galleries, etc, etc.

    So opening that up would be a good thing. I'll ping him now as I think that would be a great update to have. :slight_smile:

    Take care.

  • Timothy Bowers
    • Chief Pigeon

    The only temporary solutions I can offer is to actually use the coupon feature as intended at the moment, but this would mean editing the Social post type coupon field to change the value which is not what you wanted.

    If you wanted to tinker around with a potential solution yourself then you can find the Shortcode API details here:

    http://codex.wordpress.org/Shortcode_API

    This should give you an insight into how they work and can be used. Perhaps that would lead you to the solution you desire.

    I pinged Ve so I'm sure he will drop in soon. :slight_smile:

    Take care.

  • Vladislav
    • Dead Eye Dev

    Hello,

    Just like Timothy said, having support for shortcodes in the coupon code field opens up a lot of doors, so that's something we'll be definitely be working on for the next version. There are some possible snags to figure out with that but overall, it should definitely be possible.

  • Timothy Bowers
    • Chief Pigeon

    Hey dansmonpetitstudio.

    Ve will be working on this one as he mentioned :slight_smile:

    For now because its not so much a support issue but a feature request, I'm going to move this thread over to the feature request forums. :slight_smile:

    If you need anything else though then please free to respond or open another thread if you wish.

    Take care.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.