cmc-sales/views/quote_products/product_options.ctp

58 lines
1.3 KiB
Plaintext
Raw Normal View History

<?
$i = 0;
foreach ($options as $opt) {
2009-12-16 12:50:48 -08:00
$default_option = '';
foreach($opt['ProductOption'] as $prodopt) {
/* Make it the default selected if it's the default option
* Logic that enforces only 1 default option to be added to the product_options controller
*/
if($prodopt['model_number'] != null) {
$drop_options[$prodopt['id']] = $prodopt['model_number'].": ".$prodopt['title'];
}
else {
$drop_options[$prodopt['id']] = $prodopt['title'];
}
if($prodopt['default'] == 1) {
$default_option = $prodopt['id'];
$drop_options[$prodopt['id']] .= " (Default)";
}
}
/**
* If it's an exclusive category, display a drop down box. Otherwise, check boxes
*/
if($opt['ProductOptionsCategory']['exclusive'] == 1) {
echo $form->input('ProductOption.'.$opt['ProductOptionsCategory']['name'],
array('label' => $opt['ProductOptionsCategory']['name'],
'options' => $drop_options, 'default' => $default_option));
}
else {
echo $form->input($opt['ProductOptionsCategory']['name'],
array('options' => $drop_options, 'default' => $default_option,
'multiple' => 'checkbox'));
}
unset($drop_options);
}
//print_r($categories);
2009-12-16 12:50:48 -08:00
print_r($options);
?>