Guest Posted October 5, 2005 Share Posted October 5, 2005 When my customer has been sent back from the credit card payment gateway they recieve an error: Warning: Missing argument 2 for display_price() in /blah/blah/includes/classes/currencies.php on line 71 Warning: Cannot modify header information - headers already sent by (output started at /blah/blah/includes/classes/currencies.php:71) in /bah/blah/includes/functions/general.php on line 29 The function starting on line 71 in currencies is: 71: function display_price($products_price, $products_tax, $quantity = 1) { 72: global $customer_id; 73: if (tep_session_is_registered('customer_id')) 74: { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); 75: } else { 76: $return_this= $this->format(tep_add_tax($products_price, $products_tax) * $quantity) . ' (inc <a href="' . tep_href_link(FILENAME_VAT, '', 'NONSSL') . '">VAT</a>)<br /> ' . $this->format($products_price * $quantity) . '(ex <a href="' . tep_href_link(FILENAME_VAT, '', 'NONSSL') . '">VAT</a>)<br />'; 77: return $return_this; 78: } The function that includes line 29 in my general.php is: 22: function tep_redirect($url) { 23: if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page 24: if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url 25: $url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL 26: } 27: } 28: 29: header('Location: ' . $url); 30: 31: tep_exit(); 32: } Any help with this would be very helpful as my customers are thinging there purchase didn't go through after entering their credit details and they get paniky. Link to comment Share on other sites More sharing options...
Guest Posted October 6, 2005 Share Posted October 6, 2005 Any help on this would be appreciated.. Thanks Link to comment Share on other sites More sharing options...
Guest Posted October 6, 2005 Share Posted October 6, 2005 This is an urgent problem that I need to fix... Anyone?????? Please... Link to comment Share on other sites More sharing options...
Guest Posted October 6, 2005 Share Posted October 6, 2005 Come on guys and girls, there must be someone here who can give me a pointer or two, Its costing me money keep refunding my customers because they thing the order hasn't gone through because they revieve the error after their card has been processed on coming back to checkout success. so they put it through again and I have to refund them which costs.. Any help would be nice.. Link to comment Share on other sites More sharing options...
Guest Posted October 7, 2005 Share Posted October 7, 2005 ? Anyone ? Link to comment Share on other sites More sharing options...
Guest Posted October 10, 2005 Share Posted October 10, 2005 This is getting beyond a joke now.. I'm sure there are still some coders on here that could give me an idea of whats causing this problem when a customer gets passed from the credit card gateway back to the site for checkout success.. All I need is a point in the right direction. Come on people,, throw me a bone here. Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted October 10, 2005 Share Posted October 10, 2005 This is getting beyond a joke now.. I'm sure there are still some coders on here that could give me an idea of whats causing this problem when a customer gets passed from the credit card gateway back to the site for checkout success.. All I need is a point in the right direction. Come on people,, throw me a bone here. a bone? remove the extra spaces in your includes/classes/currencies.php bumping is not allowed and I'm surpised you do not get "sanctioned" for it ... having done it more than once :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Guest Posted October 10, 2005 Share Posted October 10, 2005 a bone? remove the extra spaces in your includes/classes/currencies.php Thanks for the reply Monica, what extra spaces would those be? Here is my currencies code:- <?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']; } function display_price($products_price, $products_tax, $quantity = 1) { global $customer_id; if (tep_session_is_registered('customer_id')) { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } else { $return_this= $this->format(tep_add_tax($products_price, $products_tax) * $quantity) . ' (inc <a href="' . tep_href_link(FILENAME_VAT, '', 'NONSSL') . '">VAT</a>)<br /> ' . $this->format($products_price * $quantity) . '(ex <a href="' . tep_href_link(FILENAME_VAT, '', 'NONSSL') . '">VAT</a>)<br />'; return $return_this; } } } ?> Regarding the bumps, they were over a period of a week as after a few days if you havn't reposted and no one replys then people think that you must have solved your problem and you never will get an answer. And it was a desperate situation I was in with having to keep refunding customers. Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted October 10, 2005 Share Posted October 10, 2005 open the file, go to teh very end and delete anything below the closing ?> ... you may not see it but the may be lines after it. If your editor shows lines it's visible ... :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.