New Landing How can we help? Themeforest Theme Support Neighborhood Warning: Cannot modify header information

Viewing 3 posts - 1 through 3 (of 3 total)
  • #299447
    Baronkelvin
    Member
    Post count: 26

    Hi,

    I tried to paste the code below at functions.php of child theme.
    <?php
    function patricks_custom_variation_price( $price, $product ) {

    $target_product_types = array(
    ‘variable’
    );

    if ( in_array ( $product->product_type, $target_product_types ) ) {
    // if variable product return and empty string
    return ”;
    }

    // return normal price
    return $price;
    }
    add_filter(‘woocommerce_get_price_html’, ‘patricks_custom_variation_price’, 10, 2);

    ?>

    Then I got the warning blow
    (Warning: Cannot modify header information – headers already sent by (output started at /home/content/p3pnexwpnas01_data03/95/3630195/html/wp-content/themes/neighborhood-child/functions.php:41) in /home/content/p3pnexwpnas01_data03/95/3630195/html/wp-includes/pluggable.php on line 1174).

    Could you help me to fix this, thanks ahead.

    #299525
    Baronkelvin
    Member
    Post count: 26

    Problem got solved, thank you.

    #299530
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    No problem. Glad it’s sorted.

    -Rui

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register