czy ktoś zna podobny moduł do tego, aby działał na wersji magento 1.9.x.
Ogólnie to potrzebuję w Description w produktach dodać blok statyczny przy pomocy:
{{block type="cms/block" block_id="id_bloku"}}
Przyglądałem się temu modułowi "Static Blocks Everywhere", aby go jakoś przerobić i mi się nie udało.
Na podobnej zasadzie robiłem moduł wg instrukcji dodając do:
app/code/core/Mage/Catalog/Model/Product.php
funkcję:
Kod: Zaznacz cały
function getDescription(){
$processor = Mage::getModel('core/email_template_filter');
$html = $processor->filter($this->getData('description'));
return $html;
}
Nie przerabiałem core, ale tworzyłem nowy moduł z instrukcji:
Magento is more than e-commerce platform – it’s a great framewrok based on Zend Framework. One of its best features is modularity (far better then in ZF) and possibility of overriding core classes.You can rewrite blocks, models and helpers with the use of configuration file. This way you get new functionality by enabling your custom module leaving original code intact. Suppose you want to change behavior of Mage_Catalog_Model_Product class. You can create your own class (say MageDev_Catalog_Model_Product) extending core class. Module should be located in the local pool – here goes directory structure:
app/code/local/MageDev/Catalog – contains module files
app/code/local/MageDev/Catalog/etc – here go configuration files
app/code/local/MageDev/Catalog/Model – custom class extending Mage_Catalog_Model_Product will be stored in this directory
Rewrites are defined in app/code/local/MageDev/Catalog/etc/config.xml file:
app/code/local/MageDev/Catalog – contains module files
app/code/local/MageDev/Catalog/etc – here go configuration files
app/code/local/MageDev/Catalog/Model – custom class extending Mage_Catalog_Model_Product will be stored in this directory
Rewrites are defined in app/code/local/MageDev/Catalog/etc/config.xml file:
Kod: Zaznacz cały
<?xml version="1.0"?>
<config>
<modules>
<MageDev_Catalog>
<version>0.0.1</version>
</MageDev_Catalog>
</modules>
<global>
<models>
<catalog>
<rewrite>
<product>MageDev_Catalog_Model_Product</product>
</rewrite>
</catalog>
</models>
</global>
</config>
Now you just need to activate the module in app/etc/modules/MageDev_Catalog.xml file:
Kod: Zaznacz cały
<?xml version="1.0"?>
<config>
<modules>
<MageDev_Catalog>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Catalog />
</depends>
</MageDev_Catalog>
</modules>
</config>
From now on all calls to
Mage::getModel('catalog/product');
will return MageDev_Catalog_Model_Product instance (if this class is defined in app/code/local/MageDev/Catalog/Model/Product.php file).
Mage::getModel('catalog/product');
will return MageDev_Catalog_Model_Product instance (if this class is defined in app/code/local/MageDev/Catalog/Model/Product.php file).
Ale niestety wyświetla błąd:
Fatal error: Call to a member function getResource() on boolean in /usr/home/nazwa/domains/domena/public_html/includes/src/Mage_Adminhtml_Block_Catalog_Product_Grid.php on line 179
Czy jest ktoś w stanie pomóc?