• Resolved israel wissotzky

    (@israelmeirwi)


    I am looking to display only the amount of accumulated votes

    I searched a lot where the information is located but without success

    I dug into the code and found this line
    return number_format_i18n( array_sum( $this->pollRepository->getVotes( $id ) ) );

    But I didn’t understand what the variable THIS is

Viewing 1 replies (of 1 total)
  • Plugin Author TotalSuite

    (@totalsuite)

    Hello!

    If referring to the total votes (aggregated value), you can use this shortcode after enabling the Statistics extension under the TotalPoll > Extensions page.

    [totalpoll-stats]{{totalVotes}}[/totalpoll-stats]
    [totalpoll-stats]{{totalVotesFormatted}}[/totalpoll-stats]
    [totalpoll-stats]{{totalVotesWithLabel}}[/totalpoll-stats]

    Otherwise, if you want to approach it by code, here is a sample snippet:

    TotalPoll( 'polls.repository' )->getById( YOUR_POLL_ID )->getTotalVotes();

    I hope this answers your question! If you need further assistance, please reach out to us at https://totalsuite.net

    Regards,

    TotalSuite Team

Viewing 1 replies (of 1 total)
  • The topic ‘Displaying total votes’ is closed to new replies.