avgear.shop Posted March 10, 2019 Share Posted March 10, 2019 Hello, I use the productcomments module, it has in its php file variables $averageTotal and $nbComment, which work in the module's .tpl file. I would like to use them in the product prodct.tpl file in the main product description. How can I use these variables? Can they be made with global variables so that they work in all tpl of my site? How to do it ? greetings Link to comment Share on other sites More sharing options...
phinq1910 Posted March 11, 2019 Share Posted March 11, 2019 You should assign again it in controller Link to comment Share on other sites More sharing options...
sampsonzak Posted February 14, 2023 Share Posted February 14, 2023 On 3/10/2019 at 3:34 PM, lukaszwojcik said: Hello, I use the productcomments module, it has in its php file variables $averageTotal and $nbComment, which work in the module's .tpl file. I would like to use them in the product prodct.tpl file in the main product description. How can I use these variables? Can they be made with global variables so that they work in all tpl of my site? How to do it ? greetings I need exact help with this issue, same plugin. It works for all products, except the main product, the review/rich snippet is not included on the main product, the code is not working! How can I enable it to work? This is the code, which is unfortunately not working/outputting anything: {if isset($nbComments) && $nbComments && $ratings.avg}"aggregateRating": { "@type": "AggregateRating", "ratingValue": "{$ratings.avg|round:1|escape:'html':'UTF-8'}", "reviewCount": "{$nbComments|escape:'html':'UTF-8'}" },{/if} Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now