Show acf custom field on the comparison page
-
I created a custom field for the short description with acf custom field, which is correctly displayed on the product page. However, if I go to the product comparison page it is not shown, how can I do to show it on that page too?
function descrizione_alternativa($desc){
global $product;
if ( is_single( $product->id ) )
if(! $desc){
if ( have_rows( 'Caratteristiche motosega' ) ){
echo '<ul>';
while ( have_rows('Caratteristiche motosega' ) ) : the_row();
echo '<li>'.'Cilindrata: '.'<strong>'. get_sub_field('cilindrata'). '</strong>' .'</li>';
echo '<li>'.'Potenza: '.'<strong>'. get_sub_field('cilindrata'). '</strong>' .'</li>';
echo '<li>'.'Lunghezza barra: '.'<strong>'. get_sub_field('lunghezza_barra'). '</strong>' .'</li>';
echo '<li>'.'Peso a secco: '.'<strong>'. get_sub_field('peso_a_secco'). '</strong>' .'</li>';
endwhile;
echo '</ul>';
}
}else{
return $desc;
}
}
add_filter( 'woocommerce_short_description', 'descrizione_alternativa' );
Hello,
It can be hardly implemented as the compare page takes attributes for comparison. I will check with our dev team and get back to you.
Best Regards
Hello,
I have checked,
You can find this file: woodmart/inc/integrations/woocommerce/modules/compare.php and find the output of the products in the Compare page in this function: woodmart_get_compared_products_table()
Best Regards