$date = $order_date->date_i18n( wcpdf_date_format( $this, 'order_date' ) );
$mysql_date = $order_date->date( "Y-m-d H:i:s" );
return apply_filters( 'wpo_wcpdf_order_date', $date, $mysql_date, $this );
}
public function order_date() {
echo $this->get_order_date();
}
/**
* Return the order items
*
* @return array $data_list
*/
public function get_order_items(): array {
$items = $this->order->get_items();
$data_list = array();
if ( sizeof( $items ) > 0 ) {
foreach ( $items as $item_id => $item ) {
// Array with data for the pdf template
$data = array();
// Set the item_id
$data['item_id'] = $item_id;
// Set the id
$data['product_id'] = $item['product_id'];
$data['variation_id'] = $item['variation_id'];
// Compatibility: WooCommerce Composite Products uses a workaround for
// setting the order before the item name filter, so we run this first
if ( class_exists( 'WC_Composite_Products' ) ) {
$order_item_class = apply_filters( 'woocommerce_order_item_class', '', $item, $this->order );
}
// Set item name
$data['name'] = apply_filters( 'woocommerce_order_item_name', $item['name'], $item, false );
// Set item quantity
$data['quantity'] = $item['qty'];
// Set the line total (=after discount)
$data['line_total'] = $this->format_price( $item['line_total'] );
$data['single_line_total'] = $this->format_price( $item['line_total'] / max( 1, abs( $item['qty'] ) ) );
$data['line_tax'] = $this->format_price( $item['line_tax'] );
$data['single_line_tax'] = $this->format_price( $item['line_tax'] / max( 1, abs( $item['qty'] ) ) );
$data['tax_rates'] = $this->get_tax_rate( $item, $this->order, false );
$data['calculated_tax_rates'] = $this->get_tax_rate( $item, $this->order, true );
// Set the line subtotal (=before discount)
$data['line_subtotal'] = $this->format_price( $item['line_subtotal'] );
$data['line_subtotal_tax'] = $this->format_price( $item['line_subtotal_tax'] );
$data['ex_price'] = $this->get_formatted_item_price( $item, 'total', 'excl' );
$data['price'] = $this->get_formatted_item_price( $item, 'total' );
$data['order_price'] = $this->order->get_formatted_line_subtotal( $item ); // formatted according to WC settings
// Calculate the single price with the same rules as the formatted line subtotal (!)
// = before discount
$data['ex_single_price'] = $this->get_formatted_item_price( $item, 'single', 'excl' );
$data['single_price'] = $this->get_formatted_item_price( $item, 'single' );
// Pass complete item array
$data['item'] = $item;
// Get the product to add more info
if ( is_callable( array( $item, 'get_product' ) ) ) { // WC4.4+
$product = $item->get_product();
} elseif ( defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '4.4', '<' ) ) {
$product = $this->order->get_product_from_item( $item );
} else {
$product = null;
}
// Checking for existence, thanks to MDesigner0
if ( ! empty( $product ) ) {
// Thumbnail (full img tag)
$data['thumbnail'] = $this->get_thumbnail( $product );
// Set item SKU
$data['sku'] = is_callable( array( $product, 'get_sku' ) ) ? $product->get_sku() : '';
// Set item weight
$data['weight'] = is_callable( array( $product, 'get_weight' ) ) ? $product->get_weight() : '';
// Set item dimensions
if ( function_exists( 'wc_format_dimensions' ) && is_callable( array( $product, 'get_dimensions' ) ) ) {
$data['dimensions'] = wc_format_dimensions( $product->get_dimensions( false ) );
} else {
$data['dimensions'] = '';
}
Warning: Cannot modify header information - headers already sent by (output started at /home/bluetmua/public_html/wp-content/plugins/yoco-payment-gateway/yoco_wc_payment_gateway.php:1) in /home/bluetmua/public_html/wp-includes/pluggable.php on line 1531
Warning: Cannot modify header information - headers already sent by (output started at /home/bluetmua/public_html/wp-content/plugins/yoco-payment-gateway/yoco_wc_payment_gateway.php:1) in /home/bluetmua/public_html/wp-includes/pluggable.php on line 1534