Conditional Action Based on Campaign Start Date

Hi There,

Coding Background
Forgive me, I am an API novice, as in I haven’t used Infusionsoft’s API yet and am more comfortable with JavaScript programming so please forgive the simple question.

Website Setup
WordPress hosted website with locally coded sign-up form, with a 2-Pay button, linked to an Infusionsoft order form.

Is there a way to do a dynamic (when the page loads) check on a campaign start date and take a conditional action on my WordPress locally coded sign-up form? This date check result needs to feed a JavaScript action on the 2-Pay button, graying out and inactivating the button.

The JavaScript side I can handle but I don’t know how to make the API call and link it back into the script.

Background - Non Paying Customers…
We recently had a non-paying customer, who selected a two pay then didn’t fulfill the second payment. The time the live class runs meant they received ALL the tuition without making ALL the payment.

What we are trying to do to prevent this happening again, by removing (gray out / inactivate) the 2-Pay button option after a certain period of time after the campaign start date.

Yes I can manually change the page code but its a better long term solution to have the WordPress page query Infusionsoft, get the start date and apply a CSS class / code change automatically.

This way our customers can only pay for the training class up until a date we specify.

Thanks if anyone has some tips or come up with a solution to such a scenario.

Aly :slight_smile:

Hey Alastair,

I can’t offer you a complete solution but from what I understand of your situation, I would think about it a little differently.

First, you probably don’t want to connect to the API from the browser with Javascript. You probably want a hook before WP loads the page to check the API and then create the page differently based on what the API returns. (I’d also do more than just disable the button with CSS; you probably want a solution that can’t be easily edited in the browser.)

Second, I don’t think I follow what “campaign date” you’re referring to but I think you’re probably better off defining the logic for when the button should be disabled, create a contact field to track it, then try to create a campaign to update it automatically. That gives you a very well-defined thing to check with the API.

I hope that makes sense and is helpful!

1 Like

Hi @Greg_Garrison,

Thank you, those are both excellent thoughts on how to address this issue, I appreciate your time and response.

Aly :slight_smile: