Esempio n. 1
0
                    <?php if (Subscriptio::post_is_active($order_id)): ?>
                        <?php Subscriptio::print_link_to_post($order_id); ?>
                    <?php else: ?>
                        <?php echo '#' . $order_id . ' (' . __('deleted', 'subscriptio') . ')'; ?>
                    <?php endif; ?>
                    <?php echo ($order_id != end($subscription->all_order_ids) ? ', ' : ''); ?>
                <?php endforeach; ?>
            </p>

        </div>
        <div class="subscription_data_content">
            <h4><?php _e('Customer Details', 'subscriptio'); ?></h4>

            <p>
                <strong><?php _e('Name:', 'subscriptio'); ?></strong>
                <?php echo Subscriptio::get_user_full_name_link($subscription->user_id, $subscription->user_full_name); ?>
            </p>

            <?php if ($user_email = get_user_meta($subscription->user_id, 'billing_email', true)): ?>
                <p>
                    <strong><?php _e('Email:', 'subscriptio'); ?></strong>
                    <a href="mailto:<?php echo $user_email; ?>"><?php echo $user_email; ?></a>
                </p>
            <?php endif; ?>

            <?php if ($user_phone = get_user_meta($subscription->user_id, 'billing_phone', true)): ?>
                <p>
                    <strong><?php _e('Phone:', 'subscriptio'); ?></strong>
                    <?php echo $user_phone; ?>
                </p>
            <?php endif; ?>
Esempio n. 2
0
    /**
     * Manage subscription list column values
     * 
     * @access public
     * @param array $column
     * @param int $post_id
     * @return void
     */
    public function manage_subscription_list_column_values($column, $post_id)
    {
        $subscription = $this->load_from_cache('subscriptions', $post_id);

        switch ($column) {

            case 'id':
                self::print_link_to_post($subscription->id);
                break;

            case 'status':
                echo '<a class="subscription_status_' . $subscription->status . '" href="edit.php?post_type=subscription&amp;subscription_status=' . $subscription->status . '">' . $subscription->status_title . '</a>';
                break;

            case 'subscriptio_product':
                foreach (Subscriptio_Subscription::get_subscription_items($subscription->id) as $item) {
                    if (!$item['deleted']) {
                        self::print_link_to_post($item['product_id'], $item['name'], '', ($item['quantity'] > 1 ? 'x ' . $item['quantity'] : ''));
                    }
                    else {
                        echo $item['name'];
                    }
                }
                break;

            case 'subscriptio_user':
                echo Subscriptio::get_user_full_name_link($subscription->user_id, $subscription->user_full_name);
                break;

            case 'recurring_amount':
                echo $subscription->get_formatted_price($subscription->renewal_order_total);
                break;

            case 'last_order':
                if (self::post_is_active($subscription->last_order_id)) {
                    self::print_link_to_post($subscription->last_order_id);
                }
                else {
                    echo '#' . $subscription->last_order_id . ' (' . __('deleted', 'subscriptio') . ')';
                }
                break;

            case 'started':
                if ($subscription->started) {
                    $date_format = apply_filters('subscriptio_date_format', get_option('date_format'), 'subscription_list_started');
                    $date = self::get_adjusted_datetime($subscription->started, $date_format);
                    $date_time = self::get_adjusted_datetime($subscription->started, null, 'subscription_list_started');
                    echo '<span title="' . $date_time . '">' . $date . '</span>';
                }
                else {
                    echo '—';
                }
                break;

            case 'payment_due':
                if ($subscription->payment_due) {
                    $date_format = apply_filters('subscriptio_date_format', get_option('date_format'), 'subscription_list_payment_due');
                    $date = self::get_adjusted_datetime($subscription->payment_due, $date_format);
                    $date_time = self::get_adjusted_datetime($subscription->payment_due, null, 'subscription_list_payment_due');
                    echo '<span title="' . $date_time . '">' . $date . '</span>';
                }
                else {
                    echo '—';
                }
                break;

            case 'expires':
                if ($subscription->expires) {
                    $date_format = apply_filters('subscriptio_date_format', get_option('date_format'), 'subscription_list_expires');
                    $date = self::get_adjusted_datetime($subscription->expires, $date_format);
                    $date_time = self::get_adjusted_datetime($subscription->expires, null, 'subscription_list_expires');
                    echo '<span title="' . $date_time . '">' . $date . '</span>';
                }
                else {
                    echo '—';
                }
                break;

            default:
                break;
        }
    }