Reply 359922 to: Double “breadcrumb” on product pages / Advanced Custom Fields

Avatar: Rose Tyler
Rose Tyler
Support staff
June 21, 2023 at 16:56

Hello, HUSSTLE,

Thank you for your response.

1/ Private Content.

2/ For testing you can check the product in private area.

Code was added to xstore-child/functions.php

add_filter('etheme_single_product_builder_tabs', 'etheme_single_product_builder_tabs_acf_custom');

function etheme_single_product_builder_tabs_acf_custom($tabs) {
    global $product;

    if ( !function_exists('get_field_object') ) return $tabs;

    $product_id = method_exists( $product, 'get_id' ) === true ? $product->get_id() : $product->ID;

    $min_priority = 60;

    $product_features_obj = get_field_object('product_features', $product_id);
    if ( $product_features_obj ) {
        $tabs[$product_features_obj['ID']] = array(
                'title'     => $product_features_obj['label'],
                'priority'  => $min_priority++,
                'callback'  => function ( $custom ) use ( $product_features_obj ) {
                    echo do_shortcode( $product_features_obj['value'] );
                },
            );
    }

Kind Regards,
8theme team

Please contact administrator
for this information.
Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.