Page 1 of 1
admin>classes>currencies
Posted: Thu Feb 08, 2024 6:46 pm
by Xpajun
Just been adding one of my addons and have found that currencies.php is missing from classes.
Is this not needed/used any more - has it been replaced or is it alright to delete the call?
Re: admin>classes>currencies
Posted: Thu Feb 08, 2024 6:59 pm
by raiwa
Xpajun wrote: ↑Thu Feb 08, 2024 6:46 pm
Just been adding one of my addons and have found that currencies.php is missing from classes.
Is this not needed/used any more - has it been replaced or is it alright to delete the call?
Admin side is using now the common store side classes in includes/system/versioned/
Re: admin>classes>currencies
Posted: Fri Feb 09, 2024 9:26 pm
by Xpajun
I'm a bit curious now - what does this file actually do and is it really needed now? Especially in admin on a non - EU webstore.
I can see it's a file from osCommerce back in 2007
Anyone like to shed any light on it?
Re: admin>classes>currencies
Posted: Sat Feb 10, 2024 2:49 am
by ecartz
Prior to autoloading, admin used a duplicate copy of the currencies.php file to show prices. Since autoloading, that isn't necessary unless admin needs a different behavior than catalog. In general, admin can use the catalog versions directly.
If you just delete the require line from the add-on, things will probably just work.
Re: admin>classes>currencies
Posted: Sat Feb 10, 2024 11:10 am
by Xpajun
ecartz wrote: ↑Sat Feb 10, 2024 2:49 am
If you just delete the require line from the add-on, things will probably just work.
Thank for the explaination Matt - it does work after deleting the require line which was the reason for my curiousity
Would that also apply to front end files using it?
Re: admin>classes>currencies
Posted: Sat Feb 10, 2024 11:45 am
by Xpajun
Sorry - I'm going single minded at this putting it in relationship just to my addon
I've just had a further look at this and YES currencies.php is required - at least the fist half of the file - it was the EU part that threw me though - now have a better understanding of it, the first part names the countries that have the € after the price and the else applies to those countries that have € before the price but only if the EUR is default currencies <my thoughts are censored here>
So with autoloading currencies.php is autoloaded throughout, both front and back end and
Code: Select all
require('includes/classes/currencies.php');
is no longer needed in any othe file anymore and if used in an admin file will cause an error