This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FACTFINDER-174] Prevent writing queries to the db when FF is enabled
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/app/code/community/FACTFinder/Core/Block/CatalogSearch/Layer.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,31 @@ | ||
<?php | ||
/** | ||
* View.php | ||
* | ||
* @category Mage | ||
* @package FACTFinder_Core | ||
* @author Flagbit Magento Team <[email protected]> | ||
* @copyright Copyright (c) 2016 Flagbit GmbH & Co. KG | ||
* @license GPL | ||
* @link http://www.flagbit.de | ||
*/ | ||
class FACTFinder_Core_Block_CatalogSearch_Layer extends Mage_CatalogSearch_Block_Layer | ||
{ | ||
|
||
|
||
/** | ||
* Rewrite the block to prevent using default layer model | ||
* | ||
* @return FACTFinder_Core_Model_CatalogSearch_Layer|Mage_Catalog_Model_Layer | ||
*/ | ||
public function getLayer() | ||
{ | ||
if (Mage::helper('factfinder')->isEnabled()) { | ||
return Mage::getSingleton('factfinder/catalogSearch_layer'); | ||
} | ||
|
||
return parent::getLayer(); | ||
} | ||
|
||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/app/code/community/FACTFinder/Core/Model/CatalogSearch/Query.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,34 @@ | ||
<?php | ||
/** | ||
* Query.php | ||
* | ||
* @category Mage | ||
* @package FACTFinder_Core | ||
* @author Flagbit Magento Team <[email protected]> | ||
* @copyright Copyright (c) 2016 Flagbit GmbH & Co. KG | ||
* @license GPL | ||
* @link http://www.flagbit.de | ||
*/ | ||
|
||
class FACTFinder_Core_Model_CatalogSearch_Query extends Mage_CatalogSearch_Model_Query | ||
{ | ||
|
||
|
||
/** | ||
* Rewrite the model to prevent savin data to the db if FF is enabled | ||
* | ||
* @return $this|\Mage_Core_Model_Abstract | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function save() | ||
{ | ||
if (Mage::helper('factfinder')->isEnabled()) { | ||
return $this; | ||
} | ||
|
||
return parent::save(); | ||
} | ||
|
||
|
||
} |
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