task #11240: Show parent products when product is a sub product
This commit is contained in:
parent
8442baa6f0
commit
ab4bd6829f
@ -24,7 +24,7 @@
|
|||||||
* \file htdocs/product/composition/fiche.php
|
* \file htdocs/product/composition/fiche.php
|
||||||
* \ingroup product
|
* \ingroup product
|
||||||
* \brief Page de la fiche produit
|
* \brief Page de la fiche produit
|
||||||
* \version $Id: fiche.php,v 1.12 2011/08/18 16:16:05 simnandez Exp $
|
* \version $Id: fiche.php,v 1.13 2011/08/18 16:32:08 simnandez Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
@ -248,7 +248,6 @@ if ($id || $ref)
|
|||||||
$productstatic->id=$idprod;// $value["id"];
|
$productstatic->id=$idprod;// $value["id"];
|
||||||
$productstatic->type=$value["fk_product_type"];
|
$productstatic->type=$value["fk_product_type"];
|
||||||
$productstatic->ref=$value['label'];
|
$productstatic->ref=$value['label'];
|
||||||
if ($conf->stock->enabled) $productstatic->load_stock();
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$productstatic->getNomUrl(1).'</td>';;
|
print '<td>'.$productstatic->getNomUrl(1).'</td>';;
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -288,6 +287,7 @@ if ($id || $ref)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Number of subproducts
|
// Number of subproducts
|
||||||
|
$prodsfather = $product->getFather(); //Parent Products
|
||||||
$product->get_sousproduits_arbo ();
|
$product->get_sousproduits_arbo ();
|
||||||
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.sizeof($product->get_arbo_each_prod()).'</td>';
|
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.sizeof($product->get_arbo_each_prod()).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -319,6 +319,28 @@ if ($id || $ref)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Number of parent products
|
||||||
|
print '<tr><td>'.$langs->trans("ParentProductsNumber").'</td><td>'.sizeof($prodsfather).'</td>';
|
||||||
|
|
||||||
|
if(sizeof($prodsfather) > 0)
|
||||||
|
{
|
||||||
|
print '<tr><td colspan="2">';
|
||||||
|
print '<b>'.$langs->trans("ProductParentList").'</b><br>';
|
||||||
|
print '<table class="nobordernopadding">';
|
||||||
|
foreach($prodsfather as $value)
|
||||||
|
{
|
||||||
|
$idprod= $value["id"];
|
||||||
|
$productstatic->id=$idprod;// $value["id"];
|
||||||
|
$productstatic->type=$value["fk_product_type"];
|
||||||
|
$productstatic->ref=$value['label'];
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$productstatic->getNomUrl(1).'</td>';;
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -475,5 +497,5 @@ print "\n</div>\n";
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date: 2011/08/18 16:16:05 $ - $Revision: 1.12 $');
|
llxFooter('$Date: 2011/08/18 16:32:08 $ - $Revision: 1.13 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user