Problème de liste des produits dans "AVIS"

Soutien général pour les problèmes techniques avec OpenCart

Problème de liste des produits dans "AVIS"

Messagepar jeromec » 28 Jan 2011, 23:03

Bonjour,
Dans l'admin, lors de l'édition d'un avis, la liste des produits n'apparaît plus lorsque je sélectionne une catégorie.
Voir illustration ci-dessous :
Image
Je n'arrive pas à comprendre ce que j'ai fait. Quelqu'un peut-il m'aider ?
Merci d'avance.
Version 1.4.9fr
Template Green-store modifié
Hébergeur 1and1.fr
Avatar de l’utilisateur
jeromec
 
Messages: 52
Inscrit le: 21 Oct 2010, 21:31

Re: Problème de liste des produits dans "AVIS"

Messagepar Imaxine » 28 Jan 2011, 23:10

Peux-tu mettre le code du fichier admin/view/template/catalog/review_form.tpl
Imaxine
 
Messages: 3023
Inscrit le: 27 Juil 2009, 19:28

Re: Problème de liste des produits dans "AVIS"

Messagepar jeromec » 29 Jan 2011, 16:27

Je ne pense pas avoir modifié ce code mais vu que j'ai pas mal "bidouillé" avec les "category", il est possible que j'ai fait une bêtise quelque part.
Je met donc le code ci-dessous. Merci...
Code: Tout sélectionner
<?php echo $header; ?>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('view/image/review.png');"><?php echo $heading_title; ?></h1>
    <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
  </div>
  <div class="content">
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
      <table class="form">
        <tr>
          <td><span class="required">*</span> <?php echo $entry_author; ?></td>
          <td><input type="text" name="author" value="<?php echo $author?>" />
            <?php if ($error_author) { ?>
            <span class="error"><?php echo $error_author; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_product; ?></td>
          <td><select id="category" style="margin-bottom: 5px;" onchange="getProducts();">
              <option value="0"><?php echo $text_select; ?></option>
              <?php foreach ($categories as $category) { ?>
              <option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option>
              <?php } ?>
            </select>
            <br />
                                 
            <select name="product_id" id="product">
              <?php if ($product) { ?>
              <option value="<?php echo $product_id; ?>"><?php echo $product; ?></option>
              <?php } else { ?>
              <option value="0"><?php echo $text_none; ?></option>
              <?php } ?>
            </select>
            <?php if ($error_product) { ?>
            <span class="error"><?php echo $error_product; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_text; ?></td>
          <td><textarea name="text" cols="60" rows="8"><?php echo $text; ?></textarea>
            <?php if ($error_text) { ?>
            <span class="error"><?php echo $error_text; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_rating; ?></td>
          <td><b class="rating"><?php echo $entry_bad; ?></b>&nbsp;
            <?php if ($rating == 1) { ?>
            <input type="radio" name="rating" value="1" checked />
            <?php } else { ?>
            <input type="radio" name="rating" value="1" />
            <?php } ?>
            &nbsp;
            <?php if ($rating == 2) { ?>
            <input type="radio" name="rating" value="2" checked />
            <?php } else { ?>
            <input type="radio" name="rating" value="2" />
            <?php } ?>
            &nbsp;
            <?php if ($rating == 3) { ?>
            <input type="radio" name="rating" value="3" checked />
            <?php } else { ?>
            <input type="radio" name="rating" value="3" />
            <?php } ?>
            &nbsp;
            <?php if ($rating == 4) { ?>
            <input type="radio" name="rating" value="4" checked />
            <?php } else { ?>
            <input type="radio" name="rating" value="4" />
            <?php } ?>
            &nbsp;
            <?php if ($rating == 5) { ?>
            <input type="radio" name="rating" value="5" checked />
            <?php } else { ?>
            <input type="radio" name="rating" value="5" />
            <?php } ?>
            &nbsp; <b class="rating"><?php echo $entry_good; ?></b>
            <?php if ($error_rating) { ?>
            <span class="error"><?php echo $error_rating; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_status; ?></td>
          <td><select name="status">
              <?php if ($status) { ?>
              <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
              <option value="0"><?php echo $text_disabled; ?></option>
              <?php } else { ?>
              <option value="1"><?php echo $text_enabled; ?></option>
              <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
              <?php } ?>
            </select></td>
        </tr>
      </table>
    </form>
  </div>
</div>
<script type="text/javascript"><!--
function getProducts() {
   $('#product option').remove();
   
   $.ajax({
      url: 'index.php?route=catalog/review/category&token=<?php echo $token; ?>&category_id=' + $('#category').attr('value'),
      dataType: 'json',
      success: function(data) {
         for (i = 0; i < data.length; i++) {
             $('#product').append('<option value="' + data[i]['product_id'] + '">' + data[i]['name'] + '</option>');
         }
      }
   });
}
//--></script>
<?php echo $footer; ?>
Version 1.4.9fr
Template Green-store modifié
Hébergeur 1and1.fr
Avatar de l’utilisateur
jeromec
 
Messages: 52
Inscrit le: 21 Oct 2010, 21:31

Re: Problème de liste des produits dans "AVIS"

Messagepar Imaxine » 29 Jan 2011, 16:35

En effet, ton code est propre, cela vient surement de "tes bidouilles"
Imaxine
 
Messages: 3023
Inscrit le: 27 Juil 2009, 19:28


Retour vers Soutien Général

Qui est en ligne ?

Utilisateur(s) parcourant actuellement ce forum : Aucun utilisateur inscrit et 0 invité(s)

cron
Copyright © 2009-2013 OpenCart France - Tous droits réservés