plugin_url = WP_PLUGIN_URL . '/' . str_replace( basename( __FILE__ ), '' , plugin_basename( __FILE__ ) ); add_filter( 'woocommerce_reports_charts', array( &$this, 'reports' ) ); add_action( 'admin_head', array( &$this, 'admin_head' ) ) ; } function admin_head() { global $WC_Donations; wp_register_script( 'donation_tablesorter', $WC_Donations->plugin_url . '/assets/js/datatables/jquery.dataTables.min.js', array( 'jquery' ), '2.0' ); wp_enqueue_script( 'donation_tablesorter' ); wp_register_script( 'donation_tablesorter_clip', $WC_Donations->plugin_url . '/assets/js/datatables/media/js/ZeroClipboard.js', array( 'jquery' ), '2.0' ); wp_enqueue_script( 'donation_tablesorter_clip' ); wp_register_script( 'donation_tablesorter_tools', $WC_Donations->plugin_url . '/assets/js/datatables/media/js/TableTools.js', array( 'jquery' ), '2.0' ); wp_enqueue_script( 'donation_tablesorter_tools' ); wp_register_style( 'donation_tablesorter_css', $WC_Donations->plugin_url . '/assets/js/datatables/media/css/jquery.dataTables.css' ); wp_enqueue_style( 'donation_tablesorter_css' ); wp_register_style( 'donation_tablesorter_tools_css', $WC_Donations->plugin_url . '/assets/js/datatables/media/css/TableTools.css' ); wp_enqueue_style( 'donation_tablesorter_tools_css' ); ?> __( 'Donations', 'woocommerce' ), 'charts' => array( array( 'title' => __('Donations Reporting', 'woocommerce'), 'description' => '', 'hide_title' => true, 'function' => 'ignitewoo_donation_details' ), ) ); return $reports; } function get_product( $product_id, $args = array() ) { $product = null; if ( version_compare( WOOCOMMERCE_VERSION, "2.0.0" ) >= 0 ) { // WC 2.0 $product = get_product( $product_id, $args ); } else { // old style, get the product or product variation object if ( isset( $args['parent_id'] ) && $args['parent_id'] ) { $product = new WC_Product_Variation( $product_id, $args['parent_id'] ); } else { // get the regular product, but if it has a parent, return the product variation object $product = new WC_Product( $product_id ); if ( $product->get_parent() ) { $product = new WC_Product_Variation( $product->id, $product->get_parent() ); } } } return $product; } } global $ignitewoo_event_reports; $ignitewoo_event_reports = new IgniteWoo_Donation_Reports(); function ignitewoo_donation_details() { global $wpdb, $woocommerce; $sql = ' SELECT ID, post_title FROM `' . $wpdb->posts . '` left join `' . $wpdb->postmeta . '` m1 on ID = m1.post_id WHERE m1.meta_key = "_donation" and m1.meta_value = "yes" ORDER BY post_title ASC '; $posts = $wpdb->get_results( $sql ); if ( !isset( $posts ) || '' == $posts ) { _e( 'No donations have been created yet.', 'woocommerce' ); return; } $current_event = absint( $_POST['ignitewoo_donation_select'] ); $event = array(); $options = ''; foreach( $posts as $p ) { $options .= ''; } ?>
|
' . __( 'Shipped to:', 'woocommerce' ) . ' ' . $b['shipping'] ?> |
' . __( 'Shipped to:', 'woocommerce' ) . ' ' . $b['shipping'] ?> |
'; ?>
'; ?>
|
'; ?> |
$vals ) {
// Do not print customer-supplied meta data that contains a URL - could expose sensitive info
// depending on what the customer uploaded via the Event forms
if ( false === strpos( $vals['meta_value'], 'http://' ) && false === strpos( $vals['meta_value'], 'https://' ) )
echo ' ' . $vals['meta_name'] . ' – ' . $vals['meta_value'] . ' '; } ?> |
|