Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #935299

    I have created addition product tabs, but they are not showing on the product page, please can someone help me

    Please tell me there is quick CSS so I can show these fields

    #935780

    Hey sambo258,

    Thank you for using Enfold.

    Are you using the ACF plugin? Where do you want to place the info? Please try to use wooocommerce hooks to render the custom fields. Example:

    add_action(    'woocommerce_after_single_product_summary', 'woocommerce_output_extra_info', 2 );
    function woocommerce_output_extra_info() {
        echo get_field('some_value');
    }

    // https://www.advancedcustomfields.com/resources/get_field/
    // http://hookr.io/actions/woocommerce_after_single_product_summary/

    Best regards,
    Ismael

    #936017

    Hi Ismael.

    Yes it’s the ACF plugin

    Is this in the bottom of PHP Function per chance/

    #936024

    add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_extra_info’, 2 );
    function woocommerce_output_extra_info() {
    echo get_field(‘chakra’);
    echo get_field(‘mohs’);
    echo get_field(‘measurements’);
    echo get_field(‘origin’);
    echo get_field(‘grade’);
    }

    Does that look right?

    #936038

    Hi,

    Yes, that looks right, you can also try this one so it has labels with it:

    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_extra_info', 2 );
    function woocommerce_output_extra_info() {
        echo '<p><strong>Chakra:</strong> ' . get_field('chakra') . '</p>';
        echo '<p><strong>MoHs:</strong> ' . get_field('mohs') . '</p>';
        echo '<p><strong>Measurements:</strong> ' . get_field('measurements') . '</p>';
        echo '<p><strong>Origin:</strong> ' . get_field('origin') . '</p>';
        echo '<p><strong>Grade:</strong> ' . get_field('grade') . '</p>';
    }

    Hope it helps :)

    Best regards,
    Nikko

    #936060

    Excellent, don’t know if you know how to make it show in the “Additional information” box per chance?

    #936233

    Hi,

    // This code should be added to the functions.php file of the child theme
    // Add custom info to Additional Information product tab
    add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
    function woo_rename_tabs( $tabs ) {
        global $product;
        $tabs['additional_information']['callback'] = 'custom_function_name'; // this is the function name which is included below
        return $tabs;
    }
    function custom_function_name(){
        echo '<p><strong>Chakra:</strong> ' . get_field('chakra') . '</p>';
        echo '<p><strong>MoHs:</strong> ' . get_field('mohs') . '</p>';
        echo '<p><strong>Measurements:</strong> ' . get_field('measurements') . '</p>';
        echo '<p><strong>Origin:</strong> ' . get_field('origin') . '</p>';
        echo '<p><strong>Grade:</strong> ' . get_field('grade') . '</p>';
    }

    Use the code like that, it should be OK!
    Let us know if you need something else.

    Best regards,
    Basilis

    #936485

    That worked fine thanks :)

    #936568

    Hi sambo258,

    Glad we could help :)

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1125471

    Hi, this code is no longer working with the new update.
    Please can someone help.

    #1125536

    Never mind I reinstalled the old 4.5 version and it works again

    #1125591

    Hi sambo258,

    We apologize for the inconvenience and glad that it works now.
    We’ll keep this thread open so you can comeback when the next version of Enfold is released.

    Best regards,
    Nikko

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.