Show extra information in section “Totals”
You should use hook wpo_cart_updated_additional_data.
For example, you installed “WooCommerce Account Funds” and want to show amount funded for this customer.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
if ( class_exists( 'WC_Account_Funds' ) ) { add_filter( 'wpo_cart_updated_additional_data', function ( $additional_data, $cart_data ) { if ( !empty( $cart_data['customer']['id'] ) ) { $additional_data[] = array( 'title' => __( 'Amount Funded', 'woocommerce-account-funds' ), 'value_without_tax' => '', 'value_total' => WC_Account_Funds::get_account_funds( $cart_data['customer']['id'], true ), ); } return $additional_data; }, 10, 2 ); } |