cancel
Showing results for 
Search instead for 
Did you mean: 

how to getselectbox to return results

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

how to getselectbox to return results

HI,

Trying to build a test website http://test.smartmoveit.co.uk/index.php/

From here you can see where it says Projector Lamp it says select manufacturer it currently shows 2, However if you select one it doesn't do anything at the moment.

 

I would like it to then give me the option of a model. so if select nec the second box would show 2 models I then click one and it takes me to that page.

 

so in functions.php I have this code.

function getSelectBox($attributeCode, $label = '', $defaultSelect = null, $extraParams = null){
$options = array();
$product = Mage::getModel(
'catalog/product');
$attribute = $product->getResource()->getAttribute($attributeCode);
if($attribute->usesSource()){
$options = $attribute->getSource()->getAllOptions(
false);
array_unshift($options, array(
'label' => $label, 'value' => ''));
}

$select = Mage::app()->getLayout()->createBlock(
'core/html_select')
->setName($attributeCode)
->setId($attributeCode)
->setTitle($label)
->setValue($defaultSelect)
->setExtraParams($extraParams)
->setOptions($options);
return $select->getHtml();
}

 

and on my main page I have this

Step 1. Select your Manufacturer -
<?php echo getSelectBox('manufacturer', 'Select Manufacturer'); ?>
Step 2. Select your Model -
<?php echo getSelectBox('name', 'Select Model'); ?>

 

I am trying to create a new website for our current store but need the lampfinder to work. here is our current store so you can see the section trying to recreate.

http://www.lamphouse.co.uk/

 

I appreciate any help I can get

Thanks