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

Bienvenue invité ( Connexion | Inscription )

> [ Résolu] Création module, module pour la page product_info
Le voyageur
posté 20 Nov 2004, 01:56
Message #1


Ceinture orange OSC
Icône de groupe

Groupe : Membres
Messages : 165
Inscrit : 21-January 04
Lieu : Rambouillet, France
Membre no 1848



Bonsoir,
Nul en php , je pédale dans la semoule....
Dans la page product_info, je voudrais appeler les produits ayant le même "model" en remplacement du module ALSO_PURCHASED_PRODUCTS ou XSELL_PRODUCTS.
voila mon code actuel:

QUOTE

<?php
/*
$Id: auteur_products.php, v1  15/11/2004

osCommerce, Open Source E-Commerce Solutions
<http://www.oscommerce.com>

Copyright © 2002 osCommerce

Released under the GNU General Public License
*/

if ($HTTP_GET_VARS['products_id']) {
$auteur_query = tep_db_query("select distinct products_model, products_id, products_name, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . "  where products_model = '" . $HTTP_GET_VARS['products_model'] . "' and products_status = '1' order by products_id asc limit " . MAX_DISPLAY_ALSO_PURCHASED);
$num_products_auteur = tep_db_num_rows($auteur_query);
if ($num_products_auteur >= MIN_DISPLAY_ALSO_PURCHASED) {
?>
<!-- auteur_products //-->
<?php
      $info_box_contents = array();
      $info_box_contents[] = array('align' => 'left', 'text' => TEXT_AUTEUR_PRODUCTS);
      new contentBoxHeading($info_box_contents);

      $row = 0;
      $col = 0;
      $info_box_contents = array();
      while ($auteur = tep_db_fetch_array($auteur_query)) {




        $info_box_contents[$row][$col] = array('align' => 'center',
                                               'params' => 'class="smallText" width="33%" valign="top"',
                                               'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $auteur['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $auteur['products_image'], $auteur['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_model=' . $auteur['products_model']) . '">' . $auteur['products_name'] .'</a><br>' . $auteur_price. '<br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $auteur['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $auteur['products_name'] . TEXT_NOW) .'</a>');
        $col ++;
        if ($col > 2) {
          $col = 0;
          $row ++;
        }
      }
      new contentBox($info_box_contents);
?>
<!-- auteur_products_eof //-->




<?php
    }
  }
?>


Je n'arrive pas à sortir quelques choses , je m'emmêle entre les _id et les _model ou plus grave...

Ci quelqu'un avait le temps de regarder mon code pour me donner des infos
Merci d'avance
Thierry


--------------------
osCommerce MS2-MAX v1.5.5 +++
SPplus
Go to the top of the page
 

Les messages de ce sujet


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 June 2013 - 10:04
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)