Either "offers", "review", or "aggregateRating" should be specified - Google Error

Tourist
6 0 0

@tim will await your marvelous fix! ;)

0 Likes
New Member
1 0 0

How can we add a review to a product with no reviews?

0 Likes
Shopify Partner
2567 39 586

If your product has no reviews, than it's a warning only, nothing wrong with it.

Here the situation is different -- product has reviews, but the markup is done in a wrong way -- this is an error and should not be ignored.

 

@McGreals -- here is the updated javascript code, using mutationObserver to find when reviews are loaded. Use if assigning SPRCallbacks does not work for you because an App (like StampedIO) overwrites it:

            function watchSPR(mutations, observer) {
              for (m in mutations) {
                var mutation = mutations[m];
                if( mutation.type == "childList" && mutation.addedNodes.length ) {
                  // console.log(mutation.addedNodes);
                  var $m = $(mutation.addedNodes);
                  if( $m.find('.spr-header').length ) {
                    $('[itemprop="itemreviewed"]').remove();
                    $('[itemprop="itemReviewed"]').remove();
                    console.log('SPR Patched');                 
                    
                    setTimeout( function() {
                      observer.disconnect();
                      console.log('Detaching from SPR');
                    }, 1000);
                  } 
                }
              };
            }

            observer.observe(
              document.getElementById('shopify-product-reviews'), 
              {
                childList: true,
                subtree: true
              }
            );

 

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com! My post solved your problem? This is my Paypal too :)
0 Likes