Hi,
I wan’t to edit the Breadcrumbs on the single product page,
Normally is: Home / shop page / product category / product name
I want: Home / shop page / product name (without product category)
I don’t know how to do this, someone can help me???
Thanks
Unfortunately there is no filter to achieve this easily. The filter ‘avia_breadcrumbs_args’ does have an argument which can be used to put taxonomies of posttype into the trail but this does not work for ‘singular_product_taxonomy’ and ‘singular_product_variation_taxonomy’.
As for now the only way to get rid of the product category is to use the filter ‘avia_breadcrumbs_trail’ to remove the element before the last element (the title) using the following code in your child themes functions.php
add_filter( 'avia_breadcrumbs_trail', 'mmx_change_bc_trail', 20, 2 );
function mmx_change_bc_trail( $trail, $args ){
if( is_product() ) {
unset( $trail[count($trail)-2] );
}
return $trail;
}
However this has some caveats. If a product does not belong to a category this function will remove the shop slug from the trail. So I do not recommend to use it without further checks and controls.
Regards
Michael