Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define('PRICE', '100');
- add_filter('gform_pre_render', 'populate_preconference');
- function populate_preconference($form) {
- foreach($form['fields'] as &$field) {
- if( $field['cssClass'] == 'inpersonprice') {
- if( is_numeric(getInPersonPrice()) ) {
- $field['basePrice'] = getInPersonPrice();
- }
- }
- }
- return $form
- }
- function getInPersonPrice() {
- $validate_ccode = isValidCCode();
- $minus_fifty = 0;
- if($validate_ccode) {
- $minus_fifty = 50;
- }
- return PRICE - 50;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement