Error in upgrade from 1.0.8.2 to 1.0.8.3 in custom code

Open to all! Ask other shopowners for help.
Post Reply
User avatar
Portman
Contributor
Posts: 158
Joined: Mon Mar 08, 2021 1:04 am
Phoenix Version: v1.0.8.20
Has thanked: 29 times
Been thanked: 4 times

Error in upgrade from 1.0.8.2 to 1.0.8.3 in custom code

Post 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?


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

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

Post 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) ?>
User avatar
Portman
Contributor
Posts: 158
Joined: Mon Mar 08, 2021 1:04 am
Phoenix Version: v1.0.8.20
Has thanked: 29 times
Been thanked: 4 times

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

Post by Portman »

THanks again @ecartz


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply