Aide - Recherche - Membres - Calendrier
Version complète : Résolu Gros pb de taille de celule dans product listing
Forum osCommerce-fr > Adapter OsCommerce MS2 > Design
caviar
Saluté,
ça fait quelques mois que je dev sur ma boutique OSC pour la relooker comme il faut... Seulement voila, j'arrive presque à la fin de cette fastidieuse entreprise et d'un seul coup j'ai un espèce de bug de mer** qui se présente ... selon la loi du "c'est toujours à la fin que ça plante" il fallait que ça arrive maintenant ...
bon pour résumer la taille de la cellule qui affiche les images des produits dans le products_listing varie en fonction des rubriques ... delire non ?
alors que bien sur il n'y a pas de width indiquée ... cool
il faut donc que je puisse préciser une taille width fixe pour le <td> qui affiche les images ...
j'ai essayé de modifier le petit bout de code

CODE
            $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                                'params' => 'class="productListing-data" valign="top"',
                                                'text'  => $lc_text );

        }
en ajoutant une width

CODE
            $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                                'params' => 'class="productListing-data" valign="top" width="150"',
                                                'text'  => $lc_text );

        }


mais ça me rentre ma width =150 dans tout les td de la ligne et donc ça ne marche pas ...
je cherche le moyen de préciser la taille uniquement du <td> où sont les images ... ou au pire le nom du fichier

celui ou celle qui trouve une astuce pour ça gagne toute mon estime et plein de wub.gif wub.gif biggrin.gif biggrin.gif biggrin.gif
Je continue de chercher de mon côté blink.gif blink.gif

merci bcp d'avance
@++
caviar
c'est bon j'ai trouvé
il faut modifier la classe boxes.php

la fonction

CODE
function tableBox($contents, $direct_output = false) {
      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
      $tableBox_string .= '>' . "\n";

      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
        $tableBox_string .= '  <tr';
        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
        $tableBox_string .= '>' . "\n";

        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
              $tableBox_string .= '    <td';
              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
              // ajout ICI pr le width des td
              if (isset($contents[$i][$x]['width']) && tep_not_null($contents[$i][$x]['width'])) $tableBox_string .= ' width="' . tep_output_string($contents[$i][$x]['width']) . '" ';
              // -------------
              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
              } elseif (tep_not_null($this->table_data_parameters)) {
                $tableBox_string .= ' ' . $this->table_data_parameters;
              }
              $tableBox_string .= '>';
              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
              $tableBox_string .= $contents[$i][$x]['text'];
              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
              $tableBox_string .= '</td>' . "\n";
            }
          }
        } else {
          $tableBox_string .= '    <td';
          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
            $tableBox_string .= ' ' . $contents[$i]['params'];
          } elseif (tep_not_null($this->table_data_parameters)) {
            $tableBox_string .= ' ' . $this->table_data_parameters;
          }
          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
        }

        $tableBox_string .= '  </tr>' . "\n";
        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
      }

      $tableBox_string .= '</table>' . "\n";

      if ($direct_output == true) echo $tableBox_string;

      return $tableBox_string;
    }
  }


et ensuite remplir le tableau comme suit

CODE
$list_box_contents[0][] = array('align' => $lc_align,
                                    'width' => $lc_width, // et hop voila la larheur de td !
                                    'params' => 'class="productListing-heading"',
                                    'text' => '&nbsp;' /*. $lc_text . '&nbsp;'*/);


si ça peut sauver qqun !
@++
DaViD2
Que c'est beau ça !
Tout seul... Merci effectivement cela pour server a un passager qui a ce soucis et qui tombe par hasard sur ta page wink.gif
caviar

héhé
merci merci smile.gif smile.gif bon ça fait quand même quelques mois que je la bidouille dans tous les sens cette boutique osc ...j'ai fini par comprendre leur logique un peu loufoque shock.gif shock.gif
@+
guettapan
Dit moi je pense que ton code peu m'aider mais si tu pouvais me dire ou tu met la 2ème partie de code (se que tu appel tableau) et bien sa m'aidrais encor plus
merci.
Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'informations, la mise en page et les images, veuillez cliquer ici.
Invision Power Board © 2001-2024 Invision Power Services, Inc.