Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wcfm_refund_request_additional_info_column_label', function( $column_label ) {
- return 'Details';
- });
- add_filter( 'wcfm_refund_requests_additonal_data_hidden', '__return_false' );
- add_filter( 'wcfm_refund_request_additonal_data',function( $column_data, $refund_request_id ) {
- global $wpdb;
- $column_data_html = '';
- $sql = 'SELECT od1.product_id, mt1.value FROM ' . $wpdb->prefix . 'wcfm_marketplace_refund_request AS commission';
- $sql .= ' INNER JOIN ' . $wpdb->prefix . 'wcfm_marketplace_orders AS od1 ON ( commission.order_id = od1.order_id ) AND ( commission.item_id = od1.item_id )';
- $sql .= ' INNER JOIN ' . $wpdb->prefix . 'wcfm_marketplace_refund_request_meta AS mt1 ON ( commission.ID = mt1.refund_id ) ';
- $sql .= ' WHERE 1=1 ';
- $sql .= ' AND (commission.ID = ' . $refund_request_id . ') AND (mt1.key = "refunded_qty")';
- $result = $wpdb->get_row($sql);
- $product_link = '<a target="_blank" href="' . get_wcfm_edit_product_url( $result->product_id ) . '" class="wcfm_dashboard_item_title transaction_order_id">'. get_the_title($result->product_id) . '</a>';
- $column_data_html = '<p> Product: ' . $product_link . '</p>';
- $column_data_html .= '<p> Qty: ' . $result->value . '</p>';
- return $column_data_html;
- }, 50, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement