Support

Account

Home Forums General Issues Product Category extra description Reply To: Product Category extra description

  • Hello everybody

    Here is the answer I received this morning (French time) of Said, from the official ACF support:

    With the field’s Location rule set as Taxonomy is equal to product_cat, the field should appear on your individual product category edit page. With the code below added in functions.php, the field value displays just fine on the individual category archive in the frontend as shown in this recording: https://www.awesomescreenshot.com/video/5711245?key=aa4a06a3a6ab345566493738b7aad9d5

    add_action( ‘woocommerce_after_main_content’, ‘extra_description’ );
    function extra_description() {

    global $wp_query;

    $product_cat = $wp_query->get_queried_object();
    $cat_ID = $product_cat->term_id;

    $extra_info = get_field( ‘product_extra’, ‘category_’ . $cat_ID );

    if( $extra_info ){
    echo $extra_info;
    }
    }

    So i will try it out and let you know how it goes.