0

I'm trying to follow this article by Marius so that I can use {{block}} calls in a product description, as many of our products have the same detailed product description, with some minor capacity variations:

http://marius-strajeru.blogspot.co.uk/2010/01/problem-add-static-block-to-product.html

I don't have enough experience to know if I'm editing the correct files.

I pulled info from here:

https://code.tutsplus.com/tutorials/understand-overriding-in-magento-models--cms-23354

and here:

https://magentoexplorer.com/how-to-override-rewrite-magento-core-blocks-models-helpers-and-controllers

So far I did this...

Created /app/etc/HEKA.xml (just made the name up)

with content:

<?xml version="1.0"?>
<config>
  <modules>
    <HEKA_Catalog>
     <active>true</active>
    <codePool>local</codePool>
   </HEKA_Catalog>
  </modules>
</config>

Then I created /app/code/local/HEKA/Catalog/etc/config.xml, including the folder structure HEKA/Catalog/etc/ (again making up the HEKA bit...)

Contents:

<?xml version="1.0"?>
<config>
<modules>
<HEKA_Catalog>
  <version>1.0</version>
</HEKA_Catalog>
</modules>

<global>
<models>
  <catalog>
    <rewrite>
      <product>HEKA_Catalog_Model_Product</product>
    </rewrite>
  </catalog>
</models>
</global>
</config>

Then I created /app/code/local/HEKA/Catalog/Model/Product.php with the content:

<?php
class HEKA_Catalog_Model_Product extends Mage_Catalog_Model_Product
{
function getDescription(){
$processor = Mage::getModel('core/email_template_filter');
$html = $processor->filter($this->getData('description'));
return $html;
}
}

I then added a static block with ID standard_series_general_description

Then added this to a product description

{{block type="cms/block" block_id="standard_series_general_description"}}

Unfortunately I must have got something wrong as the text "{{block type="cms/block" block_id="standard_series_general_description"}}" just appears in the product description.

Any help with this would be greatly appreciated. I'm fairly certain there are some basic errors in what I've done but I'm struggling to figure out what, despite much time on google! thanks, Giles

0

OK, so I have no idea why but this suddenly started working, and the block is appearing on my page! Hopefully this rather long-winded description above will be helpful to someone else...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.