Created
October 17, 2025 14:22
-
-
Save plugin-republic/b1d66f0dab09b4c60cbd84e32019b3c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Display the value of a specific field as a price | |
| * Update the field_id to match your own field ID | |
| */ | |
| function demo_display_value_as_price( $value, $item ) { | |
| if( $item['field_id'] == '1047' && $item['type'] == 'number' ) { | |
| $value = wc_price( $value ); | |
| } | |
| return $value; | |
| } | |
| add_filter( 'pewc_filter_item_value_in_cart', 'demo_display_value_as_price', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment