Re: Intégration de l'option taille, couleur, ... dans Oledrion | Titre du sujet : Re: Intégration de l'option taille, couleur, ... dans Oledrion par grandoc sur 13/09/2009 14:59:05
j'ai simplifié et corrigé le code, sans qu'il n'y trouve rien à redire
// Recherche des couleurs du produit **********************************************
$tblColors = $tbl_tmp = $tbl_tmp2 = array();
$criteria = new Criteria('pc_product_id', $product->getVar('product_id'), '=');
$tbl_tmp = $h_oledrion_productscolor->getObjects($criteria, true);
foreach($tbl_tmp as $id => $item) {
$tbl_tmp2[] = $item->getVar('pc_color_id');
}
if(count($tbl_tmp2) > 0 ) {
//$tbl_productcolor = array();
$tblColors = $h_oledrion_color->getObjects(new Criteria('color_id', '('.implode(',', $tbl_tmp2).')', 'IN'), true);
foreach($tblColors as $item) {
//$xoopsTpl->append('product_color', $item->toArray());
$tbl_join1[] = '<select size="1" id="1" name="color">
<option value="'.$item->getVar('color_name').'">'.$item->getVar('color_name').'</option></select>';
}
}
if(count($tbl_join1) > 0) {
$xoopsTpl->assign('show_color_name', implode(' ', $tbl_join1));
}
|
|