Skip to content

Instantly share code, notes, and snippets.

@PluginRepublicSupport
Last active July 18, 2023 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PluginRepublicSupport/b1b7c5d03cb940b77fcf28d81b6fb1ac to your computer and use it in GitHub Desktop.
Save PluginRepublicSupport/b1b7c5d03cb940b77fcf28d81b6fb1ac to your computer and use it in GitHub Desktop.
Currency Symbol for Calculation Fields
<?php
/** Add the default currency field to calculation values in cart **/
add_filter( 'pewc_filter_item_value_in_cart', function( $field_value, $field ) {
if ( $field['type'] == "calculation" ) {
$field_value = get_woocommerce_currency_symbol() . $field_value;
}
return $field_value;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment