Skip to content

Commit 5c33c5a

Browse files
author
damu
committed
added option to enable/disable using data from tindexer table
1 parent 1efc2b2 commit 5c33c5a

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

app/code/community/Technooze/Tindexer/Model/Products.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ public function initFilteredProductsCount($filter = 'brand', $optionId = 0, $id
172172

173173
// if we find data from db and it's not an update
174174
// then no further processing is required
175-
if(!empty($products) && !$id){
175+
$isEnabled = Mage::getStoreConfig('tgeneral/general/tindexer');
176+
Mage::log('enabled - ' . $isEnabled);
177+
if(!empty($products) && !$id && $isEnabled ){
176178
$optionId = $products[0]['attr_id'];
177179
$data = unserialize($products[0]['count']);
178180
$this->_filteredProducts = $data;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Technooze_Tindexer extension
5+
*
6+
* NOTICE OF LICENSE
7+
*
8+
* This source file is subject to the Open Software License (OSL 3.0)
9+
* that is bundled with this package in the file LICENSE.txt.
10+
* It is also available through the world-wide-web at this URL:
11+
* http://opensource.org/licenses/osl-3.0.php
12+
*
13+
* @category Technooze
14+
* @package Technooze_Tindexer
15+
* @copyright Copyright (c) 2008 Technooze LLC
16+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17+
*/
18+
19+
/**
20+
* @category Technooze
21+
* @package Technooze_Tindexer
22+
* @author Technooze <info@technooze.com>
23+
*/
24+
-->
25+
<config>
26+
<sections>
27+
<tgeneral>
28+
<groups>
29+
<general>
30+
<fields>
31+
<tindexer translate="label">
32+
<label>Enable Tindexer</label>
33+
<frontend_type>select</frontend_type>
34+
<source_model>adminhtml/system_config_source_yesno</source_model>
35+
<sort_order>10</sort_order>
36+
<show_in_default>1</show_in_default>
37+
<show_in_website>1</show_in_website>
38+
<show_in_store>1</show_in_store>
39+
</tindexer>
40+
<tcdn translate="label">
41+
<label>use sub-domain CDN</label>
42+
<frontend_type>select</frontend_type>
43+
<source_model>adminhtml/system_config_source_yesno</source_model>
44+
<sort_order>20</sort_order>
45+
<show_in_default>1</show_in_default>
46+
<show_in_website>1</show_in_website>
47+
<show_in_store>1</show_in_store>
48+
</tcdn>
49+
</fields>
50+
</general>
51+
</groups>
52+
</tgeneral>
53+
</sections>
54+
</config>

0 commit comments

Comments
 (0)