/** * Calculate tax. */ public static function ajax_calculate_tax() { if (!isset($_GET['country']) || !isset($_GET['object_id'])) { exit; } $object = get_post(intval($_GET['object_id'])); if (!$object || !in_array($object->post_type, array('ib_educator_course', 'ib_edu_membership'))) { exit; } $args = array(); $args['country'] = $_GET['country']; $args['state'] = isset($_GET['state']) ? $_GET['state'] : ''; echo Edr_StudentAccount::payment_info($object, $args); exit; }
// Get state. if (isset($_POST['billing_state'])) { $args['state'] = $_POST['billing_state']; } elseif (!empty($billing['state'])) { $args['state'] = $billing['state']; } else { $args['state'] = ib_edu_get_location('state'); } // Get price. if ('ib_educator_course' == $post->post_type) { $args['price'] = ib_edu_get_course_price($post->ID); } elseif ('ib_edu_membership' == $post->post_type) { $args['price'] = Edr_Memberships::get_instance()->get_price($post->ID); } // Output payment summary. echo '<div id="edu-payment-info" class="edu-payment-info">' . Edr_StudentAccount::payment_info($post, $args) . '</div>'; // Payment gateways. $gateways = IB_Educator_Main::get_gateways(); ?> <?php if ($args['price'] && !empty($gateways)) { ?> <div class="ib-edu-form-field<?php if (in_array('empty_payment_method', $error_codes)) { echo ' error'; } ?> "> <label><?php esc_html_e('Payment Method', 'training');