Page 1 of 1

Error in upgrade from 1.0.8.2 to 1.0.8.3 in custom code

Posted: Sat Oct 16, 2021 1:13 am
by Portman
Hi, I'm upgrading between 1.0.8.2 and 1.0.8.2

I have some custom code which a non phoenix recommended programmer did for me that is causing an error. I have given the programmer the flick as he made a right mess of my site and I am trying to get it into a more coherent state...

the error I am getting is;

Code: Select all

PHP Fatal error:  Uncaught Error: Call to undefined method currencies::get_left() in .../includes/modules/content/shopping_cart/templates/tpl_cm_sc_order_subtotal.php:5
The line of code is;

Code: Select all

    <?php     echo $GLOBALS['currencies']->get_left() .number_format($cart_total, 2); ?>
I have tried to find another call to currencies::get_left to see if I can find out how to upgrade this but can't seem to find an example anywhere so I am at a loss... Can someone help me with how I upgrade this code so it is compliant with 1.0.8.2?

Re: Error in upgrade from 1.0.8.2 to 1.0.8.3 in custom code

Posted: Sat Oct 16, 2021 4:00 am
by ecartz
The get_left function was never core. My guess would be

Code: Select all

$GLOBALS['currencies']->currencies[$_SESSION['currency']]['symbol_left']
but it would probably be easier to just go read what it says in the file that was previously used. Or just replace the whole thing with

Code: Select all

<?= $GLOBALS['currencies']->format($cart_total) ?>

Re: Error in upgrade from 1.0.8.2 to 1.0.8.3 in custom code

Posted: Mon Oct 18, 2021 1:09 am
by Portman
THanks again @ecartz