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

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> Problème avec contrib "All products"
Countryboy
posté 1 Nov 2004, 05:42
Message #1


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 16-September 04
Membre no 3272



Bonjour,

J'ai installé la contribution "All Products Page and all products module" mais quand je clique sur le lien pour voir tous les produits je reçois le message d'erreur siuvant:


Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/OSC/public_html/includes/boxes/categories.php:13) in /home/OSC/public_html/includes/boxes/categories.php on line 13


si quelqu'un sais de quoi cela peut dépendre, votre aide serait très apprécié


Merci

Eric
Go to the top of the page
 
fissiaux
posté 1 Nov 2004, 05:59
Message #2


5eme dan OSC
Icône de groupe

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




Regarde dans le fichier de ta contribution (le fichier dont tu actives le lien).

A l'intéreiur, tu dois avoir une fonction tep_show_category définir, genre

CODE
function tep_show_category()


Or cette foncton existe sous le même nom dans la boxe categorie (catalog/includes.boxes/categories.php).

Donc, tu dois déjà vérifier que ce sont les mêmes fonctions, donc qu'elles exécutent le même code. SI c'ets la cas (code exacteemnt identique), tu supprimes la fonction dans le fichier de ta contribution.

Si tu as un doute ou si tu es sûr que ce n'ests pas la même fonction, dans le fichier de ta contribution, tu remplaces tep_show_category par tep_show_category2 partout dans le fichier (donc la définition de la focntion et tous les appels).
Go to the top of the page
 
Countryboy
posté 1 Nov 2004, 16:42
Message #3


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 16-September 04
Membre no 3272



salut,

J'ai regardé le code du fichier que le lien active et je n'ai pas vu la fonction ep_show_category()

mais pour être sûr voici le code du fichier activé par le lien "tous les Produits"

CODE

<?php
/*
 $Id: allprods.php,v 1.5 2002/09/29 1

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
 
*/

 require('includes/application_top.php');
 include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ALLPRODS);

// Set number of columns in listing
define ('NR_COLUMNS', 1);
//
 $breadcrumb->add(HEADING_TITLE, tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
 <title><?php echo TITLE ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="8">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
<?php
//begin change. We want the same listing for the categories than for the products.
// create column list
   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

   asort($define_list);

   $column_list = array();
   reset($define_list);
   while (list($column, $value) = each($define_list)) {
     if ($value) $column_list[] = $column;
   }

   $select_column_list = '';

   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     switch ($column_list[$i]) {
       case 'PRODUCT_LIST_MODEL':
         $select_column_list .= 'p.products_model, ';
         break;
       case 'PRODUCT_LIST_NAME':
         $select_column_list .= 'pd.products_name, ';
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $select_column_list .= 'm.manufacturers_name, ';
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $select_column_list .= 'p.products_quantity, ';
         break;
       case 'PRODUCT_LIST_IMAGE':
         $select_column_list .= 'p.products_image, ';
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $select_column_list .= 'p.products_weight, ';
         break;
     }
   }

// We show everything

       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id";


   if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
         //because we don't display the model but we want it to be default, we fool the sort var and set it to a higher number and set the order by to products model
         $HTTP_GET_VARS['sort'] = $i+1 . 'a';
         $listing_sql .= " order by pd.products_name";
         break;
       }
     }
   } else {
     $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
     $sort_order = substr($HTTP_GET_VARS['sort'], 1);
     $listing_sql .= ' order by ';
     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':
         $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_NAME':
         $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_IMAGE':
         $listing_sql .= "pd.products_name";
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_PRICE':
         $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
     }
   }
?>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="8">
     <tr>
       <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="8">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>




si quelqu'un trouve quelque chose faites moi signe

Merci

Eric
Go to the top of the page
 
thematrixisme
posté 1 Nov 2004, 17:08
Message #4


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1514
Inscrit : 3-August 04
Lieu : Brussels, Belgium
Membre no 2988



c'est souvent du à un require qui devrait changer en require_once

pt etre pas ici, mais on peut toujours essayer...


--------------------
Construisons l'avenir ensemble
Go to the top of the page
 
Countryboy
posté 1 Nov 2004, 17:28
Message #5


Ceinture jaune OSC
Icône de groupe

Groupe : Membres
Messages : 42
Inscrit : 16-September 04
Membre no 3272



Salut,


Quel require tu crois qu'il faut modifier ?

Eric
Go to the top of the page
 
thematrixisme
posté 1 Nov 2004, 20:59
Message #6


Ceinture marron OSC
Icône de groupe

Groupe : Membres
Messages : 1514
Inscrit : 3-August 04
Lieu : Brussels, Belgium
Membre no 2988



à la ligne 13 du fichier categories.php

CODE
function tep_show_category($counter) {


cette fonction a donc déjà été déclarée. mais on ne la retrouve pas dans ton code. c'est que ta contrib fait appel à une page qui utilise cette fonction et ensuite appel categories.php et donc ca plante...

faut que tu analyse le code. essaie déjà de mettre
CODE
require_once('includes\application_top')


+



--------------------
Construisons l'avenir ensemble
Go to the top of the page
 
armoise
posté 28 Nov 2004, 12:18
Message #7


Ceinture orange OSC
Icône de groupe

Groupe : Membres
Messages : 225
Inscrit : 30-June 04
Membre no 2781



unsure.gif Salut Country bOy,

Peux tu nousdire si ton problème avec Allproducts a été résolu ?

Merci !


--------------------
- creload 6 en production - 2.2RC2aFRW3C en développement -
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 : 24th May 2013 - 05:27
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)