/**
  * Ouput custom columns for products
  *
  * @param   string $column
  * @version 2.3.0
  */
 public function render_order_columns($column)
 {
     $invoice_types_ids = wcj_get_enabled_invoice_types_ids();
     if (!in_array($column, $invoice_types_ids)) {
         return;
     }
     $order_id = get_the_ID();
     $invoice_type_id = $column;
     $html = '';
     if (wcj_is_invoice_created($order_id, $invoice_type_id)) {
         $the_invoice = wcj_get_invoice($order_id, $invoice_type_id);
         $the_number = $the_invoice->get_invoice_number();
         //			$the_url     = $the_invoice->get_invoice_url();
         //			$the_link    = $the_invoice->get_invoice_link();
         //$html .= ' ';
         $query_args = array('order_id' => $order_id, 'invoice_type_id' => $invoice_type_id, 'get_invoice' => '1');
         if ('yes' === get_option('wcj_invoicing_' . $invoice_type_id . '_save_as_enabled', 'no')) {
             $query_args['save_pdf_invoice'] = '1';
         }
         $html .= '<a href="' . add_query_arg($query_args) . '">' . $the_number . '</a>';
         $html .= ' ';
         $html .= '<a href="';
         $html .= add_query_arg(array('delete_invoice_for_order_id' => $order_id, 'invoice_type_id' => $invoice_type_id), remove_query_arg('create_invoice_for_order_id'));
         $html .= '"><span style="color:gray;font-style:italic;font-size:x-small;text-decoration:underline;">' . __('Delete', 'woocommerce-jetpack') . '</span></a>';
         //$html .= '">' . '<img src="http://icons.iconarchive.com/icons/double-j-design/origami-colored-pencil/16/red-cross-icon.png">' . '</a>';
     } else {
         $html .= '<a href="';
         $html .= add_query_arg(array('create_invoice_for_order_id' => $order_id, 'invoice_type_id' => $invoice_type_id), remove_query_arg('delete_invoice_for_order_id'));
         $html .= '"><span style="color:gray;font-style:italic;font-size:x-small;text-decoration:underline;">' . __('Create', 'woocommerce-jetpack') . '</span></a>';
         //$html .= '">' . '<img src="http://icons.iconarchive.com/icons/double-j-design/origami-colored-pencil/16/blue-plus-icon.png">' . '</a>';
     }
     echo $html;
 }
コード例 #2
0
 /**
  * Ouput custom columns for products
  * @param  string $column
  */
 public function render_order_columns($column)
 {
     $invoice_types_ids = wcj_get_enabled_invoice_types_ids();
     if (!in_array($column, $invoice_types_ids)) {
         return;
     }
     $order_id = get_the_ID();
     $invoice_type_id = $column;
     if (!wcj_is_invoice_created($order_id, $invoice_type_id)) {
         return;
     }
     $the_invoice = wcj_get_invoice($order_id, $invoice_type_id);
     $the_number = $the_invoice->get_invoice_number();
     //$the_url = $the_invoice->get_invoice_url();
     //$the_link = $the_invoice->get_invoice_link();
     $query_args = array('order_id' => $order_id, 'invoice_type_id' => $invoice_type_id, 'get_invoice' => '1');
     if ('yes' === get_option('wcj_invoicing_' . $invoice_type_id . '_save_as_enabled', 'no')) {
         $query_args['save_pdf_invoice'] = '1';
     }
     $the_link = '<a href="' . add_query_arg($query_args) . '">' . $the_number . '</a>';
     echo $the_link;
 }
コード例 #3
0
 /**
  * Ouput custom columns for products
  *
  * @param   string $column
  * @version 2.3.10
  */
 public function render_order_columns($column)
 {
     $invoice_types_ids = wcj_get_enabled_invoice_types_ids();
     if (!in_array($column, $invoice_types_ids)) {
         return;
     }
     $order_id = get_the_ID();
     $invoice_type_id = $column;
     $html = '';
     if (wcj_is_invoice_created($order_id, $invoice_type_id)) {
         $the_invoice = wcj_get_invoice($order_id, $invoice_type_id);
         $the_number = $the_invoice->get_invoice_number();
         // Document Link
         $query_args = array('order_id' => $order_id, 'invoice_type_id' => $invoice_type_id, 'get_invoice' => '1');
         if ('yes' === get_option('wcj_invoicing_' . $invoice_type_id . '_save_as_enabled', 'no')) {
             $query_args['save_pdf_invoice'] = '1';
         }
         $html .= '<a href="' . add_query_arg($query_args, remove_query_arg(array('create_invoice_for_order_id', 'delete_invoice_for_order_id'))) . '">' . $the_number . '</a>';
         // Delete button
         $delete_button_label = get_option('wcj_invoicing_' . $invoice_type_id . '_admin_column_delete_btn', __('Delete', 'woocommerce-jetpack'));
         if ('' != $delete_button_label) {
             $html .= ' ';
             $html .= '<a href="';
             $html .= add_query_arg(array('delete_invoice_for_order_id' => $order_id, 'invoice_type_id' => $invoice_type_id), remove_query_arg('create_invoice_for_order_id'));
             $html .= '"><span style="color:gray;font-style:italic;font-size:x-small;text-decoration:underline;">' . $delete_button_label . '</span></a>';
         }
     } else {
         // Create Button
         $create_button_label = get_option('wcj_invoicing_' . $invoice_type_id . '_admin_column_create_btn', __('Create', 'woocommerce-jetpack'));
         if ('' != $create_button_label) {
             $html .= '<a href="';
             $html .= add_query_arg(array('create_invoice_for_order_id' => $order_id, 'invoice_type_id' => $invoice_type_id), remove_query_arg('delete_invoice_for_order_id'));
             $html .= '"><span style="color:gray;font-style:italic;font-size:x-small;text-decoration:underline;">' . $create_button_label . '</span></a>';
         }
     }
     echo $html;
 }
コード例 #4
0
 function wcj_is_invoice_created($order_id, $invoice_type_id)
 {
     $the_invoice = wcj_get_invoice($order_id, $invoice_type_id);
     return $the_invoice->is_created();
 }