AndrejSinicyn_CatalogTuner - Version 1.0.0

Version Notes

Catalog tuning

Download this release

Release Info

Developer Andrej Sinicyn
Extension AndrejSinicyn_CatalogTuner
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/AndrejSinicyn/CatalogTuner/Helper/Data.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * @category AndrejSinicyn
12
+ * @package AndrejSinicyn_CatalogTuner
13
+ * @copyright Copyright (c) 2014 Andrej Sinicyn
14
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
+ */
16
+ class AndrejSinicyn_CatalogTuner_Helper_Data extends Mage_Core_Helper_Abstract
17
+ {
18
+ }
app/code/community/AndrejSinicyn/CatalogTuner/Model/Observer.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * @category AndrejSinicyn
12
+ * @package AndrejSinicyn_CatalogTuner
13
+ * @copyright Copyright (c) 2014 Andrej Sinicyn
14
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
+ */
16
+ class AndrejSinicyn_CatalogTuner_Model_Observer
17
+ {
18
+ const XML_PATH_ADD_BREADCRUMBS = 'catalog/tuning/add_catalog_breadcrumbs_to_product';
19
+
20
+ public function onCatalogControllerProductInit(Varien_Event_Observer $observer)
21
+ {
22
+ if (Mage::getStoreConfig(self::XML_PATH_ADD_BREADCRUMBS) && !Mage::registry('current_category') && ($product = Mage::registry('current_product'))) {
23
+ $productCategories = $product->getCategoryIds();
24
+ if (count($productCategories) > 0) {
25
+ // Assigning the first product category as current category if no category was set previously.
26
+ $category = Mage::getModel('catalog/category')->load($productCategories[0]);
27
+ $product->setCategory($category);
28
+ Mage::register('current_category', $category);
29
+ }
30
+ }
31
+ }
32
+ }
app/code/community/AndrejSinicyn/CatalogTuner/etc/config.xml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <AndrejSinicyn_CatalogTuner>
5
+ <version>1.0.0</version>
6
+ </AndrejSinicyn_CatalogTuner>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <catalogtuner>
11
+ <class>AndrejSinicyn_CatalogTuner_Helper</class>
12
+ </catalogtuner>
13
+ </helpers>
14
+ <models>
15
+ <catalogtuner>
16
+ <class>AndrejSinicyn_CatalogTuner_Model</class>
17
+ <resourceModel>catalogtuner_mysql4</resourceModel>
18
+ </catalogtuner>
19
+ </models>
20
+ <events>
21
+ <catalog_controller_product_init>
22
+ <observers>
23
+ <catalog_controller_product_init_handler>
24
+ <type>model</type>
25
+ <class>catalogtuner/observer</class>
26
+ <method>onCatalogControllerProductInit</method>
27
+ </catalog_controller_product_init_handler>
28
+ </observers>
29
+ </catalog_controller_product_init>
30
+ </events>
31
+ </global>
32
+ <adminhtml>
33
+ <translate>
34
+ <modules>
35
+ <AndrejSinicyn_CatalogTuner>
36
+ <files>
37
+ <default>AndrejSinicyn_CatalogTuner.csv</default>
38
+ </files>
39
+ </AndrejSinicyn_CatalogTuner>
40
+ </modules>
41
+ </translate>
42
+ </adminhtml>
43
+ <default>
44
+ <catalog>
45
+ <tuning>
46
+ <add_catalog_breadcrumbs_to_product>0</add_catalog_breadcrumbs_to_product>
47
+ </tuning>
48
+ </catalog>
49
+ </default>
50
+ </config>
app/code/community/AndrejSinicyn/CatalogTuner/etc/system.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <catalog module="catalogtuner">
5
+ <groups>
6
+ <tuning translate="label">
7
+ <label>Tuning</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>990</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <add_catalog_breadcrumbs_to_product translate="label comment">
15
+ <label>Force adding catalog breadcrumbs to product</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>0</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ <comment>Tries to add catalog breadcrumbs to product, if it is called directly without category.</comment>
23
+ </add_catalog_breadcrumbs_to_product>
24
+ </fields>
25
+ </tuning>
26
+ </groups>
27
+ </catalog>
28
+ </sections>
29
+ </config>
app/etc/modules/AndrejSinicyn_CatalogTuner.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <AndrejSinicyn_CatalogTuner>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>1.0.0</version>
8
+ </AndrejSinicyn_CatalogTuner>
9
+ </modules>
10
+ </config>
app/locale/de_DE/AndrejSinicyn_CatalogTuner.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Force adding catalog breadcrumbs to product","Erzwingen des Hinzufügens der Katalog-Breadcrumbs zum Produkt"
2
+ "Tries to add catalog breadcrumbs to product, if it is called directly without category.","Versucht, Katalog-Breadcrumbs zum Produkt hinzuzufügen, falls dieses direkt ohne Kategorie aufgerufen wird."
3
+ "Tuning","Tuning"
app/locale/en_EN/AndrejSinicyn_CatalogTuner.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Force adding catalog breadcrumbs to product","Force adding catalog breadcrumbs to product"
2
+ "Tries to add catalog breadcrumbs to product, if it is called directly without category.","Tries to add catalog breadcrumbs to product, if it is called directly without category."
3
+ "Tuning","Tuning"
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>AndrejSinicyn_CatalogTuner</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Catalog tuning</summary>
10
+ <description>Catalog tuning</description>
11
+ <notes>Catalog tuning</notes>
12
+ <authors><author><name>Andrej Sinicyn</name><user>rarog</user><email>rarogit@gmail.com</email></author></authors>
13
+ <date>2014-05-07</date>
14
+ <time>06:57:52</time>
15
+ <contents><target name="magecommunity"><dir name="AndrejSinicyn"><dir name="CatalogTuner"><dir name="Helper"><file name="Data.php" hash="fb1b3446229b084faa896a737869f4c4"/></dir><dir name="Model"><file name="Observer.php" hash="bb198ab72894857d02e188f4f93873ee"/></dir><dir name="etc"><file name="config.xml" hash="4f9a7d3b14e3f0366813190e9b948425"/><file name="system.xml" hash="fb471ef01829aafb65d49d1aa9f36e63"/></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="AndrejSinicyn_CatalogTuner.csv" hash="e486532c4c6b767b22a66c09bf6c512d"/></dir><dir name="en_EN"><file name="AndrejSinicyn_CatalogTuner.csv" hash="cf62e7aac0cb93669b0a2769dc6aa90d"/></dir></target><target name="mageetc"><dir name="modules"><file name="AndrejSinicyn_CatalogTuner.xml" hash="a3d9f57c3aafabe3cc31f9df2069b7d2"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>