Adding related products problem

Featured Image © by gerard79/sxc.hu

Today I had a problem when I want to add related product to Magento Professional 1.9.0.0., it did not work. After some tracing thrown errors and comparing files with other Magento versions I found missing part. Magento Professional has missing lines of code in Related.php. So, if someone stuck on the same problem, here is the solution!

To correct this issue, do it in Magento way. So create your new module and rewrite that block. Here is the file where you can find these lines of code:
\app\code\core\Mage\Adminhtml\Block\Catalog\Product\Edit\Tab\Related.php

$this->addColumn('position', array(
            'header'            => Mage::helper('catalog')->__('Position'),
            'name'              => 'position',
            'type'              => 'number',
            'validate_class'    => 'validate-number',
            'index'             => 'position',
            'width'             => 60
        ));

to

$this->addColumn('position', array(
            'header'            => Mage::helper('catalog')->__('Position'),
            'name'              => 'position',
            'type'              => 'number',
            'validate_class'    => 'validate-number',
            'index'             => 'position',
            'width'             => 60,
            'editable'          => !$this->isReadonly(),
            'edit_only'         => !$this->_getProduct()->getId()
        ));

Enjoy debugging! 🙂


About Vanja Devcic

Frontend Developer

Vanja is Certified Frontend Developer, designer in soul and in job, who likes to use his skills to change the world through digital experience creating responsive, multi-languages web sites

Read more posts by Vanja / Visit Vanja's profile

3 comments

  1. @Andrew
    This is not wrong. As I wrote “To correct this issue, do it in Magento way. So create your new module and rewrite that block.”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.