Version Notes
Fixed issue when store has Catalog Category Flat Data enabled and bottom description is not shown.
Download this release
Release Info
| Developer | Vasilii |
| Extension | VasiliiB_CategoryBottomDescription |
| Version | 0.0.2 |
| Comparing to | |
| See all releases | |
Code changes from version 0.0.1 to 0.0.2
- app/code/local/VasiliiB/CategoryBottomDescription/Model/Observer.php +49 -0
- app/code/local/VasiliiB/CategoryBottomDescription/etc/config.xml +19 -7
- app/code/local/VasiliiB/CategoryBottomDescription/sql/categorybottomdescription_setup/mysql4-install-0.0.1.php +31 -1
- app/design/frontend/base/default/layout/CategoryBottomDesc.xml +9 -7
- app/design/frontend/base/default/template/catalog/category/bottom-desc.phtml +34 -5
- package.xml +10 -10
app/code/local/VasiliiB/CategoryBottomDescription/Model/Observer.php
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* @author Burlacu Vasilii Alexei
|
| 5 |
+
* @e-mail burlacu.vasilii@yandex.ru
|
| 6 |
+
* @skype_id regulatu_
|
| 7 |
+
* @github https://github.com/vasilii-b
|
| 8 |
+
*
|
| 9 |
+
* @copyright Copyright (c) 2016 Burlacu Vasilii Alexei
|
| 10 |
+
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache Licence 2.0
|
| 11 |
+
*
|
| 12 |
+
*
|
| 13 |
+
* Copyright 2016 Burlacu Vasilii Alexei
|
| 14 |
+
*
|
| 15 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 16 |
+
* you may not use this file except in compliance with the License.
|
| 17 |
+
* You may obtain a copy of the License at
|
| 18 |
+
*
|
| 19 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 20 |
+
*
|
| 21 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 22 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 23 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 24 |
+
* See the License for the specific language governing permissions and
|
| 25 |
+
* limitations under the License.
|
| 26 |
+
*
|
| 27 |
+
*
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
class VasiliiB_CategoryBottomDescription_Model_Observer
|
| 31 |
+
{
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Reindex Catalog Category Data
|
| 35 |
+
*/
|
| 36 |
+
public function reindexFlatCategory(Varien_Event_Observer $observer)
|
| 37 |
+
{
|
| 38 |
+
$reindexer = Mage::getModel('index/indexer')->getProcessByCode('catalog_category_flat');
|
| 39 |
+
|
| 40 |
+
if(
|
| 41 |
+
Mage::getStoreConfig('catalog/frontend/flat_catalog_category')
|
| 42 |
+
&&
|
| 43 |
+
$reindexer->getStatus() == Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX
|
| 44 |
+
)
|
| 45 |
+
{
|
| 46 |
+
$reindexer->reindexAll();
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
}
|
app/code/local/VasiliiB/CategoryBottomDescription/etc/config.xml
CHANGED
|
@@ -2,18 +2,29 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<VasiliiB_CategoryBottomDescription>
|
| 5 |
-
<version>0.0.
|
| 6 |
</VasiliiB_CategoryBottomDescription>
|
| 7 |
</modules>
|
| 8 |
|
| 9 |
<frontend>
|
| 10 |
<layout>
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
</frontend>
|
| 18 |
|
| 19 |
<global>
|
|
@@ -29,4 +40,5 @@
|
|
| 29 |
</categorybottomdescription_setup>
|
| 30 |
</resources>
|
| 31 |
</global>
|
|
|
|
| 32 |
</config>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<VasiliiB_CategoryBottomDescription>
|
| 5 |
+
<version>0.0.2</version>
|
| 6 |
</VasiliiB_CategoryBottomDescription>
|
| 7 |
</modules>
|
| 8 |
|
| 9 |
<frontend>
|
| 10 |
<layout>
|
| 11 |
+
<updates>
|
| 12 |
+
<vasiliib_categorybottomdescription>
|
| 13 |
+
<file>CategoryBottomDesc.xml</file>
|
| 14 |
+
</vasiliib_categorybottomdescription>
|
| 15 |
+
</updates>
|
| 16 |
+
</layout>
|
| 17 |
+
|
| 18 |
+
<events>
|
| 19 |
+
<catalog_category_load_before>
|
| 20 |
+
<observers>
|
| 21 |
+
<vasiliib_reindexflatcategory>
|
| 22 |
+
<class>VasiliiB_CategoryBottomDescription_Model_Observer</class>
|
| 23 |
+
<method>reindexFlatCategory</method>
|
| 24 |
+
</vasiliib_reindexflatcategory>
|
| 25 |
+
</observers>
|
| 26 |
+
</catalog_category_load_before>
|
| 27 |
+
</events>
|
| 28 |
</frontend>
|
| 29 |
|
| 30 |
<global>
|
| 40 |
</categorybottomdescription_setup>
|
| 41 |
</resources>
|
| 42 |
</global>
|
| 43 |
+
|
| 44 |
</config>
|
app/code/local/VasiliiB/CategoryBottomDescription/sql/categorybottomdescription_setup/mysql4-install-0.0.1.php
CHANGED
|
@@ -1,6 +1,35 @@
|
|
| 1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
$installer = $this;
|
| 3 |
$installer->startSetup();
|
|
|
|
| 4 |
$attribute = array(
|
| 5 |
'type' => 'text',
|
| 6 |
'label'=> 'Bottom Description',
|
|
@@ -15,6 +44,7 @@ $attribute = array(
|
|
| 15 |
'default' => "",
|
| 16 |
'group' => "General Information"
|
| 17 |
);
|
|
|
|
| 18 |
$installer->addAttribute('catalog_category', 'bottom_description', $attribute);
|
| 19 |
$installer->endSetup();
|
| 20 |
-
|
| 1 |
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* @author Burlacu Vasilii Alexei
|
| 5 |
+
* @e-mail burlacu.vasilii@yandex.ru
|
| 6 |
+
* @skype_id regulatu_
|
| 7 |
+
* @github https://github.com/vasilii-b
|
| 8 |
+
*
|
| 9 |
+
* @copyright Copyright (c) 2016 Burlacu Vasilii Alexei
|
| 10 |
+
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache Licence 2.0
|
| 11 |
+
*
|
| 12 |
+
*
|
| 13 |
+
* Copyright 2016 Burlacu Vasilii Alexei
|
| 14 |
+
*
|
| 15 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 16 |
+
* you may not use this file except in compliance with the License.
|
| 17 |
+
* You may obtain a copy of the License at
|
| 18 |
+
*
|
| 19 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 20 |
+
*
|
| 21 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 22 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 23 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 24 |
+
* See the License for the specific language governing permissions and
|
| 25 |
+
* limitations under the License.
|
| 26 |
+
*
|
| 27 |
+
*
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
$installer = $this;
|
| 31 |
$installer->startSetup();
|
| 32 |
+
|
| 33 |
$attribute = array(
|
| 34 |
'type' => 'text',
|
| 35 |
'label'=> 'Bottom Description',
|
| 44 |
'default' => "",
|
| 45 |
'group' => "General Information"
|
| 46 |
);
|
| 47 |
+
|
| 48 |
$installer->addAttribute('catalog_category', 'bottom_description', $attribute);
|
| 49 |
$installer->endSetup();
|
| 50 |
+
|
app/design/frontend/base/default/layout/CategoryBottomDesc.xml
CHANGED
|
@@ -1,14 +1,16 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
-
<layout
|
| 3 |
-
<
|
| 4 |
<reference name="content">
|
| 5 |
-
<block name="
|
| 6 |
</reference>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
</catalog_category_default>
|
| 8 |
|
| 9 |
<catalog_category_layered>
|
| 10 |
-
<
|
| 11 |
-
<block name="category_bottom_desc" type="catalog/category_view" after="category.products" template="catalog/category/bottom-desc.phtml" />
|
| 12 |
-
</reference>
|
| 13 |
</catalog_category_layered>
|
| 14 |
-
</layout>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
+
<layout>
|
| 3 |
+
<catalog_category_bottom_description>
|
| 4 |
<reference name="content">
|
| 5 |
+
<block name="category_bottom_description" type="catalog/category_view" after="-" template="catalog/category/bottom-desc.phtml" />
|
| 6 |
</reference>
|
| 7 |
+
</catalog_category_bottom_description>
|
| 8 |
+
|
| 9 |
+
<catalog_category_default>
|
| 10 |
+
<update handle="catalog_category_bottom_description" />
|
| 11 |
</catalog_category_default>
|
| 12 |
|
| 13 |
<catalog_category_layered>
|
| 14 |
+
<update handle="catalog_category_bottom_description" />
|
|
|
|
|
|
|
| 15 |
</catalog_category_layered>
|
| 16 |
+
</layout>
|
app/design/frontend/base/default/template/catalog/category/bottom-desc.phtml
CHANGED
|
@@ -1,8 +1,37 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
?>
|
| 5 |
-
<div class="
|
| 6 |
-
<?php echo Mage::helper('cms')->getPageTemplateProcessor()->filter($
|
| 7 |
</div>
|
| 8 |
-
<?php endif; ?>
|
| 1 |
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* @author Burlacu Vasilii Alexei
|
| 5 |
+
* @e-mail burlacu.vasilii@yandex.ru
|
| 6 |
+
* @skype_id regulatu_
|
| 7 |
+
* @github https://github.com/vasilii-b
|
| 8 |
+
*
|
| 9 |
+
* @copyright Copyright (c) 2016 Burlacu Vasilii Alexei
|
| 10 |
+
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache Licence 2.0
|
| 11 |
+
*
|
| 12 |
+
*
|
| 13 |
+
* Copyright 2016 Burlacu Vasilii Alexei
|
| 14 |
+
*
|
| 15 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 16 |
+
* you may not use this file except in compliance with the License.
|
| 17 |
+
* You may obtain a copy of the License at
|
| 18 |
+
*
|
| 19 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 20 |
+
*
|
| 21 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 22 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 23 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 24 |
+
* See the License for the specific language governing permissions and
|
| 25 |
+
* limitations under the License.
|
| 26 |
+
*
|
| 27 |
+
*
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
$_category = $this->getCurrentCategory();
|
| 31 |
+
$_categoryBottomDescription = $_category->getBottomDescription();
|
| 32 |
+
if( $_categoryBottomDescription ):
|
| 33 |
?>
|
| 34 |
+
<div class="category-description description category-bottom-description">
|
| 35 |
+
<?php echo Mage::helper('cms')->getPageTemplateProcessor()->filter($_categoryBottomDescription); ?>
|
| 36 |
</div>
|
| 37 |
+
<?php endif; ?>
|
package.xml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>VasiliiB_CategoryBottomDescription</name>
|
| 4 |
-
<version>0.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
-
<license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
-
<summary>
|
| 10 |
-
<description>
|
| 11 |
-
<notes>
|
| 12 |
-
<authors><author><name>Vasilii</name><user>vasiliib</user><email>burlacu.vasilii@
|
| 13 |
-
<date>2016-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="
|
| 16 |
<compatible/>
|
| 17 |
-
<dependencies><required><php><min>5.
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>VasiliiB_CategoryBottomDescription</name>
|
| 4 |
+
<version>0.0.2</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
+
<license uri="https://www.apache.org/licenses/LICENSE-2.0">APL 2.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
+
<summary>Add bottom description to category</summary>
|
| 10 |
+
<description>Add bottom description to category</description>
|
| 11 |
+
<notes>Fixed issue when store has Catalog Category Flat Data enabled and bottom description is not shown.</notes>
|
| 12 |
+
<authors><author><name>Burlacu Vasilii Alexei</name><user>vasiliib</user><email>burlacu.vasilii@yandex.ru</email></author></authors>
|
| 13 |
+
<date>2016-11-01</date>
|
| 14 |
+
<time>19:46:44</time>
|
| 15 |
+
<contents><target name="magelocal"><dir name="VasiliiB"><dir name="CategoryBottomDescription"><dir name="Model"><file name="Observer.php" hash="49cd6f83142c3b04eeb35464762c0608"/></dir><dir name="etc"><file name="config.xml" hash="2696846eebfcff378e769eeaeea040f7"/></dir><dir name="sql"><dir name="categorybottomdescription_setup"><file name="mysql4-install-0.0.1.php" hash="78a4acb15a4c4b3a56e44947f22f60ba"/></dir></dir></dir></dir></target><target name="mage"><dir name="."><dir name="app"><dir name="etc"><dir name="modules"><file name="VasiliiB_CategoryBottomDescription.xml" hash="5c7dbb4bf45c54c77e0632658dade5e3"/></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="CategoryBottomDesc.xml" hash="af6549c7777e52a472abfd93f5eacc38"/></dir><dir name="template"><dir name="catalog"><dir name="category"><file name="bottom-desc.phtml" hash="6a160a09aa2de9039f69da22382b5b21"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.5.0</min><max>8.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
