Home Forums WoodMart support forum Undefined constant creates MBs of php notices

Undefined constant creates MBs of php notices

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #147803

    metuza
    Participant

    Hello,

    In your file /wp-content/themes/woodmart/inc/modules/sticky-toolbar.php the $icon_type in line 346 is undefined and filled my debug-log with 3MB of php notices in just a few hours.

    Brgds
    Rune

    #147817

    Artem Temos
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    function woodmart_sticky_toolbar_account_template() {
        if ( ! woodmart_woocommerce_installed() ) {
            return;
        }
        
        $settings = whb_get_settings();
        $is_side  = isset( $settings['account'] ) && 'side' === $settings['account']['form_display'] && $settings['account']['login_dropdown'];
        $classes  = ! is_user_logged_in() && $is_side ? ' login-side-opener' : '';
        
        ?>
        <div class="woodmart-header-links wd-tools-element my-account-with-icon <?php echo esc_attr( $classes ); ?>">
            <a href="<?php echo esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); ?>">
                <span class="wd-tools-icon"></span>
                <span class="woodmart-toolbar-label">
                    <?php echo esc_html_x( 'My account', 'toolbar', 'woodmart' ); ?>
                </span>
            </a>
        </div>
        <?php
    }

    Regards

    #147852

    metuza
    Participant

    As i am not using any custom icons etc. i have just set the $icon_type = false; in file file /wp-content/themes/woodmart/inc/modules/sticky-toolbar.php and this did fix the problem for now.

    I belive you will come up with a fixed file in another version.

    Brgds
    Rune

    #147854

    Artem Temos
    Keymaster

    Yes, we will check this in our next theme update.

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

The topic ‘Undefined constant creates MBs of php notices’ is closed to new replies.