Пример #1
0
function colabs_order_canceled_notify_owner($order)
{
    $recipient = get_user_by('id', $order->get_author());
    $item = '';
    foreach ($order->get_items() as $item) {
        $link = html('a', array('href' => get_permalink($item['post']->ID)), $item['post']->post_title);
        $item = html('p', $link);
        break;
    }
    $table = new Colabs_Order_Summary_Table($order);
    ob_start();
    $table->show();
    $table_output = ob_get_clean();
    $content = '';
    $content .= html('p', sprintf(__('Hello %s,', 'colabsthemes'), $recipient->display_name));
    $content .= html('p', sprintf(__('Your Order #%d has just been canceled.', 'colabsthemes'), $order->get_id()));
    $content .= $item;
    $content .= html('p', __('Order Summary:', 'colabsthemes'));
    $content .= $table_output;
    $content .= html('p', ' ');
    $content .= colabs_email_signature('order_canceled', 'html');
    $subject = sprintf(__('[%s] Order canceled #%d', 'colabsthemes'), get_bloginfo('name'), $order->get_id());
    colabs_send_email($recipient->user_email, $subject, $content);
}
Пример #2
0
function the_order_summary()
{
    $order = get_query_var('order_id');
    if ($order) {
        $orders = colabs_get_order($order);
        echo '<h5>' . __('Order Summary', 'colabsthemes') . '</h5>';
        echo '<div class="order-summary">';
        $table = new Colabs_Order_Summary_Table($orders);
        $table->show();
        echo '</div>';
    }
}