Created
February 9, 2021 17:35
-
-
Save plugin-republic/bcb329324e9a1c7545d02cd6a599b635 to your computer and use it in GitHub Desktop.
This file contains 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 child products as meta in parent product | |
*/ | |
add_filter( 'pewc_display_child_product_meta', '__return_true' ); | |
/** | |
* Add the group name to fields | |
*/ | |
function prefix_add_group_to_field_name( $value, $field ) { | |
if( isset( $field['group_id'] ) ) { | |
$group_name = get_the_title( $field['group_id'] ); | |
$value .= ' - ' . $group_name . ' [#' . $field['group_id'] . ']'; | |
} | |
return $value; | |
} | |
add_filter( 'pewc_filter_item_value_in_cart', 'prefix_add_group_to_field_name', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment