Pagina 1 di 1

products_new.php on line 102

Inviato: 13/06/2011, 15:04
da occhialinet
Ciao a tutti,
ho un piccolo problema nella pagina dei nuovi prodotti del mio sito ecommerce......mi appare questo errore: Warning: Missing argument 3 for currencies::display_price(), called in /web/htdocs/www.occhialinet.it/home/products_new.php on line 102 and defined in /web/htdocs/www.occhialinet.it/home/includes/classes/currencies.php on line 72


come posso risolverlo?? chi mi aiuterebbe???
Grazie

Re: products_new.php on line 102

Inviato: 13/06/2011, 22:09
da maury2ma
.... dipende da cosa hai toccato per far comparire quell'errore
ripristina e risolverai l'errore.

oppure aggiungi una chiocciola davanti alla funzione incriminata:
display_price()
nel file
www.occhialinet.it/home/products_new.php
alla riga 102

troverai un

Codice: Seleziona tutto

display_price

cambialo con un

Codice: Seleziona tutto

@display_price
ovvio nasconde solo l'errore.... mica lo risolve

Re: products_new.php on line 102

Inviato: 14/06/2011, 8:53
da occhialinet
non si risolve con la @....ho provato......
posso postarti il contenuto di tale file???

Re: products_new.php on line 102

Inviato: 14/06/2011, 8:55
da occhialinet
ECCO IL CONTENUTO DEL FILE:

<?php
/*
$Id: products_new.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}


require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
?>
<!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; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? 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">
<div align="center">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="626" cellspacing="0" cellpadding="0">
<tr>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="left"><table class="h_3" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><img src="images/h_3_top_left.gif" alt="" border="0" height="8" width="8"></td>
<td class="top"><img src="images/spacer.gif" alt="" border="0" height="1" width="1"></td>
<td><img src="images/h_3_top_right.gif" alt="" border="0" height="8" width="8"></td>
</tr>
<tr>
<td class="bxx_l"><img src="images/h_3_left.gif" alt="" border="0" height="21" width="8"></td>
<td class="cnt">
<table class="cont_header_txt" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<?php echo HEADING_TITLE; ?>
</td></tr>
</table></td>
<td class="bxx_r"><img src="images/h_3_right.gif" alt="" border="0" height="21" width="8"></td>
</tr>
<tr>
<td><img src="images/h_3_bot_left.gif" alt="" border="0" height="8" width="8"></td>
<td class="bot"><img src="images/spacer.gif" alt="" border="0" height="1" width="1"></td>
<td><img src="images/h_3_bot_right.gif" alt="" border="0" height="8" width="8"></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
$products_new_array = array();

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
$products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
if ($products_new_split->number_of_rows > 0) {
$products_new_query = tep_db_query($products_new_split->sql_query);
while ($products_new = tep_db_fetch_array($products_new_query)) {
if ($new_price = tep_get_products_special_price($products_new['products_id'])) {
$products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';
} else {
$products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
}
?>
<tr>
<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
</tr>
<tr>
<td colspüan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
} else {
?>
<tr>
<td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
</table></td>
</tr>
<?php
if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>
<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table></td>
</tr>
<?php
}
?>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->

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

Re: products_new.php on line 102

Inviato: 14/06/2011, 10:31
da maury2ma
bah, sembra a posto.
forse il problema sta nell'altro file:
www.occhialinet.it/home/includes/classes/currencies.php on line 72

che modifiche hai fatto per far saltare fuori l'errore ?

Re: products_new.php on line 102

Inviato: 14/06/2011, 10:37
da occhialinet
TI POSTO ANCHE QUESTO:

<?php
/*
$Id: currencies.php,v 1.16 2003/06/05 23:16:46 hpdl Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

////
// Class to handle currencies
// TABLES: currencies
class currencies {
var $currencies;

// class constructor
function currencies() {
$this->currencies = array();
$currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);
while ($currencies = tep_db_fetch_array($currencies_query)) {
$this->currencies[$currencies['code']] = array('title' => $currencies['title'],
'symbol_left' => $currencies['symbol_left'],
'symbol_right' => $currencies['symbol_right'],
'decimal_point' => $currencies['decimal_point'],
'thousands_point' => $currencies['thousands_point'],
'decimal_places' => $currencies['decimal_places'],
'value' => $currencies['value']);
}
}

// class methods
function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {
global $currency;

if (empty($currency_type)) $currency_type = $currency;

if ($calculate_currency_value == true) {
$rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value'];
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
// if the selected currency is in the european euro-conversion and the default currency is euro,
// the currency will displayed in the national currency and euro currency
if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {
$format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
}
} else {
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
}

return $format_string;
}

function is_set($code) {
if (isset($this->currencies[$code]) && tep_not_null($this->currencies[$code])) {
return true;
} else {
return false;
}
}

function get_value($code) {
return $this->currencies[$code]['value'];
}

function get_decimal_places($code) {
return $this->currencies[$code]['decimal_places'];
}

//TotalB2B start
function display_price($products_id, $products_price, $products_tax, $quantity = 1) {
global $customer_id;
$query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
$query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest);
if (($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) {
$query_guest_discount = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'GUEST_DISCOUNT'");
$query_guest_discount_result = tep_db_fetch_array($query_guest_discount);
$customer_discount = $query_guest_discount_result['configuration_value'];
if ($customer_discount >= 0) {
$products_price = $products_price + $products_price * abs($customer_discount) / 100;
} else {
$products_price = $products_price - $products_price * abs($customer_discount) / 100;
}
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} elseif (tep_session_is_registered('customer_id') && !(tep_session_is_registered('customers_visibilita_prezzi'))) {
$query_A = tep_db_query("select m.manudiscount_discount from " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = 0 and m.manudiscount_customers_id = '" . $customer_id . "' and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
$query_B = tep_db_query("select m.manudiscount_discount from " . TABLE_CUSTOMERS . " c, " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = c.customers_groups_id and m.manudiscount_customers_id = 0 and c.customers_id = '" . $customer_id . "' and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
$query_C = tep_db_query("select m.manudiscount_discount from " . TABLE_MANUDISCOUNT . " m, " . TABLE_PRODUCTS . " p where m.manudiscount_groups_id = 0 and m.manudiscount_customers_id = 0 and p.products_id = '" . $products_id . "' and p.manufacturers_id = m.manudiscount_manufacturers_id");
if ($query_result = tep_db_fetch_array($query_A)) {
$customer_discount = $query_result['manudiscount_discount'];
} else if ($query_result = tep_db_fetch_array($query_B)) {
$customer_discount = $query_result['manudiscount_discount'];
} else if ($query_result = tep_db_fetch_array($query_C)) {
$customer_discount = $query_result['manudiscount_discount'];
} else {
$query = tep_db_query("select g.customers_groups_discount from " . TABLE_CUSTOMERS_GROUPS . " g inner join " . TABLE_CUSTOMERS . " c on g.customers_groups_id = c.customers_groups_id and c.customers_id = '" . $customer_id . "'");
$query_result = tep_db_fetch_array($query);
$customers_groups_discount = $query_result['customers_groups_discount'];
$query = tep_db_query("select customers_discount from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$query_result = tep_db_fetch_array($query);
$customer_discount = $query_result['customers_discount'];
$customer_discount = $customer_discount + $customers_groups_discount;
}
if ($customer_discount >= 0) {
$products_price = $products_price + $products_price * abs($customer_discount) / 100;
} else {
$products_price = $products_price - $products_price * abs($customer_discount) / 100;
}
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} else {
return PRICES_LOGGED_IN_TEXT;
}
}

function display_price_nodiscount($products_price, $products_tax, $quantity = 1) {
global $customer_id;
$query_price_to_guest = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'ALLOW_GUEST_TO_SEE_PRICES'");
$query_price_to_guest_result = tep_db_fetch_array($query_price_to_guest);
if ((($query_price_to_guest_result['configuration_value']=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id') && !(tep_session_is_registered('customers_visibilita_prezzi')) ))) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} else {
return PRICES_LOGGED_IN_TEXT;
}
}
//TotalB2B end

}
?>