osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> modifier le design d'affichage des produits
taeky
posté 23 Sep 2006, 13:35
Message #1


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 70
Inscrit : 20-November 04
Membre no 3862



Bonjour,

J'ai installé les contrib qu'il y a dans ma signature. Tout fonctionne, mais il me reste 2 petits détails à régler:


1°) Je ne trouve pas pourquoi le nom des produit s'affiche 2 fois

Image IPB

product_listing.php
CODE

<?php
/*
  $Id: product_listing.php,v 1.44 2003/06/09 22:49:43 hpdl Exp $
*/
/*  // Product Description 1.2b début */
DEFINE('PRODUCT_LIST_COL_NUM',2);

function tep_flatten_product_description($description, $link)
{
  $description = ereg_replace('<[^>]*>', '', $description);
  if (strlen($description) > PRODUCT_LIST_DESCRIPTION_MAX_LENGTH){
    $sub_description = wordwrap($description, PRODUCT_LIST_DESCRIPTION_MAX_LENGTH,'$@$');
        $sub_des = explode('$@$',$sub_description);
        $description = $sub_des[0];
        $description .= "...".$link;
      }
   return $description;
}
/*  // Product Description 1.2b fin */
  $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');


  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {


?>
<table border="0" width="100%" cellspacing="10" cellpadding="10">
  <tr>
    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
  </tr>
</table>
<?php
  }

  $list_box_contents = array();

  if ($listing_split->number_of_rows > 0) {
    $listing_query = tep_db_query($listing_split->sql_query);

    $row = 0;
    $column = 0;
    while ($listing = tep_db_fetch_array($listing_query)) {

      $product_contents = array();

      for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
        $lc_align = '';

        switch ($column_list[$col]) {
//          case 'PRODUCT_LIST_MODEL':
//            $lc_align = '';
//            $lc_text = ' ' . $listing['products_model'] . ' ';
//            break;
          case 'PRODUCT_LIST_NAME':
            $lc_align = '';
            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
            } else {
              $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';
            }
            break;
          case 'PRODUCT_LIST_MANUFACTURER':
            $lc_align = '';
//rmh M-S_multi-stores begin
            $manufacturers_to_stores_query = tep_db_query("select count(*) as count from " . TABLE_MANUFACTURERS_TO_STORES . " where manufacturers_id = '" . (int)$listing['manufacturers_id'] . "' and stores_id = '" . STORES_ID . "'");
            $manufacturers_to_stores = tep_db_fetch_array($manufacturers_to_stores_query);
            if ($manufacturers_to_stores['count'] > 0) {
            $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';
            } else {
              $lc_text = ' ' . $listing['manufacturers_name'] . ' ';
            }
//rmh M-S_multi-stores end
            break;
          case 'PRODUCT_LIST_PRICE':
            $lc_align = 'right';
//rmh M-S_pricing begin

            if (tep_not_null($listing['specials_new_products_price'])) {
              $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
            } else {
              $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
            }

            $pf->parse($listing);
            $lc_text = $pf->getPriceStringShort();
//rmh M-S_pricing end
            break;
//          case 'PRODUCT_LIST_QUANTITY':
//            $lc_align = 'right';
//            $lc_text = ' ' . $listing['products_quantity'] . ' ';
//            break;
//          case 'PRODUCT_LIST_WEIGHT':
//            $lc_align = 'right';
//            $lc_text = ' ' . $listing['products_weight'] . ' ';
//            break;
          case 'PRODUCT_LIST_IMAGE':
            $lc_align = 'center';
            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
            } else {
              $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
            }
            /*  // Product Description 1.2b debut */
            if (PRODUCT_LIST_DESCRIPTION && $listing['products_description'] && PRODUCT_LIST_DESCRIPTION_MAX_LENGTH)
            $lc_text .= '<br><table border="0" cellpadding="0" cellspacing="0" width="90%"><tr><td class="productDesc">' . tep_flatten_product_description($listing['products_description'],  '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . TEXT_MORE . '</a>') . '</td></tr></table>';
            /*  // Product Description 1.2b fin */
            break;
//          case 'PRODUCT_LIST_BUY_NOW':
//            $lc_align = 'center';
//            $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image_button('small_edit.gif', IMAGE_SMALL_EDIT) . '</a> ';
//            break;
        }
        $product_contents[] = $lc_text;

      }
      $lc_text = implode('<br>', $product_contents);
      $list_box_contents[$row][$column] = array('align' => 'center',
                                                'params' => 'class="productListing-data"',
                                                'text'  => $lc_text);
      $column ++;
     // if ($column >= 3) { affichage sur 3 colonnes
      if ($column > PRODUCT_LIST_COL_NUM-1) { // affichage sur 2 colonnes
        $row ++;
        $column = 0;
      }
    }

    new productListingBox($list_box_contents);
  } else {
    $list_box_contents = array();

    $list_box_contents[0] = array('params' => 'class="productListing-odd"');
    $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                   'text' => TEXT_NO_PRODUCTS);

    new productListingBox($list_box_contents);
  }

  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
  </tr>
</table>
<?php
  }
?>

J'ai mis en commentaire ce dont je n'ai pas besoins.


2°) Je souhaiterai faire cette présentation des produits. Est-ce que quelqu'un pourrait m'aiguiller, je n'arrive pas à trouver comment m'y prendre.


Image IPB



Merci d'avance


--------------------
Besoin d'un dépannage informatique ou d'une assistance à distance, contactez I-BOX
Go to the top of the page
 
fissiaux
posté 23 Sep 2006, 15:24
Message #2


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669



Le code semble bon.

Peux tu exécuter la requete suivant via phpmyadmin et nous donner le résultat :

SELECT count(*) FROM configuration WHERE configuration_key = 'PRODUCT_LIST_NAME';

Pour ton autre question, celle relève plus d'html que d'autres choses. Il faut donc que tu reprogrammes ton product_listing avec des table, tr et td pour l'entité produit.
Go to the top of the page
 
taeky
posté 23 Sep 2006, 17:30
Message #3


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 70
Inscrit : 20-November 04
Membre no 3862



merci pour ta réponse rapide

la requète répond:

count(*)
1





--------------------
Besoin d'un dépannage informatique ou d'une assistance à distance, contactez I-BOX
Go to the top of the page
 
fissiaux
posté 23 Sep 2006, 19:52
Message #4


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669



Fausse piste alors.

En reprenant le même code, moi, ce n'est pas le nom que j'ai en double mais le prix.

La piste est donc la cinématique de ta boucle et pas le nom du produit.
Go to the top of the page
 
taeky
posté 23 Sep 2006, 21:10
Message #5


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 70
Inscrit : 20-November 04
Membre no 3862



j'ai remarqué que si je change l'ordre de tri dans : admin>configuration>liste des produits

en ce moment j'ai:

Affichage de l'image 1
Affichage nom du produit 2
Display product description 3
Affichage prix 4

donc le prix est doublé


si je paramètre comme ci-dessous:

Affichage de l'image 1
Display product description 2
Affichage prix 3
Affichage nom du produit 4

J'ai l'image et la description qui sont doublés

Je ne comprend plus rien cry.gif



--------------------
Besoin d'un dépannage informatique ou d'une assistance à distance, contactez I-BOX
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 20th May 2013 - 14:27
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)