Post by bmurphy » Wed Mar 02, 2011 5:15 am

I must say I have so far that Opencart is fantastic ! I have managed to do everything I need to so far but have one problem I need to overcome. I am using version 1.4.9.3

Google has found and crawled my site succesfully and added most content to the index. What is clear though is that it cannot navigate to the Review tab in the product screen. The product screen that contains the "description", " reviews" "additional images" , and "related products" tabs is obviously an ajax control and defaults to showing the "Description" text. As the "Reviews" tab is not navigable via a standard anchor link the search engines don't seem to find it. This review content is quite useful dynamic content so how do I make it navigable so google can find it ?

any suggestions welcome.

Thanks
Bernie

http://www.singerdiscount.com

http://www.singerdiscount.com


Newbie

Posts

Joined
Wed Mar 02, 2011 4:59 am

Post by Chones » Wed Mar 02, 2011 5:36 am

I changed the way reviews were displayed because they are pure AJAX and not included in the HTML code. You lose some functionality if you do this though, such as review pagination. Here's what I did:

Code: Select all

<?php
$reviews = $this->model_catalog_review->getReviewsByProductId($product_id);
if ($reviews) {
foreach ($reviews as $review) {
echo '<p><strong>'.$review['author'].'</strong> on ';
	$date = strtotime($review['date_added']);
	echo date('d M Y',$date); ?><br />
<img src="catalog/view/theme/default/image/stars_<?php echo $review['rating'] ?>.png" alt="<?php echo $review['rating'] ?> out of 5 Stars!" /><br />
	<?php echo $review['text'].'</p>';
	}
} else { ?>
	 <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px; width: 428px;"><?php echo "There are no reviews for this product"; ?></div>
      <?php } ?>
That is readable by the search engines as it outputs the reviews as HTML.

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by bmurphy » Wed Mar 02, 2011 6:04 am

Thanks, have implemented and the text is now HTML as you say. Will a search engine find the REVIEW tab as a link though. There is no direct link I could add in a sitemap to guide it there ?

Cheers

http://www.singerdiscount.com


Newbie

Posts

Joined
Wed Mar 02, 2011 4:59 am

Post by Chones » Wed Mar 02, 2011 6:12 am

Google can use Javascript functions if the functions are in the actual page code, but not if they are linked to, supposedly. For proof you can watch this video - although it is an hour long!
http://googlewebmastercentral.blogspot. ... nners.html

In the case of the tabs on the product page, the javascript code for the tabs is in the page code so it should be fine now the content is HTML - may take a week or so before it starts indexing it though.

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by condomone » Sat Aug 27, 2011 3:38 am

What exactly did you change?
Here is the original :

Code: Select all

<?php if ($reviews) { ?>
<?php foreach ($reviews as $review) { ?>
<div class="content"><b><?php echo $review['author']; ?></b> | <img src="catalog/view/theme/default/image/stars_<?php echo $review['rating'] . '.png'; ?>" alt="<?php echo $review['stars']; ?>" /><br />
  <?php echo $review['date_added']; ?><br />
  <br />
  <?php echo $review['text']; ?></div>
<?php } ?>
<div class="pagination"><?php echo $pagination; ?></div>
<?php } else { ?>
<div class="content"><?php echo $text_no_reviews; ?></div>
<?php } ?>
Chones wrote:I changed the way reviews were displayed because they are pure AJAX and not included in the HTML code. You lose some functionality if you do this though, such as review pagination. Here's what I did:

Code: Select all

<?php
$reviews = $this->model_catalog_review->getReviewsByProductId($product_id);
if ($reviews) {
foreach ($reviews as $review) {
echo '<p><strong>'.$review['author'].'</strong> on ';
	$date = strtotime($review['date_added']);
	echo date('d M Y',$date); ?><br />
<img src="catalog/view/theme/default/image/stars_<?php echo $review['rating'] ?>.png" alt="<?php echo $review['rating'] ?> out of 5 Stars!" /><br />
	<?php echo $review['text'].'</p>';
	}
} else { ?>
	 <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px; width: 428px;"><?php echo "There are no reviews for this product"; ?></div>
      <?php } ?>
That is readable by the search engines as it outputs the reviews as HTML.

Newbie

Posts

Joined
Sat Aug 27, 2011 3:35 am

Post by Chones » Fri Sep 23, 2011 5:22 am

Sorry, I can't find that code anywhere in the default product template - is it from a theme?

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by promofire » Fri Sep 30, 2011 11:44 pm

Hopefully one of you can help me out. Searching the forum led to the same question but never any answers. I need to add a link next to the stars section in the top part of the product page (with model, price, etc) that when clicked will open the review section for people, with either the reviews showing or, if there aren't any, the input boxes. Our customer say they just don't see the tab and some say when they see stars but how to get to the reviews is not obvious to them, they assume the reviews aren't included on the page. We're using 1.4.9.3.

Thanks

Active Member

Posts

Joined
Thu Jan 27, 2011 2:00 am
Who is online

Users browsing this forum: No registered users and 35 guests