// prodotto configurabile non esistente
 $l = 0;
 $cat[$l] = 2;
 $l = $l + 1;
 $cat[$l] = $id_categoria;
 $l = $l + 1;
 $cat[$l] = $id_sottocategoria1;
 $l = $l + 1;
 $id_sottoC = "sottocategoria2";
 while (isset($_REQUEST[$id_sottoC])) {
     $id_sc = $_REQUEST[$id_sottoC];
     $cat[$l] = $id_sc;
     $id_sottoC = "sottocategoria" . $l;
     $l = $l + 1;
 }
 $nome_brand = nomeValoreAttributo(134, $brand);
 // recupero il nome della stagione
 $entityType = Mage::getModel('eav/config')->getEntityType('catalog_product');
 $attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode($entityType, "ca_stagione");
 $_collection = Mage::getResourceModel('eav/entity_attribute_option_collection')->setAttributeFilter($attributeModel->getId())->setStoreFilter(3)->load();
 foreach ($_collection->toOptionArray() as $option) {
     if ($option['value'] == $stagione) {
         $nome_stagione = $option['label'];
         break;
     }
 }
 // recupero l'ultima categoria e la prima categoria
 $ultimo = count($cat) - 1;
 $lastCategory = $cat[$ultimo];
 while ($lastCategory == "") {
     $ultimo = $ultimo - 1;
 }
 $vestibilitaGiacche = explode(",", $vestibilitaGiaccheDB);
 $vestibilitaGiaccheDesc = "";
 for ($i = 0; $i < count($vestibilitaGiacche); $i++) {
     if ($i > 0) {
         $vestibilitaGiaccheDesc .= ", ";
     }
     $vestibilitaGiaccheDesc .= nomeValoreAttributo(288, $vestibilitaGiacche[$i]);
 }
 $vestibilitaCapispalla = explode(",", $vestibilitaCapispallaDB);
 $vestibilitaCapispallaDesc = "";
 for ($i = 0; $i < count($vestibilitaCapispalla); $i++) {
     if ($i > 0) {
         $vestibilitaCapispallaDesc .= ", ";
     }
     $vestibilitaCapispallaDesc .= nomeValoreAttributo(290, $vestibilitaCapispalla[$i]);
 }
 $cats = $product->getCategoryIds();
 for ($i = 1; $i < count($cats); $i++) {
     $cat = Mage::getModel('catalog/category')->load($cats[$i]);
     $k = $cat->getLevel() - 1;
     if ($k == 1) {
         $categoriaDB = $cats[$i];
     } else {
         $k = $k - 1;
         ${'sottoCategoriaDB' . $k} = $cats[$i];
     }
 }
 $cat = Mage::getModel('catalog/category')->load(2);
 $subcats = $cat->getChildren();
 $k = 0;