No Microdata Generated in Product Page

  • Posts: 72
  • Thank you received: 0
10 years 1 month ago #195746

-- HikaShop version -- : 2.4.0

hi
after upgrading to hikashop 2.4 business, I do not see microdata generated in product page
it was there till we upgraded to 2.4

Please Log in or Create an account to join the conversation.

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
10 years 1 month ago #195755

Hi,

What was your previous HikaShop version number ?
Is the plugin "system / producttag" right published ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
10 years 1 month ago #195791

hi
it was 2.3.5
and there are no system / producttag plugin installed under this name
there are
System / HikaShop product tag translation plugin and its published
editors-xtd / Hikashop product tag insertion plugin and its published
also
System / HikaShop Microdata on Product Page plugin is published

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 1 month ago #195862

Hi,

Here is the latest version of the microdata plugin:

File Attachment:

File Name: plg_system...3-23.zip
File Size:2 KB

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
10 years 1 month ago #195897

hi again
please note after installing the plugin, the microdata start generating in product page, however, strange behavior of the website , for example, some modules start disappear and not showing on some pages
once I unpublished the plugin, it back to normal

Please Log in or Create an account to join the conversation.

  • Posts: 83766
  • Thank you received: 13555
  • MODERATOR
10 years 1 month ago #195923

Hi,

We found the issue and patched HikaShop. Download again the latest version install package via the menu My account>My subscriptions on our website and install it on yours via the Joomla installer and it will add the patch and it will work fine again.

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 2
10 years 4 weeks ago #198228

I had same problem, after downloaded last version it solved , thank you guys for quick solution.
If I activate comments for my products It seams like the structured attributes are not generated correctly.
If I test product page in Google Structured Data TestingTool it gives next error:
*The review has no reviewed item specified.
*author: missing and required
*The review has no reviewed item specified.
You can even access and see my page : www.dermaquestskincare.com/dermaquest-on...lgae-polishing-scrub
It looks like the micro-data plug-in generate itemprop="reviews" for whole div , but should only for specific review.
Is there a way to fix it? Cause I think it's the problem that google doesn't want to show rating in search result.
Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 3 weeks ago #198348

Hi,

The comments are listed in tables, for each comment the table containing the informations has the attribute itemprop="reviews".
Then in the table you can find a span for the itemprop="author", and another one for itemprop="description"

So I think that all the informations are present in the page. Do you have more informations about how the itemprop properties should be ?

To edit the informations, the view "vote / listing" needs to be edited.
www.hikashop.com/support/support/documen...ize-the-display.html

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 2
10 years 3 weeks ago #198430

Hi Xavier,
I think that plugin generates one extra itemprop="reviews" for div reviews container.
This cause the problem.
Best regards.

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 2
10 years 3 weeks ago #198461

I found there few errors:
- there no itemprop='reviews' it must be itemprop="review"
- You can't have a review without author, otherwise it will not pass validation by Google Structure data test tool.
- I removed itemprope="reviews" from div with id="hikashop_product_vote_listing"
- and added next check for verification if comment list is not empty :
if(strpos($product_page_parts[1],'class="hika_comment_listing_empty"')==false){
$pattern='/class="ui-corner-all hika_comment_listing"/';
$replacement='class="ui-corner-all hika_comment_listing" itemprop="review" itemscope itemtype=" schema.org/Review "';
$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]);
}
All modifications were done in plugins/system/hikashopproducttag/hikashopproducttag.php

It might be useful for somebody else, now I don't have any errors on google structure tool test.

Best regards

The following user(s) said Thank You: BeLlSiBuB

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 3 weeks ago #198497

Hi,

Thank you for the report and the modifications.
We just updated the code on our end based on your informations.

Best regards,

Please Log in or Create an account to join the conversation.

  • Posts: 43
  • Thank you received: 0
10 years 2 weeks ago #199408

I upgraded to latest version of Hikashop but still have the Tool Test errors listed on this thread. Perhaps Hikashop has not been updated with the fix yet?

I removed the "s" from reviews in "hikashopproducttag.php" which fixed 3 errors for me, but a little confused where to place the code to fix the other errors. Please see attachment

Errors:
Failed to normalise the rating value.
Your rating value was out of the default range, you must provide best and worst values.
author: missing and required

Here is the plugin page. Can you tell me what I need to replace please?

<?php

/**

 * @package	HikaShop for Joomla!

 * @version	2.4.0

 * @author	hikashop.com

 * @copyright	(C) 2010-2015 HIKARI SOFTWARE. All rights reserved.

 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html

 */
 

defined('_JEXEC') or die('Restricted access');

?><?php

defined('_JEXEC') or die('Restricted access');

?>

<?php



class plgSystemHikashopproducttag extends JPlugin {

	function onHikashopBeforeDisplayView(&$view){

		$option = JRequest::getString('option');

		$ctrl = JRequest::getString('ctrl');

		$task = JRequest::getString('task');



		if ($option!='com_hikashop'||$ctrl!='product'||$task!='show') return;



		ob_start();

	}

	function onHikashopAfterDisplayView(&$view){

		$option = JRequest::getString('option');

		$ctrl = JRequest::getString('ctrl');

		$task = JRequest::getString('task');



		if ($option!='com_hikashop'||$ctrl!='product'||$task!='show') return;



		$config =& hikashop_config();

		$default_params = $config->get('default_params');



		$product_page = ob_get_clean();



		$product_page_parts = explode('class="hikashop_product_page ', $product_page);

		if(!empty($product_page_parts[1])){

			$product_page_parts[1] = 'itemscope itemtype="http://schema.org/Product" class="hikashop_product_page ' .$product_page_parts[1];



			$pattern='/id="hikashop_product_name_main"/';

			$replacement='id="hikashop_product_name_main" itemprop="name"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1);

			if($default_params['show_price'] == 1){

				$currency_id = hikashop_getCurrency();

				$null = null;

				$currencyClass = hikashop_get('class.currency');

				$currencies = $currencyClass->getCurrencies($currency_id,$null);

				$data=$currencies[$currency_id];



				$pattern='/<span id="hikashop_product_price_main" class="hikashop_product_price_main">/';

				$replacement= '<div itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span id="hikashop_product_price_main" class="hikashop_product_price_main"><meta itemprop="priceCurrency" content="'.$data->currency_code.'" />';

				$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1);

				$pattern='/<(span|div) id="(hikashop_product_weight_main|hikashop_product_width_main|hikashop_product_length_main|hikashop_product_height_main|hikashop_product_characteristics|hikashop_product_options|hikashop_product_custom_item_info|hikashop_product_price_with_options_main|hikashop_product_quantity_main)"/';

				$replacement='</div> <$1 id="$2"';

				$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1);

				$pattern='/class="hikashop_product_price_main"(.*)class="hikashop_product_price hikashop_product_price_0/msU';

				$replacement='class="hikashop_product_price_main" $1 itemprop="price" class="hikashop_product_price hikashop_product_price_0';

				$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1);

			}

			$pattern='/id="hikashop_product_vote_listing"/';

			$replacement='id="hikashop_product_vote_listing" itemprop="review" itemscope itemtype="http://schema.org/Review"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1);



			$pattern='/class="ui-corner-all hika_comment_listing"/';

			$replacement='class="ui-corner-all hika_comment_listing" itemprop="review" itemscope itemtype="http://schema.org/Review"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]);

			$pattern='/class="hikashop_vote_listing_comment"/';

			$replacement='class="hikashop_vote_listing_comment" itemprop="description"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]);



			$pattern='/class="hika_comment_listing_content"/';

			$replacement='class="hika_comment_listing_content" itemprop="description"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]);

			$pattern='/class="hikashop_vote_listing_username"/';

			$replacement='class="hikashop_vote_listing_username" itemprop="author"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]);



			$pattern='/class="hika_vote_listing_username"/';

			$replacement='class="hika_vote_listing_username" itemprop="author"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]);

			$pattern='/class="hikashop_product_description_main"/';

			$replacement='class="hikashop_product_description_main" itemprop="description"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1);

			$pattern='/class="hikashop_vote_stars"/';

			$replacement='class="hikashop_vote_stars" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1);

			$pattern='/id="hikashop_main_image"/';

			$replacement='id="hikashop_main_image" itemprop="image"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]);



			$ratemax=JRequest::getVar("nb_max_star");//nbmax

			$raterounded=JRequest::getVar("rate_rounded");//moy

			$pattern='/(<span\s+class="hikashop_total_vote")/iUs';

			$replacement = '<span style="display:none" itemprop="ratingValue">'.$raterounded.'</span><span style="display:none" itemprop="bestRating">'.$ratemax.'</span>$1 itemprop="reviewCount"';

			$product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1);





		}

		foreach($product_page_parts as $parts){

			echo $parts;

		}

	}

}

Attachments:
Last edit: 10 years 2 weeks ago by BeLlSiBuB.

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 2
10 years 2 weeks ago #199411

Hi BeLlSiBuB,
you should remove
- itemprop="review" from id="hikashop_product_vote_listing"
- add check to validate if review list is not empty in that case add structured tags
- also from hikashop back-end I activated the requirement of user name and e-mail for writing comments, it makes to have author tag (which is required by schema.org)

Please see attached my final hikashopproducttag.php

File Attachment:

File Name: hikashoppr...ttag.txt
File Size:5 KB



Think it will help you.
Br.

Attachments:
The following user(s) said Thank You: BeLlSiBuB

Please Log in or Create an account to join the conversation.

  • Posts: 43
  • Thank you received: 0
10 years 2 weeks ago #199412

Thanks vlanciu. That works :)

Not sure what you mean by this:
add check to validate if review list is not empty in that case add structured tags :oops:

Now when I test a product page with 1 rating I get "All good".
But...
When I test a product page with 2 ratings I get these errors:
Failed to normalise the rating value.
Your rating value was out of the default range, you must provide best and worst values.

I would have thought if it works for one review it should work better for 2 reviews?

Update: Seems to concern the Ratings only and not the comments as when I delete a comment I still get the error presumably because there are still 2 votes.
Update 2: FIXED! My Product was called: Chicken & Broad Bean Pie causing a weird URL, product/cid-6 .
I had to replace the & with "and". Now all seems to be working ok. Thanks for your help!

Attachments:
Last edit: 10 years 2 weeks ago by BeLlSiBuB.

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 0
9 years 10 months ago #204347

Dear Sir
am facing a problem of having the ratingValue all the time is coming as 0, while I checked the product voting_average_score is 4.5.
am checking my product page with google webmaster tools and it says
Failed to normalise the rating value.
Your rating value was out of the default range, you must provide best and worst values.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #204358

Hi,

Please edit the file "plugins/system/hikashopproducttag/hikashopproducttag.php" and replace:

$replacement = '<span style="display:none" itemprop="ratingValue">'.$raterounded.'</span><span style="display:none" itemprop="bestRating">'.$ratemax.'</span>$1 itemprop="reviewCount"';
By:
			preg_match('/<input type="hidden" name="hikashop_vote_rating" .* data-rate="(.*)"/U',$product_page_parts[1],$matches);
			$replacement = '<span style="display:none" itemprop="ratingValue">'.$matches[1].'</span><span style="display:none" itemprop="bestRating">'.$ratemax.'</span>$1 itemprop="reviewCount"';

Please Log in or Create an account to join the conversation.

Time to create page: 0.113 seconds
Powered by Kunena Forum