Exemplo n.º 1
0
 /**
  * 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 IB_Educator_Account::payment_info($object, $args);
     exit;
 }
Exemplo n.º 2
0
        // 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'] = IB_Educator_Memberships::get_instance()->get_price($post->ID);
        }
        // Output payment summary.
        echo '<div id="edu-payment-info" class="edu-payment-info">' . IB_Educator_Account::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 
            _e('Payment Method', 'ibeducator');