Hello Javier,
In next release of Pricing Manager there will be a body css class ‘gd-pkg-id-x’ (where x = package id) on detail page.
You can use following snippet to hide map & address for particular package id.
/**
* Hide address for particular post package id.
*/
function gd_snippet_190207_cf_output_address( $html, $location, $cf, $output ) {
global $gd_post;
if ( empty( $gd_post ) ) {
return $html;
}
if ( ! empty( $gd_post->package_id ) ) {
$package_id = (int) $gd_post->package_id;
if ( $package_id === 2 ) { // Hide address for package id: 2
$html = '<!--hidden-->';
}
}
return $html;
}
add_filter( 'geodir_custom_field_output_address_var_address', 'gd_snippet_190207_cf_output_address', 20, 4 );
/**
* Hide detail map for particular post package id.
*/
function gd_snippet_190207_check_display_map( $display, $params ) {
global $gd_post;
if ( $display && ! empty( $params['posts'] ) && $params['posts'] == $gd_post->ID && ! empty( $gd_post ) && isset( $gd_post->package_id ) ) {
$package_id = (int) $gd_post->package_id;
if ( ( $package_id === 2 ) && ( geodir_is_page( 'detail' ) || geodir_is_page( 'preview' ) ) ) {// Hide map for package id: 2
$display = false;
}
}
return $display;
}
add_filter( 'geodir_check_display_map', 'gd_snippet_190207_check_display_map', 20, 2 );
Thanks,
Kiran