Strona główna forum Wsparcie Moduły i dodatki Static Blocks Everywhere na wersję Magento 1.9.x

Static Blocks Everywhere na wersję Magento 1.9.x

Wszystko o modułach i dodatkach dla Magento...


Posty: 23
Gadu-Gadu: 0

Witam,
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ę:
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:

<?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:

<?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).


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?

Static Blocks Everywhere na wersję Magento 1.9.x

PostTeraz jest 29 mar 2024, o 06:42
Google

Posty: 427
Lokalizacja: Internet


Posty: 23
Gadu-Gadu: 0

Czy ktoś jest w stanie pomóc?


Posty: 23
Gadu-Gadu: 0

Czyli pozostaje uzbroić się w cierpliwość i czekać, aż wyjdzie nowa wersja modułu


Powrót do Moduły i dodatki



cron