Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help. Fatal error: Call to undefined method: currencies->get_decimal_places


jaybquick

Recommended Posts

Posted

First off thanks to everyone who contributes to OsCommerce and this forum. I don't post much because I generally have done all my upgrades and fixed all my issues for the past 2 years from this website.

 

However I have a problem now that I can't find anywhere. On the checkout_confirmation.php page I get the following error.

 

Fatal error: Call to undefined method: currencies->get_decimal_places() in /home/content/........./shop/catalog/includes/modules/payment/paypal_ipn.php on line 450

 

I am using PayPal IPN v2.3.4.6. I tried newer versions and I also tried Paypal standard. I tried rolling back to months ago and even a year ago with the paypal modules and my currencies.php file. I thought it was an issue with that file, but apparently not.

 

 

I have spent hours and hours on this and can't figure out what is wrong. It worked until last thursday. I haven't changed anything in the store which is odd. I have found in the past that all my problems occur after changing something and I roll back or retrace my steps and then the site is ok. I am the only one who edits this site and I can't figure out what happened this time.

 

If anyone can help me that would be great.

 

 

 

Here is the chunk of code from the paypal_ipn.php file (the standard paypal version has a similar line of code). Line 450 is 3rd line of code in this code (I separated it with spaces on each side). I know it is not the modules now, so if anyone who understands PHP better than me or can give me any direction it would be much appreciated. I know I am overlooking something.

 

 // BOF shipping & handling fix by AlexStudio
       if(MOVE_TAX_TO_TOTAL_AMOUNT == 'True') {

$parameters['amount'] = number_format(($subtotal + $order->info['tax']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));

       } else {
         // default
         $parameters['amount'] = number_format($subtotal * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
         $parameters['tax'] = number_format($order->info['tax'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
       }
       if ($order->content_type != 'virtual') {
         $parameters['shipping'] = number_format($order_total['ot_shipping'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
       }
       $parameters['handling'] = number_format($order_total['ot_loworderfee'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
       // EOF shipping & handling fix by AlexStudio

 

 

Thanks again everyone. I don't post much because I find almost all my answers by searching, but I just can't find the same or similar problem anywhere else.

Posted

Jason,

 

have you checked the currencies in the admin area to ensure they are assigned 2 decimal places ?

 

 

 

Chris

Posted

The /catalog/includes/classes/currencies.php file is supposed to have that function.

 

The /admin/includes/classes/currencies.php file DOES NOT have that function.

 

Maybe in all the file shuffling and roll backs you accidentally uploaded the admin file into the catalog.

 

That would explain the error.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

The /catalog/includes/classes/currencies.php file is supposed to have that function.

 

The /admin/includes/classes/currencies.php file DOES NOT have that function.

 

Maybe in all the file shuffling and roll backs you accidentally uploaded the admin file into the catalog.

 

That would explain the error.

 

Thanks man, You are a stallion. I knew I did something but couldn't remember what I did. Thanks for pointing out the obvious that I missed.

 

It is now Fixed! I somehow put my currencies.php file from my admin side to my catalog side. That is what I get for juggling a database migration and doing mods at the same time.

 

Once again solved a problem caused by me or something I changed, which is 99% of the time the case.

 

Thanks again everyone.

Archived

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

×
×
  • Create New...