magento - Display Drop down options for Values saved in Backend -


we created custom module , saved list of product brands & models in backend. in below image, apple, sony, samsung brands & iphone4, iphone4s...etc models.

enter image description here

brands

enter image description here

models

enter image description here

we want create dropdown options both brands & models in frontend, once select particular brand 1st drop-down box , associated models should display in 2nd drop-down box. here

enter image description here

company/brand/block/frontend/view.php

class company_brand_block_frontend_view extends mage_catalog_block_product_abstract {      protected function _preparelayout()     {         $this->getlayout()->createblock('catalog/breadcrumbs');         $headblock = $this->getlayout()->getblock('head');         if ($headblock) {             $product = $this->getproduct();                 $title = $product->getmetatitle();             if ($title) {                 $headblock->settitle($title);             }             $keyword = $product->getmetakeyword();             $currentcategory = mage::registry('current_category');             if ($keyword) {                 $headblock->setkeywords($keyword);             } elseif ($currentcategory) {                 $headblock->setkeywords($product->getname());             }             $description = $product->getmetadescription();             if ($description) {                 $headblock->setdescription( ($description) );             } else {                 $headblock->setdescription(mage::helper('core/string')->substr($product->getdescription(), 0, 255));             }             if ($this->helper('catalog/product')->canusecanonicaltag()) {                 $params = array('_ignore_category' => true);                 $headblock->addlinkrel('canonical', $product->geturlmodel()->geturl($product, $params));             }         }          return parent::_preparelayout();     }     public function getproduct()     {         $collection = mage::getmodel('catalog/category')->load(310)             ->getproductcollection()             ->addattributetoselect('*')             ->addattributetofilter('custom_phone_case', 1);              $products=$collection->getfirstitem();              $product =  mage::getmodel('catalog/product')->load($products->getid());             $p=mage::registry('product');         if ($p=='') {mage::register('product', $product);}             return  $product;         } 

i give 50 bounty if works me.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -