Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem setting up Order Total Module


szenasim

Recommended Posts

Posted

Hiya!

 

I am new to PHP but I have a coding background. Everything was working great when I was setting up the Order total module until the last step. I am getting the error message:

 

 

Fatal error: Call to undefined function: display_price_nodiscount() in /(path)/catalog/index.php on line 298

 

 

The section of index.php that refers to that is:

 

 

<?php

if (MODULE_CAT_QTY_DISCOUNT_STATUS == 'true') {

$discount_rate = split("[:,]" , MODULE_CAT_QTY_DISCOUNT_RATES);

$size = sizeof($discount_rate);

for ($i=0; $i<$size; $i+=4) {

if ($discount_rate[$i] == $current_category_id) {

if ($discount_rate[$i+3] == 'q') {

$cat_disc_message = sprintf(CAT_DISCOUNT_SPECIAL_QTY, $discount_rate[$i+1],$category[categories_name],$discount_rate[$i+2]);

}

else {

$money = $currencies->display_price_nodiscount($discount_rate[$i+2]);

$cat_disc_message = sprintf(CAT_DISCOUNT_SPECIAL_MON, $discount_rate[$i+1],$category[categories_name],$money);

}

?>

 

 

I took a look in currencies.php and the display_price_nodiscount(...) function is not there. There is just this one:

 

 

function display_price($products_price, $products_tax, $quantity = 1) {

return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

}

 

 

Any ideas why I am getting this error?

Posted
Hiya!

 

I am new to PHP but I have a coding background. Everything was working great when I was setting up the Order total module until the last step. I am getting the error message:

Fatal error: Call to undefined function: display_price_nodiscount() in /(path)/catalog/index.php on line 298

The section of index.php that refers to that is:

<?php

if (MODULE_CAT_QTY_DISCOUNT_STATUS == 'true') {

$discount_rate = split("[:,]" , MODULE_CAT_QTY_DISCOUNT_RATES);

$size = sizeof($discount_rate);

for ($i=0; $i<$size; $i+=4) {

if ($discount_rate[$i] == $current_category_id) {

if ($discount_rate[$i+3] == 'q') {

$cat_disc_message = sprintf(CAT_DISCOUNT_SPECIAL_QTY, $discount_rate[$i+1],$category[categories_name],$discount_rate[$i+2]);

}

else {

$money = $currencies->display_price_nodiscount($discount_rate[$i+2]);

$cat_disc_message = sprintf(CAT_DISCOUNT_SPECIAL_MON, $discount_rate[$i+1],$category[categories_name],$money);

}

?>

I took a look in currencies.php and the display_price_nodiscount(...) function is not there. There is just this one:

function display_price($products_price, $products_tax, $quantity = 1) {

return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

}

Any ideas why I am getting this error?

 

ah, choosing the oldest version?

 

then just change display_price_nodiscount into display_price

Treasurer MFC

Posted

Amanda,

 

Thanks for responding! I tried that before the post (I was searching the boards) and it gave me the error message:

 

 

 

Warning: Missing argument 2 for display_price() in /(path)/catalog/includes/classes/currencies.php on line 71

 

 

 

Basically, display_price() has 3 arguments, 2 of which are variables (1 a boolean... I believe):

 

 

 

function display_price($products_price, $products_tax, $quantity = 1) {

return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

}

 

 

 

The call to this function is:

 

 

 

$money = $currencies->display_price($discount_rate[$i+2]);

 

 

 

Should I put in another argument? Is there a better version? This was the first one that I found.

 

Thanks,

 

Mike

Posted
Amanda,

 

Thanks for responding! I tried that before the post (I was searching the boards) and it gave me the error message:

Warning: Missing argument 2 for display_price() in /(path)/catalog/includes/classes/currencies.php on line 71

Basically, display_price() has 3 arguments, 2 of which are variables (1 a boolean... I believe):

function display_price($products_price, $products_tax, $quantity = 1) {

return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

}

The call to this function is:

$money = $currencies->display_price($discount_rate[$i+2]);

Should I put in another argument? Is there a better version? This was the first one that I found.

 

Thanks,

 

Mike

 

not an error but a warning that the tax parameter is empty, so give it a value 0 in the call.

Treasurer MFC

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...