Home Forums WoodMart support forum Show acf custom field on the comparison page

Show acf custom field on the comparison page

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #248337

    ferdysan87
    Participant

    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' );
    #248373

    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

    #248470

    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

Viewing 3 posts - 1 through 3 (of 3 total)