Extention Link:

https://drive.google.com/open?id=0Bx1BoQLDAyPNZzJOcWt4UHlCWEE

Some Modification I have made in this extention:

1- Like If you want to change the admin tab Name Go to:

Inchoo_CustomLinkedProducts-master/app/code/community/Inchoo/CustomLinkedProducts/Block/Adminhtml/Catalog/Product/Edit/Tab.php

2- Or if you want that only one product should be selected. Go to:

Inchoo_CustomLinkedProducts-master/app/code/community/Inchoo/CustomLinkedProducts/Model/Observer.php

public function catalogProductPrepareSave($observer)
    {
        $event = $observer->getEvent();

        $product = $event->getProduct();
        $request = $event->getRequest();

        $links = $request->getPost('links');
        if (isset($links['custom']) && !$product->getCustomReadonly()) {
            $count_custom = Mage::helper('adminhtml/js')->decodeGridSerializedInput($links['custom']);
            if(count($count_custom) ==1){
                $product->setCustomLinkData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($links['custom']));
            }
            else{
                Mage::getSingleton('adminhtml/session')->addError('Only one Replacement Product can be add. Please add one replacement product.');
            }
            
        }
        else{
            $product->setCustomLinkData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($links['custom']));
        }
    }

Categories: Magento

0 Comments

Leave a Reply

Avatar placeholder

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