ResolvedHow do I hide the Daily Intake boxes?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #37503
    bogdan
    Participant

    I know that there isn’t a setting to hide them so I need to modify the theme’s code, but my client wants them out so there is nothing I can do.

    That being said, how can I hide the “Daily Intake %” boxes that appear below energy, protein, fat…etc?
    And also the string “*DI: Recommended Daily Intake based on 2000 calories diet”.

    #37525
    Alex
    Keymaster

    Hello bogdan,

    The best way would be with the Lafka child theme.
    – Activate the theme
    – Copy following file in it’s root directory: lafka-plugin/incl/nutrition/templates/nutrition-info.php
    – Modify the file by replacing its content with the following one:

    <?php
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    }
    ?>
    <?php if ( count( $lafka_nutrition_list ) || $lafka_product_allergens ): ?>
        <div class="lafka-nutrition-summary">
    		<?php if ( count( $lafka_nutrition_list ) ): ?>
                <ul class="lafka-nutrition-list">
    				<?php foreach ( $lafka_nutrition_list as $nutrition_name => $nutrition_value ): ?>
                        <li <?php if ( $nutrition_name === 'lafka_nutrition_energy' ): ?> class="lafka-nutrition-energy" <?php endif; ?> >
                            <span><?php echo esc_html( Lafka_Nutrition_Config::$nutrition_meta_fields[ $nutrition_name ]['frontend_label'] ); ?></span>
    						<?php echo esc_html( $nutrition_value ) ?> <?php echo esc_html( Lafka_Nutrition_Config::$nutrition_meta_fields[ $nutrition_name ]['frontend_label_weight'] ) ?>
                        </li>
    				<?php endforeach; ?>
                </ul>
    		<?php endif; ?>
    		<?php if ( $lafka_product_allergens ): ?>
                <span class="lafka-nutrition-allergens"><?php esc_html_e( 'Allergens', 'lafka-plugin' ); ?>: <?php echo esc_html( $lafka_product_allergens ); ?></span>
    		<?php endif; ?>
        </div>
    <?php endif; ?>

    Regards,
    Alex

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

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

License required for the following item
Login and Registration Log in · Register