-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from YotpoLtd/YES_30_Support_Star_Rating_on_ca…
…tegory_page_out_of_the_box_magento1 Yes 30 support star rating on category page out of the box magento1
- Loading branch information
Showing
6 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
app/code/community/Yotpo/Yotpo/Block/Catalog/Product/List.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
class Yotpo_Yotpo_Block_Catalog_Product_List extends Mage_Catalog_Block_Product_List { | ||
|
||
const CATEGORY_BOTTOMLINE = 'yotpo/yotpo_general_group/enable_bottomline_category_page'; | ||
protected function _getProductCollection() { | ||
$_productCollection = parent::_getProductCollection(); | ||
$enableBottomlineCategoryPage = Mage::getStoreConfig(self::CATEGORY_BOTTOMLINE); | ||
if ($enableBottomlineCategoryPage) { | ||
|
||
foreach ($_productCollection as $_product) { | ||
$_product->setRatingSummary(true); | ||
} | ||
} | ||
return $_productCollection; | ||
} | ||
|
||
public function getReviewsSummaryHtml(Mage_Catalog_Model_Product $product, $templateType = false, $displayIfNoReviews = false) { | ||
|
||
$enableBottomlineCategoryPage = Mage::getStoreConfig(self::CATEGORY_BOTTOMLINE); | ||
if ($enableBottomlineCategoryPage) { | ||
return $this->helper('yotpo')->showBottomline($this, $product); | ||
} else { | ||
return parent::getReviewsSummaryHtml($product, $templateType, $displayIfNoReviews); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.products-grid .item .standalone-bottomline{ | ||
display: flex; | ||
justify-content: center; | ||
padding:10px 0; | ||
} |