Last active
August 29, 2015 13:57
-
-
Save mnelson4/9772450 to your computer and use it in GitHub Desktop.
Customizing Event Espresso Infusionsoft addon to have country dropdown and special product fields, as requested on http://eventespresso.com/topic/infusionsoft-add-on-doesnt-work-properly-no-contact-data-payment/#post-88125
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... | |
/** | |
* Changes the original, regular country input used in infusionsoft to a dropdown | |
* @param string $original_html | |
* @param string $country | |
* @return string | |
*/ | |
function ee_is_swap_country($original_html,$country){ | |
$values = array( | |
array('id'=>'germany','text'=> __("Germany", 'event_espresso')), | |
array('id'=>'france','text'=> __("France", 'event_espresso')), | |
//add any other cuontries you want to accept | |
); | |
return select_input('country', $values, $country); | |
} | |
add_filter('filter_hook_espresso_infusionsoft_billing_country_input','ee_is_swap_country',10,3); | |
/** | |
* Adds custom data to IS products | |
* @param array $original_info_to_send as documented on http://help.infusionsoft.com/developers/tables/product | |
* @param array $payment_details like columsn on the event_details table | |
* @return array | |
*/ | |
function ee_is_new_product_details($original_info_to_send,$payment_details){ | |
$original_info_to_send['Taxable'] = 1; | |
$original_info_to_send['CountryTaxable'] = 1; | |
return $original_info_to_send; | |
} | |
add_filter('filter_hook_espresso_infusionsoft_event_product_data','ee_is_new_product_details',10,3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment