Not sure where to ask for help
1'st) Devnull69 thank you - with only a minor change that code did exactly as asked.
2'nd) The end result has fixed a problem but created an unexpected new one, unfortunately I do not know exactly if it is a script problem or smart snippet microdata problem - so I'm going to try and expand on the explanation of what i'm doing and maybe someone can help or direct me to the best source.
-- I have a page which will contain a series of reviews for a business, each review will be coded with microdata formats - because this page will contain multiple reviews on it we will also code a DIV or section that contains the microdata format for "Review-aggregate"
-- The reviews are published by filling out a form which on submit pre-formats the results with HTML,CSS and Microdata format as needed and outputs the results to a file which is then brought into a HTML page using a PHP include statement when the relevant HTML page is served to the browser.
-- THE PROBLEM: All of the individual reviews and the data are parsed properly as microdata format by google when we test the end results EXCEPT for the 2 values that the script creates. - This only occurs when google tries to parse the data, if you look at the page in a browser then the 2 values create by the script calculate and display properly.
-- MY THOUGHTS: So, here is what I think is happening and if the hypothesis is correct I need to know if this can be corrected through script or any other suggestion:
1.) The script HAS to be placed/run at the end of the HTML file AFTER the reviews, otherwise if placed in the header or beginning of the body the script does not see the reviews so it calculates 0 for both values.
2.) Google on the other hand parses the page in order from the beginning of the code to the end, thus when googles parser looks for the VALUES in the two fields it see's NOTHING because the script has not run yet to produce the values.
I am sorry if this is ultimately not a script issue but I do not know where it really falls and this is the best way to describe the problem being created. Thanks in advance!