Review stars are not showing
-
I’m having problems displaying the stars of the reviews properly, both in the widget where I show the latest reviews on the main page, and in the service products when creating a new review, it doesn’t show or load the stars so that users can choose the Rate. Any suggestions?
Reference URL of one of the services (product) on the page: https://rolystaxi.com/servicio-taxis/taxi-privado-en-cuba/#judgeme_product_reviews
PS: I followed the guide I saw in another thread here on this topic and it didn’t solve the problem.Also, it has been giving an error on this line of the plugin for a few days now: reference to the error shown in the log:
PHP Warning: Array to string conversion in /home/rolystaxi/htdocs/rolystaxi.com/wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/header-template.php on line 3Thank you.
- This topic was modified 2 months, 4 weeks ago by dluiso. Reason: Forgot add other information
The page I need help with: [log in to see the link]
-
For the moment (temporally) to see the stars on the carousel widget on the front page, I put this code in the fuctions.php file in the main theme.
function modify_jdgm_star_shortcode_output($output, $tag) {
// Verify if the shortcode is Judge.me Carousel
if ($tag === 'jgm-featured-carousel') {
// Search and replace the spans with class jdgm-star jdgm--on
$output = str_replace('jdgm-star jdgm--on', 'jdgm-star jdgm--on fa fa-star', $output);
}
return $output;
}
// Apply the fuction on the shortcode jgm-featured-carousel
add_filter('do_shortcode_tag', 'modify_jdgm_star_shortcode_output', 10, 2);But in the product page I can’t see any stars so far.
In an attempt to fix the array error, I used ChatGpt to find a solution, and it gave me this code to replace all the code in the header-template.php file and it has solved all the errors related to displaying the rating stars, by the way I had to remove the previous code that I put here because they did not work together.
By doing that it stopped showing the word Array on the web header and now it shows this text: rolystaxi.com woocommerce, which I can’t find a way to hide or solve.
This is the code I used to replace the one that was in the file I mentioned where I get the error.<!-- Start of Judge.me Core -->
<?php
echo $setting['settings'];
if (is_array($html_miracle)) {
// Convierte el array en un string, uniendo los elementos con un separador (por ejemplo, una línea nueva)
$html_miracle = implode("\n", $html_miracle);
}
echo $html_miracle;
?>
<script data-cfasync='false' class='jdgm-script'>
!function(e){
window.jdgm=window.jdgm||{},jdgm.CDN_HOST="https://<?php echo $jdgm_cdn_domain ?>/",
jdgm.docReady=function(d){
(e.attachEvent?"complete"===e.readyState:"loading"!==e.readyState)?
setTimeout(d,0):e.addEventListener("DOMContentLoaded",d)
},
jdgm.loadCSS=function(d,t,o,a){
!o&&jdgm.loadCSS.requestedUrls.indexOf(d)>=0||(jdgm.loadCSS.requestedUrls.push(d),
(a=e.createElement("link")).rel="stylesheet",a.class="jdgm-stylesheet",a.media="nope!",
a.href=d,a.onload=function(){this.media="all",t&&setTimeout(t)},
e.body.appendChild(a))
},
jdgm.loadCSS.requestedUrls=[],
jdgm.docReady(function(){
(window.jdgmLoadCSS||e.querySelectorAll(
".jdgm-widget, .jdgm-all-reviews-page").length>0)&&
(jdgmSettings.widget_load_with_code_splitting?
parseFloat(jdgmSettings.widget_version)>=3?
jdgm.loadCSS(jdgm.CDN_HOST+"widget_v3/base.css"):
jdgm.loadCSS(jdgm.CDN_HOST+"widget/base.css"):
jdgm.loadCSS(jdgm.CDN_HOST+"shopify_v2.css"))
})
}(document);
</script>
<script async data-cfasync="false" type="text/javascript" src="https://<?php echo $jdgm_cdn_domain ?>/loader.js"></script>
<noscript><link rel="stylesheet" type="text/css" media="all" href="https://<?php echo $jdgm_cdn_domain ?>/shopify_v2.css"></noscript>
<!-- End of Judge.me Core -->I apologize to the developers if I modified their plugin, but I am trying to find a solution to this error that I am having. Any help in this regard will be very grateful.
Hi there,
In case the review stars are not showing on our widgets, it may due to the css library fails to populate. Since the css library is located in judgeme-product-reviews-woocommerce/templates/judgeme/header-template.php, have you tried to solve it by following this solution yet? This would also solve the ‘array’ text issue appeared on the top page.
Let me know if this works on your case as well.
Hi @arkjudgeme, thanks for replying. At the moment I have only applied the last code that I mentioned to you, which was the one I used to replace the contents of the file: judgeme-product-reviews-woocommerce/templates/judgeme/header-template.php, which temporarily solved the problem with the stars, but I can’t find the definitive solution for the stars to work properly, as well as removing from the site header that string from the Array that shows me ‘rolystaxi.com woocommerce’. Any help you can point me towards the solution would be very grateful.
Hi?@arkjudgeme, Sorry for my insistence, but I still have problems with the plugin, I keep getting this ‘rolystaxi.com woocommerce’ above the site header, as you can see in this link: https://ibb.co/FVK32Lp in the message you left me you told me about a solution, but I don’t see a link or anything that tells me what the possible solution would be, please forgive me if I didn’t realize what the solution you are proposing is.
As I told you, I replaced the content of the header-template.php file with this one that I am going to refer to here, since the one that comes with the plugin does not show the rating stars. I achieved this solution using ChatGpt. I am aware that it is not definitive, because it is not part of its original programming, but for now at least it shows the stars, but it puts the message above the menu on all pages.
<!-- Start of Judge.me Core -->
<?php
echo $setting['settings'];
if (is_array($html_miracle)) {
// Convierte el array en un string, uniendo los elementos con un separador (por ejemplo, una línea nueva)
$html_miracle = implode("\n", $html_miracle);
}
echo $html_miracle;
?>
<script data-cfasync='false' class='jdgm-script'>
!function(e){
window.jdgm=window.jdgm||{},jdgm.CDN_HOST="https://<?php echo $jdgm_cdn_domain ?>/",
jdgm.docReady=function(d){
(e.attachEvent?"complete"===e.readyState:"loading"!==e.readyState)?
setTimeout(d,0):e.addEventListener("DOMContentLoaded",d)
},
jdgm.loadCSS=function(d,t,o,a){
!o&&jdgm.loadCSS.requestedUrls.indexOf(d)>=0||(jdgm.loadCSS.requestedUrls.push(d),
(a=e.createElement("link")).rel="stylesheet",a.class="jdgm-stylesheet",a.media="nope!",
a.href=d,a.onload=function(){this.media="all",t&&setTimeout(t)},
e.body.appendChild(a))
},
jdgm.loadCSS.requestedUrls=[],
jdgm.docReady(function(){
(window.jdgmLoadCSS||e.querySelectorAll(
".jdgm-widget, .jdgm-all-reviews-page").length>0)&&
(jdgmSettings.widget_load_with_code_splitting?
parseFloat(jdgmSettings.widget_version)>=3?
jdgm.loadCSS(jdgm.CDN_HOST+"widget_v3/base.css"):
jdgm.loadCSS(jdgm.CDN_HOST+"widget/base.css"):
jdgm.loadCSS(jdgm.CDN_HOST+"shopify_v2.css"))
})
}(document);
</script>
<script async data-cfasync="false" type="text/javascript" src="https://<?php echo $jdgm_cdn_domain ?>/loader.js"></script>
<noscript><link rel="stylesheet" type="text/css" media="all" href="https://<?php echo $jdgm_cdn_domain ?>/shopify_v2.css"></noscript>
<!-- End of Judge.me Core -->Please, I will appreciate any help in this regard.
Hello @dluiso,
To troubleshoot further, please send us an email with a summary of this issue to [email protected] so I can forward to my advanced team.
Looking forward to hearing you from there.
I’m having the same issue (with the word Array & not showing). Opened a separate topic for it, too. Any help would be greatly appreciated.
Same on my side.
It is the case for the 2 last versions of the plugin.
That’s why, I decided to keep the 1.3.22 version which is stable
@imade57 do you know if there’s any way to download that? I only see 1.3.2 when I access the plugin, and then it only allows me to update to 1.3.24
Support just resolved the issue for me. I had to add the .js files to the exclusion list in my optimization plugin (WP Optimize in my case) and make an adjustment to the header template (place css there directly if I read it correctly).
Hi,
Actually, I don’t know how to rollback the version. I tried first the upgrade on my local environment and while it’s not working, I don’t release it on my live environment.
May I ask you to share with me more info about the change you did in the header template ?
Regarding the exclusion of the .js file, I don’t have any cache or optimizer plugin, so may be it could work only with the header adaptation.
Thanks
This is from my developer who fixed it for me.
I have updated the code in judgeme-product-reviews-woocommerce/templates/judgeme/header-template.php
found that $html_miracle variable is an array and it was printed directly as an Array. So I have added the code to check array type and update $html_miracle variable to print CSS correctly.
? -- Start of Judge.me Core -->
2 <?php echo $setting['settings']; ??
3 <?php if (is_array($html_miracle) && isset ($html_
miracle[ 'html _miracle'])) €
$html_miracle = $html_miracle['html_miracle'];
5 }
6 echo $html_miracle; ??- This reply was modified 2 months, 1 week ago by rostamx.
Thanks a lot for your help. I mixed your solution with my own and now all is working ??
Please find below my custom adaptation :
<!-- Start of Judge.me Core -->
<?php
echo $setting['settings'];
if (is_array($html_miracle)) {
// Convierte el array en un string, uniendo los elementos con un separador (por ejemplo, una línea nueva)
$html_miracle = $html_miracle['html_miracle'];
}
echo $html_miracle;
?>Yes at the end i figure out for my own playing with the code and got the same solution so far, maybe is not the best but it’s working. I will let here the full code in case someone have the same issue, replace the code at the file wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/header-template.php
<!-- Start of Judge.me Core -->
<?php
echo $setting['settings'];
if (is_array($html_miracle)) {
// Convierte el array en un string, uniendo los elementos con un separador (por ejemplo, una línea nueva)
$html_miracle = $html_miracle['html_miracle'];
}
echo $html_miracle;
?>
<script data-cfasync='false' class='jdgm-script'>
!function(e){window.jdgm=window.jdgm||{},jdgm.CDN_HOST="https://<?php echo $jdgm_cdn_domain ?>/",
jdgm.docReady=function(d){(e.attachEvent?"complete"===e.readyState:"loading"!==e.readyState)?
setTimeout(d,0):e.addEventListener("DOMContentLoaded",d)},jdgm.loadCSS=function(d,t,o,a){
!o&&jdgm.loadCSS.requestedUrls.indexOf(d)>=0||(jdgm.loadCSS.requestedUrls.push(d),
(a=e.createElement("link")).rel="stylesheet",a.class="jdgm-stylesheet",a.media="nope!",
a.href=d,a.onload=function(){this.media="all",t&&setTimeout(t)},e.body.appendChild(a))},
jdgm.loadCSS.requestedUrls=[],jdgm.docReady(function(){(window.jdgmLoadCSS||e.querySelectorAll(
".jdgm-widget, .jdgm-all-reviews-page").length>0)&&(jdgmSettings.widget_load_with_code_splitting?
parseFloat(jdgmSettings.widget_version)>=3?jdgm.loadCSS(jdgm.CDN_HOST+"widget_v3/base.css"):
jdgm.loadCSS(jdgm.CDN_HOST+"widget/base.css"):jdgm.loadCSS(jdgm.CDN_HOST+"shopify_v2.css"))})}(document);
</script>
<script async data-cfasync="false" type="text/javascript" src="https://<?php echo $jdgm_cdn_domain ?>/loader.js"></script>
<noscript><link rel="stylesheet" type="text/css" media="all" href="https://<?php echo $jdgm_cdn_domain ?>/shopify_v2.css"></noscript>
<!-- End of Judge.me Core -->
- You must be logged in to reply to this topic.