Version Notes
Lipscore main rating widget is shown on a product page in any case.
Product's extra information has been added to Lipscore widgets.
Download this release
Release Info
Developer | Henning Frettem |
Extension | lipscore |
Version | 1.2.23 |
Comparing to | |
See all releases |
Code changes from version 1.2.22 to 1.2.23
- app/code/community/Lipscore/RatingsReviews/Block/Catalog/Product/Reviews.php +26 -0
- app/code/community/Lipscore/RatingsReviews/Block/Review/Helper.php +45 -2
- app/code/community/Lipscore/RatingsReviews/Helper/Price.php +102 -0
- app/code/community/Lipscore/RatingsReviews/Helper/Product.php +87 -8
- app/code/community/Lipscore/RatingsReviews/Helper/Reminder.php +1 -8
- app/code/community/Lipscore/RatingsReviews/Helper/Widget.php +60 -0
- app/design/frontend/base/default/layout/lipscore_ratingsreviews.xml +1 -1
- app/design/frontend/base/default/template/lipscore/purchase/view.phtml +3 -5
- app/design/frontend/base/default/template/lipscore/rating/view.phtml +4 -7
- app/design/frontend/base/default/template/lipscore/reviews/view.phtml +3 -14
- app/design/frontend/base/default/template/lipscore/reviews/view_single.phtml +1 -1
- package.xml +6 -6
app/code/community/Lipscore/RatingsReviews/Block/Catalog/Product/Reviews.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Lipscore_RatingsReviews_Block_Catalog_Product_Reviews extends Mage_Catalog_Block_Product_View
|
4 |
+
{
|
5 |
+
protected function _beforeToHtml()
|
6 |
+
{
|
7 |
+
try {
|
8 |
+
$this->prepareWidgetAttrs();
|
9 |
+
} catch (Exception $e) {
|
10 |
+
Lipscore_RatingsReviews_Logger::logException($e);
|
11 |
+
}
|
12 |
+
|
13 |
+
return parent::_beforeToHtml();
|
14 |
+
}
|
15 |
+
|
16 |
+
protected function prepareWidgetAttrs()
|
17 |
+
{
|
18 |
+
$widgetHelper = $this->helper('lipscore_ratingsreviews/widget');
|
19 |
+
$productHelper = $this->helper('lipscore_ratingsreviews/product');
|
20 |
+
|
21 |
+
$productData = $productHelper->getProductData($this->getProduct());
|
22 |
+
$productAttrs = $widgetHelper->getProductAttrs($productData);
|
23 |
+
|
24 |
+
$this->setLsProductAttrs($productAttrs);
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Lipscore/RatingsReviews/Block/Review/Helper.php
CHANGED
@@ -10,11 +10,54 @@ class Lipscore_RatingsReviews_Block_Review_Helper extends Mage_Review_Block_Help
|
|
10 |
|
11 |
public function getSummaryHtml($product, $templateType, $displayIfNoReviews)
|
12 |
{
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
15 |
$this->setRatingType(self::$_availableTypes[$templateType]);
|
16 |
$this->setProduct($product);
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
return $this->toHtml();
|
19 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
10 |
|
11 |
public function getSummaryHtml($product, $templateType, $displayIfNoReviews)
|
12 |
{
|
13 |
+
try {
|
14 |
+
$templateType = $this->getTemplateType($templateType);
|
15 |
+
} catch (Exception $e) {
|
16 |
+
$templateType = 'short';
|
17 |
+
Lipscore_RatingsReviews_Logger::logException($e);
|
18 |
+
}
|
19 |
+
|
20 |
$this->setRatingType(self::$_availableTypes[$templateType]);
|
21 |
$this->setProduct($product);
|
22 |
+
|
23 |
+
try {
|
24 |
+
$this->setWidgetAttrs($product, $templateType);
|
25 |
+
} catch (Exception $e) {
|
26 |
+
Lipscore_RatingsReviews_Logger::logException($e);
|
27 |
+
}
|
28 |
|
29 |
return $this->toHtml();
|
30 |
}
|
31 |
+
|
32 |
+
protected function getTemplateType($templateType)
|
33 |
+
{
|
34 |
+
$layoutHandles = $this->getLayout()->getUpdate()->getHandles();
|
35 |
+
$isProductView = in_array('catalog_product_view', $layoutHandles);
|
36 |
+
|
37 |
+
if ($isProductView) {
|
38 |
+
return 'long';
|
39 |
+
}
|
40 |
+
|
41 |
+
if (isset(self::$_availableTypes[$templateType])) {
|
42 |
+
return $templateType;
|
43 |
+
} else {
|
44 |
+
return 'short';
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
protected function setWidgetAttrs($product, $templateType)
|
49 |
+
{
|
50 |
+
$widgetHelper = $this->helper('lipscore_ratingsreviews/widget');
|
51 |
+
$productHelper = $this->helper('lipscore_ratingsreviews/product');
|
52 |
+
|
53 |
+
$productData = $productHelper->getProductData($product);
|
54 |
+
$productAttrs = $widgetHelper->getProductAttrs($productData);
|
55 |
+
$this->setLsProductAttrs($productAttrs);
|
56 |
+
|
57 |
+
if ($templateType == 'long') {
|
58 |
+
$rsProductData = $productHelper->getRichsnippetProductData($product);
|
59 |
+
$rsAttrs = $widgetHelper->getRichsnippetPproductAttrs($rsProductData);
|
60 |
+
$this->setRichsnippetAttrs($rsAttrs);
|
61 |
+
}
|
62 |
+
}
|
63 |
}
|
app/code/community/Lipscore/RatingsReviews/Helper/Price.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Lipscore_RatingsReviews_Helper_Price extends Lipscore_RatingsReviews_Helper_Abstract
|
4 |
+
{
|
5 |
+
public function getProductPrice(Mage_Catalog_Model_Product $product)
|
6 |
+
{
|
7 |
+
$price = 0;
|
8 |
+
try {
|
9 |
+
$price = $this->_getProductPrice($product);
|
10 |
+
} catch (Exception $e) {
|
11 |
+
Lipscore_RatingsReviews_Logger::logException($e);
|
12 |
+
}
|
13 |
+
return $price;
|
14 |
+
}
|
15 |
+
|
16 |
+
protected function _getProductPrice(Mage_Catalog_Model_Product $product)
|
17 |
+
{
|
18 |
+
$price = 0;
|
19 |
+
|
20 |
+
if ($this->isMsrpAppliable($product)) {
|
21 |
+
return $price;
|
22 |
+
}
|
23 |
+
|
24 |
+
if ($this->isBundleProduct($product)) {
|
25 |
+
$price = $this->getBundlePrice($product);
|
26 |
+
} elseif ($product->isGrouped()) {
|
27 |
+
$price = $this->getGroupedPrice($product);
|
28 |
+
} else {
|
29 |
+
$price = $this->getSimplePrice($product);
|
30 |
+
}
|
31 |
+
|
32 |
+
return round($price, 2);
|
33 |
+
}
|
34 |
+
|
35 |
+
protected function isBundleProduct(Mage_Catalog_Model_Product $product)
|
36 |
+
{
|
37 |
+
return $product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE;
|
38 |
+
}
|
39 |
+
|
40 |
+
protected function getBundlePrice(Mage_Catalog_Model_Product $product)
|
41 |
+
{
|
42 |
+
$price = 0;
|
43 |
+
$priceModel = $product->getPriceModel();
|
44 |
+
$taxHelper = $this->taxHelper();
|
45 |
+
|
46 |
+
$options = $product->getTypeInstance(true)->getOptions($product);
|
47 |
+
foreach ($options as $option) {
|
48 |
+
$selectionProduct = $option->getDefaultSelection();
|
49 |
+
if ($selectionProduct) {
|
50 |
+
$qty = $selectionProduct->getSelectionQty();
|
51 |
+
$val = $priceModel->getSelectionPreFinalPrice($product, $selectionProduct, $qty);
|
52 |
+
$price += $taxHelper->getPrice($selectionProduct, $val, true);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
if (!$price) {
|
57 |
+
if (method_exists($priceModel, 'getTotalPrices')) {
|
58 |
+
$price = $priceModel->getTotalPrices($product, 'min', true);
|
59 |
+
} else {
|
60 |
+
// deprecated after 1.5.1.0
|
61 |
+
$price = $priceModel->getPricesDependingOnTax($product, 'min', true);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
return $price;
|
66 |
+
}
|
67 |
+
|
68 |
+
protected function getGroupedPrice(Mage_Catalog_Model_Product $product)
|
69 |
+
{
|
70 |
+
$price = 0;
|
71 |
+
$taxHelper = $this->taxHelper();
|
72 |
+
|
73 |
+
$associated = $product->getTypeInstance(true)->getAssociatedProducts($product);
|
74 |
+
foreach ($associated as $product) {
|
75 |
+
$price += $taxHelper->getPrice($product, $product->getFinalPrice(), true);
|
76 |
+
}
|
77 |
+
|
78 |
+
return $price;
|
79 |
+
}
|
80 |
+
|
81 |
+
protected function getSimplePrice(Mage_Catalog_Model_Product $product)
|
82 |
+
{
|
83 |
+
return $this->taxHelper()->getPrice($product, $product->getFinalPrice(), true);
|
84 |
+
}
|
85 |
+
|
86 |
+
protected function isMsrpAppliable(Mage_Catalog_Model_Product $product)
|
87 |
+
{
|
88 |
+
$catalogHelper = Mage::helper('catalog');
|
89 |
+
if (method_exists($catalogHelper, 'canApplyMsrp')) {
|
90 |
+
return (int) $catalogHelper->canApplyMsrp($product, null, false);
|
91 |
+
}
|
92 |
+
return 0;
|
93 |
+
}
|
94 |
+
|
95 |
+
protected function taxHelper()
|
96 |
+
{
|
97 |
+
if (!isset($this->taxHelper)) {
|
98 |
+
$this->taxHelper = Mage::helper('tax');
|
99 |
+
}
|
100 |
+
return $this->taxHelper;
|
101 |
+
}
|
102 |
+
}
|
app/code/community/Lipscore/RatingsReviews/Helper/Product.php
CHANGED
@@ -12,29 +12,100 @@ class Lipscore_RatingsReviews_Helper_Product extends Lipscore_RatingsReviews_Hel
|
|
12 |
{
|
13 |
$data = array();
|
14 |
try {
|
15 |
-
$data = $this->
|
16 |
} catch (Exception $e) {
|
17 |
Lipscore_RatingsReviews_Logger::logException($e);
|
18 |
}
|
19 |
return $data;
|
20 |
}
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
{
|
24 |
$product or $product = Mage::registry('product');
|
25 |
|
26 |
$brandAttr = $this->_lipscoreConfig->brandAttr();
|
27 |
|
28 |
return array(
|
29 |
-
'name'
|
30 |
-
'brand'
|
31 |
-
'
|
32 |
-
'
|
33 |
-
'url'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
);
|
35 |
}
|
36 |
|
37 |
-
protected function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
{
|
39 |
$attr = $product->getResource()->getAttribute($attrCode);
|
40 |
|
@@ -48,4 +119,12 @@ class Lipscore_RatingsReviews_Helper_Product extends Lipscore_RatingsReviews_Hel
|
|
48 |
return $product->getData($attrCode);
|
49 |
}
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
12 |
{
|
13 |
$data = array();
|
14 |
try {
|
15 |
+
$data = $this->_getProductData($product);
|
16 |
} catch (Exception $e) {
|
17 |
Lipscore_RatingsReviews_Logger::logException($e);
|
18 |
}
|
19 |
return $data;
|
20 |
}
|
21 |
|
22 |
+
public function getRichsnippetProductData(Mage_Catalog_Model_Product $product = null)
|
23 |
+
{
|
24 |
+
$data = array();
|
25 |
+
try {
|
26 |
+
$data = $this->_getRichsnippetProductData($product);
|
27 |
+
} catch (Exception $e) {
|
28 |
+
Lipscore_RatingsReviews_Logger::logException($e);
|
29 |
+
}
|
30 |
+
return $data;
|
31 |
+
}
|
32 |
+
|
33 |
+
protected function _getProductData(Mage_Catalog_Model_Product $product = null)
|
34 |
{
|
35 |
$product or $product = Mage::registry('product');
|
36 |
|
37 |
$brandAttr = $this->_lipscoreConfig->brandAttr();
|
38 |
|
39 |
return array(
|
40 |
+
'name' => $product->getName(),
|
41 |
+
'brand' => $this->getAttributeValue($product, $brandAttr),
|
42 |
+
'sku_values' => array($this->getAttributeValue($product, 'sku')),
|
43 |
+
'internal_id' => "{$product->getId()}",
|
44 |
+
'url' => $product->getProductUrl(),
|
45 |
+
'image_url' => $this->getImageUrl($product),
|
46 |
+
'price' => $this->getPrice($product),
|
47 |
+
'currency' => $this->getCurrency(),
|
48 |
+
'category' => $this->getCategory($product)
|
49 |
+
);
|
50 |
+
}
|
51 |
+
|
52 |
+
public function _getRichsnippetProductData(Mage_Catalog_Model_Product $product = null)
|
53 |
+
{
|
54 |
+
$product or $product = Mage::registry('product');
|
55 |
+
|
56 |
+
return array(
|
57 |
+
'description' => $this->getDescription($product),
|
58 |
+
'availability' => $this->getAvailability($product)
|
59 |
);
|
60 |
}
|
61 |
|
62 |
+
protected function getImageUrl(Mage_Catalog_Model_Product $product)
|
63 |
+
{
|
64 |
+
return (string) Mage::helper('catalog/image')->init($product, 'image');
|
65 |
+
}
|
66 |
+
|
67 |
+
protected function getCategory($product)
|
68 |
+
{
|
69 |
+
$category = Mage::registry('current_category');
|
70 |
+
if (!$category) {
|
71 |
+
$categoryIds = $product->getCategoryIds();
|
72 |
+
if (isset($categoryIds[0])) {
|
73 |
+
$category = Mage::getModel('catalog/category')->load($categoryIds[0]);
|
74 |
+
}
|
75 |
+
}
|
76 |
+
return $category ? $category->getName() : '';
|
77 |
+
}
|
78 |
+
|
79 |
+
protected function getAvailability(Mage_Catalog_Model_Product $product)
|
80 |
+
{
|
81 |
+
$isAvailable = $product->isAvailable();
|
82 |
+
if ($product->isGrouped()) {
|
83 |
+
$associated = $product->getTypeInstance(true)->getAssociatedProducts($product);
|
84 |
+
$isAvailable = $isAvailable && count($associated);
|
85 |
+
}
|
86 |
+
return (int) $isAvailable;
|
87 |
+
}
|
88 |
+
|
89 |
+
protected function getDescription(Mage_Catalog_Model_Product $product)
|
90 |
+
{
|
91 |
+
$description = $product->getShortDescription();
|
92 |
+
if (!$description) {
|
93 |
+
$description = $product->getDescription();
|
94 |
+
}
|
95 |
+
return $description;
|
96 |
+
}
|
97 |
+
|
98 |
+
protected function getPrice($product)
|
99 |
+
{
|
100 |
+
return $this->priceHelper()->getProductPrice($product);
|
101 |
+
}
|
102 |
+
|
103 |
+
protected function getCurrency()
|
104 |
+
{
|
105 |
+
return Mage::app()->getStore()->getCurrentCurrencyCode();
|
106 |
+
}
|
107 |
+
|
108 |
+
protected function getAttributeValue(Mage_Catalog_Model_Product $product, $attrCode)
|
109 |
{
|
110 |
$attr = $product->getResource()->getAttribute($attrCode);
|
111 |
|
119 |
return $product->getData($attrCode);
|
120 |
}
|
121 |
}
|
122 |
+
|
123 |
+
protected function priceHelper()
|
124 |
+
{
|
125 |
+
if (!isset($this->priceHelper)) {
|
126 |
+
$this->priceHelper = Mage::helper('lipscore_ratingsreviews/price');
|
127 |
+
}
|
128 |
+
return $this->priceHelper;
|
129 |
+
}
|
130 |
}
|
app/code/community/Lipscore/RatingsReviews/Helper/Reminder.php
CHANGED
@@ -50,14 +50,7 @@ class Lipscore_RatingsReviews_Helper_Reminder extends Lipscore_RatingsReviews_He
|
|
50 |
|
51 |
protected function _productData($product)
|
52 |
{
|
53 |
-
|
54 |
-
return array(
|
55 |
-
'name' => $data['name'],
|
56 |
-
'brand' => $data['brand'],
|
57 |
-
'sku_values' => array($data['sku']),
|
58 |
-
'internal_id' => $data['internalId'],
|
59 |
-
'url' => $data['url'],
|
60 |
-
);
|
61 |
}
|
62 |
|
63 |
protected function _purchaseData(Mage_Sales_Model_Order $order)
|
50 |
|
51 |
protected function _productData($product)
|
52 |
{
|
53 |
+
return $this->productHelper->getProductData($product);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
55 |
|
56 |
protected function _purchaseData(Mage_Sales_Model_Order $order)
|
app/code/community/Lipscore/RatingsReviews/Helper/Widget.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Lipscore_RatingsReviews_Helper_Widget extends Lipscore_RatingsReviews_Helper_Abstract
|
4 |
+
{
|
5 |
+
public function getProductAttrs($productData)
|
6 |
+
{
|
7 |
+
$attrs = '';
|
8 |
+
try {
|
9 |
+
$attrs = $this->_getProductAttrs($productData);
|
10 |
+
} catch (Exception $e) {
|
11 |
+
Lipscore_RatingsReviews_Logger::logException($e);
|
12 |
+
}
|
13 |
+
return $attrs;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function getRichsnippetPproductAttrs($productData)
|
17 |
+
{
|
18 |
+
$attrs = '';
|
19 |
+
try {
|
20 |
+
$attrs = $this->_getRichsnippetPproductAttrs($productData);
|
21 |
+
} catch (Exception $e) {
|
22 |
+
Lipscore_RatingsReviews_Logger::logException($e);
|
23 |
+
}
|
24 |
+
return $attrs;
|
25 |
+
}
|
26 |
+
|
27 |
+
protected function _getProductAttrs($productData)
|
28 |
+
{
|
29 |
+
$attrs = array(
|
30 |
+
'ls-product-name' => $productData['name'],
|
31 |
+
'ls-brand' => $productData['brand'],
|
32 |
+
'ls-sku' => implode(';', $productData['sku_values']),
|
33 |
+
'ls-product-id' => $productData['internal_id'],
|
34 |
+
'ls-image-url' => $productData['image_url'],
|
35 |
+
'ls-price' => $productData['price'],
|
36 |
+
'ls-price-currency' => $productData['currency'],
|
37 |
+
'ls-category' => $productData['category']
|
38 |
+
);
|
39 |
+
return $this->_toString($attrs);
|
40 |
+
}
|
41 |
+
|
42 |
+
protected function _getRichsnippetPproductAttrs($productData)
|
43 |
+
{
|
44 |
+
$attrs = array(
|
45 |
+
'ls-description' => $productData['description'],
|
46 |
+
'ls-avaialbility' => $productData['availability']
|
47 |
+
);
|
48 |
+
return $this->_toString($attrs);
|
49 |
+
}
|
50 |
+
|
51 |
+
protected function _toString($attrs)
|
52 |
+
{
|
53 |
+
$strAttrs = array();
|
54 |
+
foreach ($attrs as $attr => $value) {
|
55 |
+
$value = htmlspecialchars($value);
|
56 |
+
$strAttrs[] = "$attr=\"$value\"";
|
57 |
+
}
|
58 |
+
return implode($strAttrs, ' ');
|
59 |
+
}
|
60 |
+
}
|
app/design/frontend/base/default/layout/lipscore_ratingsreviews.xml
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
|
8 |
<catalog_product_view>
|
9 |
<reference name="product.info">
|
10 |
-
<block type="
|
11 |
<action method="addToParentGroup"><group>detailed_info</group></action>
|
12 |
<action method="setTitle"><value>lipscore_reviews_placeholder</value></action>
|
13 |
</block>
|
7 |
|
8 |
<catalog_product_view>
|
9 |
<reference name="product.info">
|
10 |
+
<block type="lipscore_ratingsreviews/catalog_product_reviews" name="lipscore.reviews" as="lipscore-reviews" template="lipscore/reviews/view.phtml">
|
11 |
<action method="addToParentGroup"><group>detailed_info</group></action>
|
12 |
<action method="setTitle"><value>lipscore_reviews_placeholder</value></action>
|
13 |
</block>
|
app/design/frontend/base/default/template/lipscore/purchase/view.phtml
CHANGED
@@ -1,17 +1,15 @@
|
|
1 |
<?php $productsData = $this->getProductsData() ?>
|
|
|
2 |
|
3 |
<?php if ($productsData) { ?>
|
4 |
<?php foreach ($productsData as $data) { ?>
|
5 |
<div class="lipscore-purchase"
|
6 |
ls-email="<?php echo $this->getCustomerEmail() ?>"
|
7 |
ls-name="<?php echo $this->getCustomerName() ?>"
|
8 |
-
ls-product-name="<?php echo $data['name'] ?>"
|
9 |
-
ls-brand="<?php echo $data['brand'] ?>"
|
10 |
-
ls-sku="<?php echo $data['sku'] ?>"
|
11 |
-
ls-product-id="<?php echo $data['internalId'] ?>"
|
12 |
ls-product-url="<?php echo $data['url'] ?>"
|
13 |
ls-voucher-code="<?php echo $this->getCouponCode() ?>"
|
14 |
-
ls-voucher-descr="<?php echo $this->getCouponDescription() ?>"
|
|
|
15 |
</div>
|
16 |
<?php } ?>
|
17 |
<?php } ?>
|
1 |
<?php $productsData = $this->getProductsData() ?>
|
2 |
+
<?php $widgetHelper = $this->helper('lipscore_ratingsreviews/widget'); ?>
|
3 |
|
4 |
<?php if ($productsData) { ?>
|
5 |
<?php foreach ($productsData as $data) { ?>
|
6 |
<div class="lipscore-purchase"
|
7 |
ls-email="<?php echo $this->getCustomerEmail() ?>"
|
8 |
ls-name="<?php echo $this->getCustomerName() ?>"
|
|
|
|
|
|
|
|
|
9 |
ls-product-url="<?php echo $data['url'] ?>"
|
10 |
ls-voucher-code="<?php echo $this->getCouponCode() ?>"
|
11 |
+
ls-voucher-descr="<?php echo $this->getCouponDescription() ?>"
|
12 |
+
<?php echo $widgetHelper->getProductAttrs($data)?>>
|
13 |
</div>
|
14 |
<?php } ?>
|
15 |
<?php } ?>
|
app/design/frontend/base/default/template/lipscore/rating/view.phtml
CHANGED
@@ -1,11 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
<?php if ($_data) { ?>
|
3 |
<div class="ratings mg-lipscore-rating-wrapper">
|
4 |
-
<div <?php echo $this->getRatingType() ?>
|
5 |
-
|
6 |
-
|
7 |
-
ls-sku="<?php echo $_data['sku'] ?>"
|
8 |
-
ls-product-id="<?php echo $_data['internalId'] ?>">
|
9 |
</div>
|
10 |
</div>
|
11 |
<?php } else { ?>
|
1 |
+
<?php if ($this->getLsProductAttrs()) { ?>
|
|
|
2 |
<div class="ratings mg-lipscore-rating-wrapper">
|
3 |
+
<div <?php echo $this->getRatingType() ?>
|
4 |
+
<?php echo $this->getLsProductAttrs() ?>
|
5 |
+
<?php echo $this->getRichsnippetAttrs() ?>>
|
|
|
|
|
6 |
</div>
|
7 |
</div>
|
8 |
<?php } else { ?>
|
app/design/frontend/base/default/template/lipscore/reviews/view.phtml
CHANGED
@@ -1,18 +1,7 @@
|
|
1 |
<div style="display: none !important;">Reviews</div>
|
2 |
-
<?php
|
3 |
-
<?php
|
4 |
-
<div id="lipscore-review-
|
5 |
-
ls-product-name="<?php echo $_data['name'] ?>"
|
6 |
-
ls-brand="<?php echo $_data['brand'] ?>"
|
7 |
-
ls-sku="<?php echo $_data['sku'] ?>"
|
8 |
-
ls-product-id="<?php echo $_data['internalId'] ?>">
|
9 |
-
</div>
|
10 |
-
<div id="lipscore-review-list"
|
11 |
-
ls-product-name="<?php echo $_data['name'] ?>"
|
12 |
-
ls-brand="<?php echo $_data['brand'] ?>"
|
13 |
-
ls-sku="<?php echo $_data['sku'] ?>"
|
14 |
-
ls-product-id="<?php echo $_data['internalId'] ?>">
|
15 |
-
</div>
|
16 |
<?php } else { ?>
|
17 |
<div style="display: none !important;">Lipscore: empty product data</div>
|
18 |
<?php } ?>
|
1 |
<div style="display: none !important;">Reviews</div>
|
2 |
+
<?php if ($this->getLsProductAttrs()) { ?>
|
3 |
+
<div id="lipscore-review-post" <?php echo $this->getLsProductAttrs() ?>></div>
|
4 |
+
<div id="lipscore-review-list" <?php echo $this->getLsProductAttrs() ?>></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
<?php } else { ?>
|
6 |
<div style="display: none !important;">Lipscore: empty product data</div>
|
7 |
<?php } ?>
|
app/design/frontend/base/default/template/lipscore/reviews/view_single.phtml
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
<div class="lipscore-reviews-single">
|
2 |
<h2><?php echo $this->getLayout()->createBlock('lipscore_ratingsreviews/review_tabtitle')->toHtml() ?></h2>
|
3 |
-
<?php echo $this->getLayout()->createBlock('
|
4 |
</div>
|
1 |
<div class="lipscore-reviews-single">
|
2 |
<h2><?php echo $this->getLayout()->createBlock('lipscore_ratingsreviews/review_tabtitle')->toHtml() ?></h2>
|
3 |
+
<?php echo $this->getLayout()->createBlock('lipscore_ratingsreviews/catalog_product_reviews', '', array('template' => 'lipscore/reviews/view.phtml'))->toHtml() ?>
|
4 |
</div>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>lipscore</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://lipscore.com/signup">Terms of use</license>
|
7 |
<channel>community</channel>
|
@@ -11,13 +11,13 @@
|
|
11 |
Lipscore has a range of great features that will
|
12 |
take all the hassle out of collecting product reviews, and help convert more
|
13 |
visitors in to profitable customers.</description>
|
14 |
-
<notes>
|
15 |
-
|
16 |
</notes>
|
17 |
<authors><author><name>Henning Frettem</name><user>Lipscore</user><email>henning@lipscore.com</email></author><author><name>Olga Ivanova</name><user>oivanova</user><email>o.ivanova@datacrafts.io</email></author></authors>
|
18 |
-
<date>2015-07-
|
19 |
-
<time>
|
20 |
-
<contents><target name="magecommunity"><dir name="Lipscore"><dir name="RatingsReviews"><dir name="Block"><dir name="Catalog"><dir name="Product"><file name="View.php" hash="c88cf05f967d7bdebe16ad4c8cb1864f"/></dir></dir><file name="Init.php" hash="54aa73f8964025643d200ef83d79a21f"/><dir name="Purchase"><file name="Abstract.php" hash="aaaabff2ee4366393c66b3a4469f8957"/><file name="Multishipping.php" hash="5b32395d9054b0a242a59e4f9f38988e"/><file name="Onepage.php" hash="ff7faab280d62e4bb906ebdd45521d65"/></dir><dir name="Review"><file name="Helper.php" hash="
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
23 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>lipscore</name>
|
4 |
+
<version>1.2.23</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://lipscore.com/signup">Terms of use</license>
|
7 |
<channel>community</channel>
|
11 |
Lipscore has a range of great features that will
|
12 |
take all the hassle out of collecting product reviews, and help convert more
|
13 |
visitors in to profitable customers.</description>
|
14 |
+
<notes>Lipscore main rating widget is shown on a product page in any case.
|
15 |
+
Product's extra information has been added to Lipscore widgets.
|
16 |
</notes>
|
17 |
<authors><author><name>Henning Frettem</name><user>Lipscore</user><email>henning@lipscore.com</email></author><author><name>Olga Ivanova</name><user>oivanova</user><email>o.ivanova@datacrafts.io</email></author></authors>
|
18 |
+
<date>2015-07-21</date>
|
19 |
+
<time>16:03:16</time>
|
20 |
+
<contents><target name="magecommunity"><dir name="Lipscore"><dir name="RatingsReviews"><dir name="Block"><dir name="Catalog"><dir name="Product"><file name="Reviews.php" hash="9d0e36ef48ac515da4fad5dd97df74cd"/><file name="View.php" hash="c88cf05f967d7bdebe16ad4c8cb1864f"/></dir></dir><file name="Init.php" hash="54aa73f8964025643d200ef83d79a21f"/><dir name="Purchase"><file name="Abstract.php" hash="aaaabff2ee4366393c66b3a4469f8957"/><file name="Multishipping.php" hash="5b32395d9054b0a242a59e4f9f38988e"/><file name="Onepage.php" hash="ff7faab280d62e4bb906ebdd45521d65"/></dir><dir name="Review"><file name="Helper.php" hash="50a4fd5d83fd455d32172fab053d8a2d"/><file name="Single.php" hash="5e4427a024a983838670b580c7fbb05e"/><file name="Tabtitle.php" hash="28cdbcff696c2dc718f7cdbc8413c55d"/></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Coupons.php" hash="359eeb7d3913a2b52e7a704afd978464"/><dir name="Field"><file name="Abstract.php" hash="0e8b5385e58dfe4f1f92ddf6063b6376"/><file name="Apikey.php" hash="4012af99141381375a0a4d294bc60f88"/><file name="Reminderperiod.php" hash="5f094e164d7dd7f6c624feb3b3bfd5e6"/></dir><dir name="Fieldset"><file name="Coupons.php" hash="08b73ed814a47b46c05cf14889bb4ead"/><file name="Dashboardlink.php" hash="910a177378d3a5815b56349b2ddcc9bf"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Abstract.php" hash="65d8d9da169b1b1c4477d7d83c985c84"/><file name="Config.php" hash="10a7f292094fa16515975769bf675d13"/><file name="Coupon.php" hash="748ea1f72a63f22efdd9bffc4db27ce3"/><file name="Data.php" hash="6ae3c816d5d899f6f8050c213860ecf0"/><file name="Locale.php" hash="29665a64635bcde29a8cc841a0100add"/><file name="Module.php" hash="ab2f87306a2a1456eb9835adecdd19d3"/><file name="Price.php" hash="d0fbe38be18842bdc19eb2c3592de15c"/><file name="Product.php" hash="f9ce2f5e65021bacadb70308500e098a"/><file name="Purchase.php" hash="9024bc8da7ed7432ea36902e2aecc14d"/><file name="Reminder.php" hash="f9af0ed55ee5a1d72911d1328331f8fd"/><file name="Widget.php" hash="2d2366d00f10c9a130d83581f887695c"/></dir><file name="Logger.php" hash="b9d3b2df0bb8c2a8191763202ad272f8"/><dir name="Model"><dir name="Api"><file name="Request.php" hash="43f5f3dbd1263c51c994d4373f9e243c"/></dir><dir name="Config"><file name="Env.php" hash="06610d75a570d1f6dbb75969ca11be82"/></dir><file name="Config.php" hash="9596f8e2305edfc346754dae7a5c8bdd"/><dir name="Coupon"><file name="Generator.php" hash="d3164b63b6535e712888ce0c25900e12"/></dir><file name="Observer.php" hash="6ea873c379e3804b79323114106eda03"/><dir name="Purchase"><file name="Reminder.php" hash="8f3bbd220f479660ef4b27f418b21488"/></dir><file name="Shop.php" hash="6495d5d2f6d1ef5203c33726ab860957"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Apikey.php" hash="9e454095ab56736cf96b4379bb6eea10"/></dir><dir name="Source"><file name="Locale.php" hash="8d9f9fb8207d2721a2e3d97ce7a4fbec"/><dir name="Order"><file name="Status.php" hash="1a5107f688509b981dcdb40c44784f6b"/></dir><file name="Pricerule.php" hash="b100a5b624e5188691fa3f7c0dbed275"/><dir name="Productattr"><file name="Brand.php" hash="0bcb5b3ce8f0fefca0d52108e3b9807c"/></dir><file name="Reminderperiod.php" hash="674ad0760ba520655f1f4cabb4340b55"/></dir></dir></dir><dir name="Tracker"><file name="Action.php" hash="451371812bc5eae57fb26afa16bf3388"/><file name="Installation.php" hash="7965dbb24c8b5dd0b6f03e0da67e5adc"/></dir></dir><dir name="controllers"><dir name="Purchases"><file name="RemindersController.php" hash="1ec905ce1e9d29a7768f2bfe26f691fd"/></dir></dir><dir name="data"><dir name="lipscore_ratingsreviews_setup"><file name="data-install-1.2.21.0.php" hash="ad67c2ab5cb793f70207af6385e8d941"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="5edee417a954579c97186a8ebfdf3fbc"/><file name="config.xml" hash="bbfa56085e97d71332246271a1464ace"/><dir name="environments"><file name="production.xml" hash="bb3749dea14df3f07007dc9c24658eff"/></dir><file name="system.xml" hash="1f8633630f2debd893ddd5443d2f6233"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="lipscore"><file name="init.phtml" hash="45db33eec713376d9243f1d690e43e59"/><dir name="purchase"><file name="view.phtml" hash="d2696e1f07c2af1281d5f39e6b2f39f8"/></dir><dir name="rating"><file name="view.phtml" hash="476099a146e94100cbcfc36d04ac08ad"/></dir><dir name="reviews"><file name="tab_title.phtml" hash="cee27e2ae8b71c9705097584e9c0c3cc"/><file name="view.phtml" hash="a32cb7f7879fee174bcc7fc44ee5f5e3"/><file name="view_single.phtml" hash="6fa4aaa62effaf9787e212635991ccec"/></dir></dir></dir><dir name="layout"><file name="lipscore_ratingsreviews.xml" hash="8a43ee47821cf9844cd15806a362fdf9"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="lipscore_ratingsreviews.xml" hash="73e5f3cd2b25005bb0456f28c4a40c51"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Lipscore_RatingsReviews.xml" hash="a5bea23f8ccc23ae46ee206b4b827939"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="lipscore.css" hash="a3ad20761826da37979651687880c93f"/></dir><dir name="js"><file name="lipscore.js" hash="2dd5abd312663be5950382b6bad08a80"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><file name="lipscore.css" hash="96f1694b0769b92e32142209f389e069"/><dir name="js"><file name="lipscore.js" hash="ac705dc56c03c08adadbbac86f1f10c3"/></dir></dir></dir></dir></target></contents>
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
23 |
</package>
|