admin, 'show_upsell_total_in_order_listings' ), 999, 2 ); } if ( class_exists( 'WFOB_Admin' ) ) { remove_filter( 'woocommerce_get_formatted_order_total', array( WFOB_Core()->admin, 'show_bump_total_in_order_listings' ), 9999, 2 ); } } ); } /** * Creates an instance of the class * @return WooFunnels_Funnel_Builder_Commons */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self; } return self::$instance; } public function show_woofunnels_total_in_order_listings( $column_name, $post_id ) { $total_woofunnels = 0; $order = wc_get_order( $post_id ); $html = ''; if ( 'order_total' === $column_name ) { $show_combined = true; if ( class_exists( 'WFOCU_Admin' ) ) { $result_in_order_currency = $order->get_meta( '_wfocu_upsell_amount_currency' ); if ( true === $show_combined && ! empty( $result_in_order_currency ) ) { $total_woofunnels = $total_woofunnels + $result_in_order_currency; } } if ( class_exists( 'WFOB_Admin' ) ) { if ( true === $show_combined ) { /** * Check if bump accepted in order meta */ $bump_total = $order->get_meta( '_bump_purchase_item_total' ); if ( ! empty( $bump_total ) ) { $total_woofunnels += $bump_total; } } } if ( ! empty( $total_woofunnels ) ) { $html = '

' . sprintf( esc_html__( 'FunnelKit: %s', 'woofunnels' ), wc_price( $total_woofunnels, array( 'currency' => get_option( 'woocommerce_currency' ) ) ) ) . '

'; // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch, WordPress.WP.I18n.MissingTranslatorsComment } } echo $html; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } }