• Resolved miikewordpress

    (@miikewordpress)


    Hello,

    Thank you, I just installed this plugin yesterday and I really like it!

    However there’s one thing I’m wondering about Nutrition Facts label.

    There are certain food that we need to show additional nutrients such as Vitamin B, Potassium, Magnesium, etc.

    I think the current format is the standard FDA format but is there a possibility to add some custom nutrients under the Nutrition Tab below the standard nutrition?

    For example
    Click to view an example

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Hi @miikewordpress,

    Glad to hear you like it!

    Currently, the only way to add such info would be to use a filter to edit the html output of the label:

    add_filter('zrdn__nutrition_get_label',   'ZRDN\my_edit_label', 20);
    function my_edit_label($html){
    	$find = '<table class="nutrition-facts__table--grid">';
    	$new = '<tr><td colspan="2">Potassium</td><td>4%</td></tr>';
    	$html = str_replace($find, $find.$new, $html);
    	return $html;
    }

    I’m working on a complete new version, where there will be much more options to edit the output.

    Hope this helps!

    Thread Starter miikewordpress

    (@miikewordpress)

    Thank you! I really appreciate it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Additional Nutrition’ is closed to new replies.