Support

Account

Home Forums Bug Reports URGENT: error code when trying to add custom field after product description

Unread

URGENT: error code when trying to add custom field after product description

  • Hello, can you help me please, I am trying to add this code in functions.php but it is giving me the error, please could you help me solve it, I will be grateful, thank you.

    add_filter( 'the_content', 'misha_add_something_description_tab' );
    function misha_add_something_description_tab( $content ){
    if( is_product() ) { // I recommend to always use this condition
    $content .= '<table class="vertical-menu">
    <tbody>

    <tr>
    <td class="cabecera"><?php if( get_field('download') ): ?><i class="icon-checkmark"></i>Download:</td>
    <td class="detail"><?php the_field('download'); ?><?php endif; ?></td>
    </tr>

    <tr>
    <td class="cabecera"><?php if( get_field('color') ): ?><i class="icon-checkmark"></i>Color:</td>
    <td class="detail"><?php the_field('color'); ?><?php endif; ?></td>
    </tr>
    </tbody>
    </table>';
    }
    return $content;
    };

    Error

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.