Support

Home Forums Event Espresso Premium Promo Code Plugin

Promo Code Plugin

Posted: October 4, 2018 at 5:22 pm


Mike Doughty

October 4, 2018 at 5:22 pm

Hi,

We are using EEV4, and when submitting a promo code nothing is happening to the pricing.

The promo code is active and set to the event we are wanting it used on.

Here is a screen capture.
https://www.useloom.com/share/b15cd7bfca4c4049bea6ae7566e8e422

Thanks, Mike


Josh

  • Support Staff

October 4, 2018 at 5:51 pm

Hi Mike,

The Promo code input relies on JavaScript to submit the code & process the discount. I checked your site and there’s a JavaScript error from the theme. A JavaScript error will have the effect of stopping all other JavaScript on the same page. Here’s a screenshot of the console that shows the JavaScript error from your site:

https://slack-files.com/T02SY781D-FD7JR5S83-2c31b78d3c

It turns out something similar was posted in another topic earlier this week, and the solution was to update the theme. They also use the X-Theme with the Cornerstone plugin, and Cornerstone was on the current version but the X-Theme needed to be updated.

Can you check to see if there’s an update for Cornerstone and/or the X-Theme?


Mike Doughty

October 4, 2018 at 8:03 pm

Thanks Josh. I’ve updated ThemeX and it is now working.

However, when the registration is finalised, and I’m using a promo code that discounts by 100%, it is not adding the tag to the contact record in Infusionsoft.

The Infusionsoft integration plugins appear to the most recent version.

Is there an issue with tags not being added through this process?

Thanks, Mike


Mike Doughty

October 4, 2018 at 8:06 pm

PS. The event I tested registering where the tag wasn’t applied is
https://events.getbusiness.fit/events/linkedinlocal-networking-event-november-2018/

Thanks, Mike


Josh

  • Support Staff

October 5, 2018 at 7:45 am

Hi Mike,

I checked and I’m not seeing any issues with tags not being added when a 100% discount is applied at checkout. Here’s a screenshot that show the results of a quick test from my development server:

https://slack-files.com/T02SY781D-FD7TR1K1S-132d91a9d0

You could doublecheck the event editor for that event and make sure the tag is selected in the Infusionsoft Tags metabox. If it is selected, can you check to see if there is any custom code on that site that would affect the Infusionsoft add-on?


Mike Doughty

October 5, 2018 at 2:09 pm

Hi Josh,

Yes the Infusionsoft tag ID is definitely in the Event.

There haven’t been any changes to the site, so nothing that has been added that should stop that, that I’m aware of.

Thanks Mike


Josh

  • Support Staff

October 5, 2018 at 2:16 pm

One way to be sure would be to temporarily deactivate any plugins that contain custom code, then try testing a registration with a 100% discount.


Mike Doughty

October 5, 2018 at 2:50 pm

Hi Josh,

I have a custom plugin (that uses script that EE recommends and is the help documentation) that passes some information to Infusionsoft, and while that’s not been an issue in the past, looks like with the update of the EE Infusionsoft Integration plugin, this is now causing the tag to not be applied when my custom plugin is active.

How am I going to figure out what has changed?

THanks, Mike


Josh

  • Support Staff

October 5, 2018 at 2:53 pm

You may not need that code anymore since the newer Infusionsoft add-on has a UI for assigning tags to events, but maybe you can clarify by posting the code to a PasteBin or gist, then link to that code here.


Mike Doughty

October 5, 2018 at 2:54 pm

PS Here is the code in my plugins

“<?php
/*
Plugin Name: Site plugin for event.getbusiness.fit
Description: Site specific code for event.getbusiness.fit
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
/**
* Filters the $is_contact_data before it’s sent to infusionsoft
* in order to add the last registration’s custom question answers
* @param array $is_contact_data
* @param EE_Attendee $ee_attendee
*/
function ee_infusionsoft_save_my_custom_questions( $is_contact_data, $ee_attendee ) {
if( $ee_attendee instanceof EE_Attendee ) {

//get the last answer this attendee provided to the question with admin label ‘company’
$company_answer = EEM_Answer::instance()->get_one( array( array( ‘Registration.ATT_ID’ => $ee_attendee->ID(), ‘Question.QST_admin_label’ => ‘company’ ) , ‘order’ => ‘DESC’ ) );
if( $company_answer ){
$is_contact_data[ ‘Company’ ] = $company_answer->pretty_value();
}

//get the last answer this attendee provided to the question wtih admin label ‘jobtitle’
$jobtitle_answer = EEM_Answer::instance()->get_one( array( array( ‘Registration.ATT_ID’ => $ee_attendee->ID(), ‘Question.QST_admin_label’ => ‘jobtitle’ ) , ‘order’ => ‘DESC’ ) );
if( $jobtitle_answer ){
$is_contact_data[ ‘JobTitle’ ] = $jobtitle_answer->pretty_value();
}
//get the last answer this attendee provided to the question with admin label ‘mobile’
$mobile_answer = EEM_Answer::instance()->get_one( array( array( ‘Registration.ATT_ID’ => $ee_attendee->ID(), ‘Question.QST_admin_label’ => ‘mobile’ ) , ‘order’ => ‘DESC’ ) );
if( $mobile_answer ){
$is_contact_data[ ‘Phone2’ ] = $mobile_answer->pretty_value();
}
}else{
EE_Error::add_error(sprintf( __( ‘ee_infusionsoft_save_my_custom_questions was not called with an EE_Attendee but a %s’, ‘event_espresso’ ), gettype( $ee_attendee )), __FILE__, __FUNCTION__, __LINE__ );
}
return $is_contact_data;
}
add_filter( ‘FHEE__EED_Infusionsoft__save_infusionsoft_attendee__extra_attendee_data’, ‘ee_infusionsoft_save_my_custom_questions’, 10, 2 );

/**
* Adds custom data to IS products
* @param array $original_info_to_send as documented on http://help.infusionsoft.com/developers/tables/product
* @param EE_Ticket $ticket the EE ticket which is used to create/update the IS product
* @return array
*/
function ee_is_new_product_details($original_info_to_send, $ticket ){
//always mark all products as country taxable (equivalent to EE3 code snippet)
//$original_info_to_send[‘CountryTaxable’] = 1;

//mark product as country taxable only if its taxable normally, probably more useful
if( $ticket instanceof EE_Ticket && $ticket->taxable() ){
$original_info_to_send[‘CountryTaxable’] = 1;
}
return $original_info_to_send;
}
add_filter(‘FHEE__EEE_Infusionsoft_Ticket__sync_to_infusionsoft__product_data’,’ee_is_new_product_details’,10,2);

/**
* Adds event data to Infusionsoft Customfields
* @param array $original_info_to_send as documented on http://help.infusionsoft.com/developers/tables/product
* @param array $is_contact_data
* @param EE_Attendee $ee_attendee
*/

function ee_infusionsoft_pass_event_start_and_name( $is_contact_data, $ee_attendee ) {
if( $ee_attendee instanceof EE_Attendee ) {
$startdate = ”;
$eventname = ”;
$checkout = EE_Registry::instance()->SSN->checkout();
if ( $checkout instanceof EE_Checkout ) {
$transaction = $checkout->transaction;
if ( $transaction instanceof EE_Transaction ) {
foreach ( $transaction->registrations() as $registration ) {
if ( $registration instanceof EE_Registration ) {
$event = $registration->event();
if ( $event instanceof EE_Event ) {
//get the event start date
$startdate = $event->primary_datetime()->start_date( EED_Infusionsoft::IS_datetime_format );
//get the event name
$eventname = $event->name();
$is_contact_data[ ‘_DSEvent1StartDate’ ] = $startdate;
$is_contact_data[ ‘_DSEventName’ ] = $eventname;
}
}
}
}
}
} else {
EE_Error::add_error(sprintf( __( ‘ee_infusionsoft_save_my_custom_questions was not called with an EE_Attendee but a %s’, ‘event_espresso’ ), gettype( $ee_attendee )), __FILE__, __FUNCTION__, __LINE__ );
}
return $is_contact_data;
}
add_filter( ‘FHEE__EED_Infusionsoft__save_infusionsoft_attendee__extra_attendee_data’, ‘ee_infusionsoft_pass_event_start_and_name’, 10, 2 );

/* Stop Adding Functions */”


Josh

  • Support Staff

October 5, 2018 at 3:20 pm

Hi Mike,

Can you find out which one of those scripts is affecting the tags to not get passed?


Mike Doughty

October 5, 2018 at 3:28 pm

Hi Josh,

Just had a look at the UI for the plugin and I can see that I can remove some of the scripts of the custom plugin, as it is now handled by the new EE IS integration plugin.

Thanks, Mike


Josh

  • Support Staff

October 5, 2018 at 3:58 pm

That’s correct, and you’ll find more details about how to use the new features in this part of the documentation:

https://eventespresso.com/wiki/infusionsoft-integration/#ee4customizations


Mike Doughty

October 5, 2018 at 4:05 pm

Hi Josh,

I’ve had a look at the new EE IS plugin and the custom question UI only apply to Custom Fields. As I run business events, my custom questions are for Company Name, Mobile, Job title. None of these are in the drop down fields to choose from.

The second item is that my plugin marks the product as taxable in Infusionsoft so that it calculates net of Good and Services Tax correct.

Lastly it pulls through the Event Start Date and Event Name from EE into Infusionsoft into a custom field.

I can’t see how the new EE Infusionsoft integration and the new UI actually allows me to do any of these.

SO my plugin and the three scripts in it are still necessary.

Any thought?

Thanks, Mike


Josh

  • Support Staff

October 5, 2018 at 4:48 pm

I’ve had a look at the new EE IS plugin and the custom question UI only apply to Custom Fields. As I run business events, my custom questions are for Company Name, Mobile, Job title. None of these are in the drop down fields to choose from.

You add those fields on your IS account, and they’ll show up in the drop down fields to choose from.

You could start with removing that first script (and add the fields then use the UI). Then that might allow for the tags to get passed correctly, because the other two scripts shouldn’t affect tagging.


Mike Doughty

October 5, 2018 at 5:22 pm

Hi Josh,

If you add the fields Company Name, Mobile, and Job Title as custom fields in Infusionsoft. I don’t want to do that, as these fields already exist as standard contact fields in Infusionsoft, and it’s these fields I’m wanting to have updated using the Custom Questions I have on the registration form.

Why is it that only custom show in the UI? It would great if the IS Contact Fields show in the drop down and can be mapped to, which is what my script does.

Thanks, Mike


Josh

  • Support Staff

October 8, 2018 at 2:08 pm

Hi Mike,

I’m afraid I do not have an answer for your question, other than they just did not add that feature. Which they could one day.

In any case, we’ve tested the custom code you’ve posted here and have verified that it doesn’t cause any issues with conditional tags not getting synced when there’s a 100% promo code applied.

Earlier in this reply, you mentioned that the other plugin was now causing the tag to not be applied when it was active.

May I ask does the tag get applied when the plugin is active and no promo codes entered?


Mike Doughty

October 9, 2018 at 8:01 pm

Hi Josh,

I’ll just do another test and screen capture, and let you know if the issue is still persisting.

Thanks, Mike

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Mike Doughty 1 week, 3 days ago ago

Topic Tags

Tagged: 

Notifications

This topic is:
pending
Do NOT follow this link or you will be banned from the site!