getdatakick / revws

PrestaShop / ThirtyBees Product Reviews module
https://store.getdatakick.com/en/revws-free?utm_source=github&utm_medium=web&utm_campaign=github
21 stars 9 forks source link

Rich snippet: author issue #155

Closed getdatakick closed 2 years ago

getdatakick commented 3 years ago

Google rich snippets complains about author field. It needs to be fixed in this fashion:

    <div class="revws-review-author-name" {if $microdata}itemprop="author" itemscope itemtype="http://schema.org/Person"{/if}>
        <span {if $microdata}itemprop="name"{/if}>{$review.displayName|escape:'html':'UTF-8'}</span>
    </div>

JS code needs to be updater accordingly

Fred64640 commented 3 years ago

Hello, it gives me the same warning for the "Brand" field

getdatakick commented 3 years ago

Hello, it gives me the same warning for the "Brand" field

"Brand" field is not managed by reviews module. It is part of product metadata, that is managed by your theme.

Fred64640 commented 3 years ago

Hello, in your module what is the file that manages the micodata please thank you

getdatakick commented 3 years ago

Revws module does not emit metadata about product, that is responsibility of theme. Revws module only 'extends' metadata with information about reviews. Everything should work properly, as long as your theme emits product microdata into the product page (and review element is inside the

that contains these metadata)

testing-nerd commented 2 years ago

Google rich snippets complains about author field. It needs to be fixed in this fashion:

    <div class="revws-review-author-name" {if $microdata}itemprop="author" itemscope itemtype="http://schema.org/Person"{/if}>
        <span {if $microdata}itemprop="name"{/if}>{$review.displayName|escape:'html':'UTF-8'}</span>
    </div>

JS code needs to be updater accordingly

Please provide the JS code as well. Thank you!

getdatakick commented 2 years ago

Needed js code is part of the commit that closed this issue: a9f50fe505f4370dce537d014b0807098c3fe097

testing-nerd commented 2 years ago

Thanks for your reply, but where should I add that code in the PAID version of the plugin?

getdatakick commented 2 years ago

Nowhere. You are not supposed to modify paid version. It's nearly impossible for you to do so, as premium version comes with minified js version only.

This fix will be part of the upcoming release

testing-nerd commented 2 years ago

Thanks for the info. I will wait for the next version, hoping it will be released soon.

testing-nerd commented 2 years ago

Any update on the new version? The free version is fixed, but the paid version :(

testing-nerd commented 2 years ago

Nowhere. You are not supposed to modify paid version. It's nearly impossible for you to do so, as premium version comes with minified js version only.

This fix will be part of the upcoming release

I'm really disappointed with the module developer's support. I bought the premium version and noticed the "Author name" issue in the module on the very first day, I contacted the developer by email but he never responded, then I commented here and ask the developer how to add the code in the JS file to fix the problem, and above is his reply! Then I waited and waited and it's been 4 months since I'm waiting for a fix, and there is no response and no so-called upcoming version.

After that, I tried to fix the problem myself. I was hesitant to touch the code because the module developer said "it's nearly impossible for you to do so" , and I'm not a developer, but I had to do it because I did not get any support from the module developer.

So here is the fix:

Search for "revws-review-author-name" in the views/js/front-2_2_2.js file.

And replace this code:

A({itemProp:"author"})),m),

With this one:

A({itemProp:"author",itemScope:!0,itemType:"http://schema.org/Person"})),f.default.createElement("span",A({itemProp:"name"}),m)),

And don't forget to apply the fix in the /views/templates/widgets/review-list/item.tpl file as mentioned by the developer above.

This is working fine so far, and I'm not getting any errors in the google search console anymore, but as I said, I'm not a developer, so please let me know if there is any mistake in the code.

HTH Kind Regards

getdatakick commented 2 years ago

This is working fine so far, and I'm not getting any errors in the google search console anymore, but as I said, I'm not a developer, so please let me know if there is any mistake in the code.

What is the purpose of A function, what parameters does it accept? What is variable m? Why is there only one opening (, but three closing one ) in expression A({itemProp:"author"})),m)?

If you want to manually patch transpiled and minified code, go ahead. I'm not good enough developer to do that. I will not even try to comment if there are any mistakes or not in your code.

testing-nerd commented 2 years ago

You should check the full div element f.default.createElement("div",l({className:"revws-review-author-name"},A({itemProp:"author",itemScope:!0,itemType:"http://schema.org/Person"})),f.default.createElement("span",A({itemProp:"name"}),m)) to understand why there are three closings.

I provided only the code which needs to be replaced to fix the problem, that's why you're seeing the three closings.

Moreover, from what I understand, A= if $microdata and m= $review.displayName

Don't forget that I'm not a developer, it's just my logic after looking at the code.

HTH