1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | function gb_wc_stripe_payment_data( $post_data, $parent_order ) { if( !empty( $post_data['description'] ) ) { if( strpos( $post_data['description'], 'Payment for 1CU offer' ) !== FALSE ) { $product_id = substr( $post_data['description'], 32 ); $product_id = substr( $product_id, 0, strpos( $product_id, ',' ) ); $product_id = absint( $product_id ); $product = wc_get_product( $product_id ); if( !empty( $product ) ) { $post_data['description'] = $product->get_name(); } } } return $post_data; } add_filter( 'wc_stripe_generate_payment_request', 'gb_wc_stripe_payment_data', 10, 2 ) |