Page 1 sur 1

Ajouter les dimensions dans la fiche produit [Résolu]

MessagePublié: 20 Août 2010, 11:10
par cricri92
Bonjour
Désirant avoir les dimensions du produit dans la fiche détaillée en dessous de model par exemple, j'ai réussi à mettre le titre dimensions dans la fiche mais je n'arrive pas à prendre la valeur [lengh] [widh] et [height] dans la table pour l'afficher à côté.
Merci par avance de votre aide

Re: Ajouter les dimensions dans la fiche produit

MessagePublié: 20 Août 2010, 12:40
par Imaxine
J'ai fais deux façons de renseigner ces informations.

La première étant de mettre les dimensions sur plusieurs lignes.

Dans le fichier : catalog/controller/product/product.php,

Chercher cette ligne :
Code: Tout sélectionner
         $this->data['text_model'] = $this->language->get('text_model');

Et ajouter ces lignes dessous :
Code: Tout sélectionner
         $this->data['text_dimensions'] = $this->language->get('text_dimensions');
         $this->data['text_length'] = $this->language->get('text_length');
         $this->data['text_width'] = $this->language->get('text_width');
         $this->data['text_height'] = $this->language->get('text_height');

Chercher cette ligne :
Code: Tout sélectionner
         $this->data['model'] = $product_info['model'];

Et ajouter ces lignes dessous :
Code: Tout sélectionner
         $this->data['length'] = $product_info['length'];
         $this->data['width'] = $product_info['width'];
         $this->data['height'] = $product_info['height'];

Dans le fichier : catalog/language/french/product/product.php,

Chercher cette ligne :
Code: Tout sélectionner
$_['text_model']          = 'Modèle :';

Et ajouter ces lignes dessous :
Code: Tout sélectionner
$_['text_dimensions']     = 'Dimensions (en centimètres)';
$_['text_length']        = 'Longueur :';
$_['text_width']          = 'Largeur :';
$_['text_height']        = 'Hauteur :';

Dans le fichier : catalog/view/theme/default/template/product/product.tpl,

Chercher ces lignes :
Code: Tout sélectionner
              <tr>
                <td><b><?php echo $text_model; ?></b></td>
                <td><?php echo $model; ?></td>
              </tr>

Et ajouter ces lignes dessous :
Code: Tout sélectionner
              <tr>
                <td><b><u><?php echo $text_dimensions; ?></u></b></td>
              </tr>
              <tr>
                <td><b><?php echo $text_length; ?></b></td>
                <td><?php echo $length; ?></td>
              </tr>
              <tr>
                <td><b><?php echo $text_width; ?></b></td>
                <td><?php echo $width; ?></td>
              </tr>
              <tr>
                <td><b><?php echo $text_height; ?></b></td>
                <td><?php echo $height; ?></td>
              </tr>


La seconde étant de mettre les dimensions sur une même ligne.

Dans le fichier : catalog/controller/product/product.php,

Chercher cette ligne :
Code: Tout sélectionner
         $this->data['text_model'] = $this->language->get('text_model');

Et ajouter ces lignes dessous :
Code: Tout sélectionner
         $this->data['text_dimensions'] = $this->language->get('text_dimensions');
         $this->data['text_by'] = $this->language->get('text_by');

Chercher cette ligne :
Code: Tout sélectionner
         $this->data['model'] = $product_info['model'];

Et ajouter ces lignes dessous :
Code: Tout sélectionner
         $this->data['length'] = $product_info['length'];
         $this->data['width'] = $product_info['width'];
         $this->data['height'] = $product_info['height'];

Dans le fichier : catalog/language/french/product/product.php,

Chercher cette ligne :
Code: Tout sélectionner
$_['text_model']          = 'Mod&egrave;le :';

Et ajouter ces lignes dessous :
Code: Tout sélectionner
$_['text_dimensions']     = 'Dimensions (L x l x H) :';
$_['text_by']           = ' x ';

Dans le fichier : catalog/view/theme/default/template/product/product.tpl,

Chercher ces lignes :
Code: Tout sélectionner
              <tr>
                <td><b><?php echo $text_model; ?></b></td>
                <td><?php echo $model; ?></td>
              </tr>

Et ajouter ces lignes dessous :
Code: Tout sélectionner
              <tr>
                <td><b><?php echo $text_dimensions; ?></b></td>
                <td><?php echo $length; ?><?php echo $text_by; ?><?php echo $width; ?><?php echo $text_by; ?>&nbsp;<?php echo $height; ?></td>
              </tr>


It's all.

Re: Ajouter les dimensions dans la fiche produit [Résolu]

MessagePublié: 20 Août 2010, 12:54
par cricri92
Mille fois Merci LeoImaxine de ta réponse
Je l'ai tester et j'ai vu les erreurs que j'avais commises. Maintenant tout marche nikel. Je trouve d'ailleurs bizarre d'avoir cette information en stock et de ne pas l'utiliser dans la fiche produit. Je débute seulement dans le codage PHP grâce d'ailleurs au site du zéro qui est très bien.
Encore merci pour tout. Sacré boulot.

Re: Ajouter les dimensions dans la fiche produit [Résolu]

MessagePublié: 20 Août 2010, 12:57
par Imaxine
cricri92 a écrit:Je trouve d'ailleurs bizarre d'avoir cette information en stock et de ne pas l'utiliser dans la fiche produit.
Beaucoup de boutiques n'ont pas l'utilité de ces informations (alimentation, services, téléchargements, vidéos, etc...), donc de ce fait ....!!
cricri92 a écrit:Je débute seulement dans le codage PHP grâce d'ailleurs au site du zéro qui est très bien.
Très bonne référence, continue.