Version Notes
+ Automatic markup creation;
+ The extension displays in search results: product name, stock status, price, currency, product description, product ID, product rating;
+ Intuitive interface;
+ Easy 2-minutes installation;
+ Meets Magento programming practices for most versions and customizations compatibility.
Download this release
Release Info
Developer | MagPleasure Ltd. |
Extension | rich_snippets |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
app/code/local/Magpleasure/Richsnippets/Block/Catalog/Product/View/Markup.php
CHANGED
@@ -43,4 +43,51 @@ class Magpleasure_Richsnippets_Block_Catalog_Product_View_Markup extends Mage_Ca
|
|
43 |
{
|
44 |
return Mage::helper('richsnippets');
|
45 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
43 |
{
|
44 |
return Mage::helper('richsnippets');
|
45 |
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Get Review Summary Model for product
|
49 |
+
*
|
50 |
+
* @return Mage_Review_Model_Review_Summary
|
51 |
+
*/
|
52 |
+
protected function _getReviewSummary()
|
53 |
+
{
|
54 |
+
/** @var Mage_Review_Model_Review_Summary $summaryData */
|
55 |
+
$summaryData = Mage::getModel('review/review_summary')
|
56 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
57 |
+
->load($this->getProduct()->getId());
|
58 |
+
return $summaryData;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Get product average rating value
|
63 |
+
*
|
64 |
+
* @return int
|
65 |
+
*/
|
66 |
+
public function getAverageRating()
|
67 |
+
{
|
68 |
+
if ($this->getProduct()->getRatingSummary()) {
|
69 |
+
return $this->getProduct()->getRatingSummary()->getRatingSummary();
|
70 |
+
} else {
|
71 |
+
/** @var Mage_Review_Model_Review_Summary $summaryData */
|
72 |
+
$summaryData = $this->_getReviewSummary();
|
73 |
+
return $summaryData->getId() ? $summaryData->getRatingSummary() : 0;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Get product reviews count
|
79 |
+
*
|
80 |
+
* @return int
|
81 |
+
*/
|
82 |
+
public function getReviewsCount()
|
83 |
+
{
|
84 |
+
if ($this->getProduct()->getRatingSummary()) {
|
85 |
+
$count = $this->getProduct()->getRatingSummary()->getReviewsCount();
|
86 |
+
return $count ? $count : 0;
|
87 |
+
} else {
|
88 |
+
/** @var Mage_Review_Model_Review_Summary $summaryData */
|
89 |
+
$summaryData = $this->_getReviewSummary();
|
90 |
+
return $summaryData->getId() ? $summaryData->getReviewsCount() : 0;
|
91 |
+
}
|
92 |
+
}
|
93 |
}
|
app/code/local/Magpleasure/Richsnippets/etc/config.xml
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
<config>
|
20 |
<modules>
|
21 |
<Magpleasure_Richsnippets>
|
22 |
-
<version>1.
|
23 |
</Magpleasure_Richsnippets>
|
24 |
</modules>
|
25 |
<frontend>
|
19 |
<config>
|
20 |
<modules>
|
21 |
<Magpleasure_Richsnippets>
|
22 |
+
<version>1.1</version>
|
23 |
</Magpleasure_Richsnippets>
|
24 |
</modules>
|
25 |
<frontend>
|
app/design/frontend/base/default/template/richsnippets/catalog/product/view/markup.phtml
CHANGED
@@ -54,4 +54,11 @@
|
|
54 |
<?php endif; ?>
|
55 |
<meta itemprop="priceCurrency" content="<?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?>">
|
56 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
<?php endif; ?>
|
54 |
<?php endif; ?>
|
55 |
<meta itemprop="priceCurrency" content="<?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?>">
|
56 |
</div>
|
57 |
+
<?php if (!Mage::helper('core')->isModuleEnabled('Magpleasure_Ajaxreviews')): ?>
|
58 |
+
<div style="display: none!important" itemscope itemprop="aggregateRating" itemtype="http://schema.org/AggregateRating">
|
59 |
+
<meta itemprop="bestRating" content="5">
|
60 |
+
<meta itemprop="ratingValue" content="<?php echo round($this->getAverageRating() * 5 / 100); ?>">
|
61 |
+
<meta itemprop="reviewCount" content="<?php echo $this->getReviewsCount(); ?>">
|
62 |
+
</div>
|
63 |
+
<?php endif; ?>
|
64 |
<?php endif; ?>
|
package.xml
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>rich_snippets</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/OSL-3.0">OSL-3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Rich Snippets will allow you to integrate the information about product price, description, availability, currency etc. into search results.</summary>
|
10 |
-
<description>The extension is very easy-to use as there is only one option in the backend. You don
|
11 |
Without Rich Snippets, the AJAX Reviews extension will not display product rating in Google search results.</description>
|
12 |
<notes>+ Automatic markup creation;
|
13 |
-
+ The extension displays in search results: product name, stock status, price, currency, product description, product ID;
|
14 |
+ Intuitive interface;
|
15 |
+ Easy 2-minutes installation;
|
16 |
+ Meets Magento programming practices for most versions and customizations compatibility.</notes>
|
17 |
<authors><author><name>MagPleasure Ltd.</name><user>Magpleasure</user><email>support@magpleasure.com</email></author></authors>
|
18 |
-
<date>2014-11-
|
19 |
-
<time>
|
20 |
-
<contents><target name="magelocal"><dir name="Magpleasure"><dir name="Richsnippets"><dir><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="View"><file name="Markup.php" hash="
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
23 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>rich_snippets</name>
|
4 |
+
<version>1.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/OSL-3.0">OSL-3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Rich Snippets will allow you to integrate the information about product price, description, availability, currency etc. into search results.</summary>
|
10 |
+
<description>The extension is very easy-to use as there is only one option in the backend. You don&#x2019;t need to do markups for Google by yourself: the extension will do it automatically.&#xD;
|
11 |
Without Rich Snippets, the AJAX Reviews extension will not display product rating in Google search results.</description>
|
12 |
<notes>+ Automatic markup creation;
|
13 |
+
+ The extension displays in search results: product name, stock status, price, currency, product description, product ID, product rating;
|
14 |
+ Intuitive interface;
|
15 |
+ Easy 2-minutes installation;
|
16 |
+ Meets Magento programming practices for most versions and customizations compatibility.</notes>
|
17 |
<authors><author><name>MagPleasure Ltd.</name><user>Magpleasure</user><email>support@magpleasure.com</email></author></authors>
|
18 |
+
<date>2014-11-17</date>
|
19 |
+
<time>14:48:58</time>
|
20 |
+
<contents><target name="magelocal"><dir name="Magpleasure"><dir name="Richsnippets"><dir><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="View"><file name="Markup.php" hash="dffe80ee890e6c1e034c3a8dd83bea7d"/></dir><file name="View.php" hash="fafc74633d2da2e9424c244a4e95fd82"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a4e5ffdc508b14e3ac7943f9a3826324"/></dir><dir name="Model"><file name="Observer.php" hash="d3dcb140deadb77529a5cdf3e95da462"/></dir><dir name="etc"><file name="config.xml" hash="f7af120fb5ac50ec744fe40a48743e64"/><file name="system.xml" hash="14320c63de223ce8a877a7ef1d3938d2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="richsnippets.xml" hash="d4d735d9d86674455c90069d0f805fb8"/></dir><dir name="template"><dir name="richsnippets"><dir><dir name="catalog"><dir name="product"><dir name="view"><file name="markup.phtml" hash="75b134588ebc6d15c8d2e4c7659b1607"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magpleasure_Richsnippets.xml" hash="a4cc0de1ab3b0fb132a1e4a2c22c66be"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Magpleasure_Richsnippets.csv" hash="c356d86fd9d1db251c8df93d5fd27ebc"/></dir></target></contents>
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
23 |
</package>
|