Post by Dhaupin » Sat Aug 23, 2014 2:00 am

Since reviews are loaded with javascript bots cant see them. This means they dont get indexed and they cant see any RDF for them. Here is a vQmod snippet that will expose your first paginated page of reviews in the actual source:

Code: Select all

<modification>

	<id><![CDATA[PHP reviews loader - destroys the js load except on pagination.]]></id>
	<version><![CDATA[1.0.0]]></version>
	<vqmver><![CDATA[2.4.1]]></vqmver>
	<author><![CDATA[CreadevDotOrg]]></author>

	<!-- makes php load first page of reviews -->
	<file name="catalog/view/theme/*/template/product/product.tpl">

		<operation info="adds reviews PHP loader">
			<search position="replace"><![CDATA[
				<div id="review"></div>
			]]></search>
			<add><![CDATA[
				<div id="review"><?php echo file_get_contents($this->config->get('config_url') . 'index.php?route=product/product/review&product_id=' . $product_id); ?></div>
			]]></add>
		</operation>
		<operation info="kills reviews JS loader">
			<search position="replace"><![CDATA[
				$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');
			]]></search>
			<add><![CDATA[
				// js review injector removed and replaced with php get file contents
				// $('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?
			]]></add>
		</operation>

	</file>

</modification>
If you want to adjust the pagination of reviews, to add more, here is another vQ snippet that you can add to that. In this example we will change it to 100 reviews per page (shows 100 reviews in source then). This will make reviews "based on 100 reviews" in SERPS:

Code: Select all

	<!-- Reviews pagination fix at product level -->
	<file name="catalog/controller/product/product.php">

		<operation info="increases ajax pull to 100">
			<search position="replace"><![CDATA[
				$results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);
			]]></search>
			<add><![CDATA[
				$results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 100, 100);
			]]></add>
		</operation>
		<operation info="increases pagination limit to 100">
			<search position="replace"><![CDATA[
				$pagination->limit = 5;
			]]></search>
			<add><![CDATA[
				$pagination->limit = 100;
			]]></add>
		</operation>

	</file>
In the RDF mods ive seen, no one seems to fix this causing non loads of snippets. Have fun all

Vultr 768MB ($5!!) | LiquidWeb | DigitalOcean


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by anthonyf » Wed Apr 01, 2015 12:00 am

This is great! Would this work for 2.0.1.1?
If so, how do i go about installing this?

Thank you,
Anthony

Newbie

Posts

Joined
Tue Mar 31, 2015 7:03 am

Post by dogacankanat » Fri Aug 07, 2015 3:35 am

Hello Dhaupin,
Thank you so much for this quick fix. It works perfectly with Opencart 1.5.6.4 and Journal 2 theme.
Cheers!

User avatar
New member

Posts

Joined
Sat Feb 12, 2011 7:22 am
Location - Praha

Post by igalsm » Fri Jan 27, 2017 7:26 am

Would this work for 2.0.1.1?

New member

Posts

Joined
Tue Sep 27, 2016 4:26 am
Who is online

Users browsing this forum: No registered users and 16 guests