is_paid() public method

Returns if an order has been paid for based on the order status.
Since: 2.5.0
public is_paid ( ) : boolean
return boolean
Beispiel #1
0
 /**
  * Test: is_paid
  */
 function test_is_paid()
 {
     $object = new WC_Order();
     $object->set_status('pending');
     $this->assertFalse($object->is_paid());
     $object->set_status('processing');
     $this->assertTrue($object->is_paid());
 }
 /**
  * Get HTML for the order items to be shown in emails.
  * @param WC_Order $order
  * @param array $args
  * @since 2.7.0
  */
 function wc_get_email_order_items($order, $args = array())
 {
     ob_start();
     $defaults = array('show_sku' => false, 'show_image' => false, 'image_size' => array(32, 32), 'plain_text' => false, 'sent_to_admin' => false);
     $args = wp_parse_args($args, $defaults);
     $template = $args['plain_text'] ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
     wc_get_template($template, array('order' => $order, 'items' => $order->get_items(), 'show_download_links' => $order->is_download_permitted(), 'show_sku' => $args['show_sku'], 'show_purchase_note' => $order->is_paid(), 'show_image' => $args['show_image'], 'image_size' => $args['image_size'], 'plain_text' => $args['plain_text'], 'sent_to_admin' => $args['sent_to_admin']));
     return apply_filters('woocommerce_email_order_items_table', ob_get_clean(), $order);
 }