Page 1 of 1
PHP Deprecated:
Posted: Mon Feb 12, 2024 11:11 am
by Xpajun
Not sure if this has been addressed or not, but is there any old to new coding to replace the tep_ functions?
Getting fed up with deleting the errors - almost 1 per second

Re: PHP Deprecated:
Posted: Mon Feb 12, 2024 11:15 am
by heatherbell
Re: PHP Deprecated:
Posted: Mon Feb 12, 2024 11:26 am
by burt
Replacing tep_* functions should be more or less straightforward.
Old addons (or old custom code) usually need to be updated.
EG:
if an old addon uses this to get a products name;
Code: Select all
$products_name = tep_get_products_name($p, $l);
It will create this error in the error_log;
The tep_get_products_name function has been deprecated.
You then need to find "tep_get_products_name" to see what the replacement is;
Code: Select all
function tep_get_products_name($product_id, $language_id = null) {
trigger_error('The tep_get_products_name function has been deprecated.', E_USER_DEPRECATED);
return Product::fetch_name($product_id, $language_id);
}
Now you know that you need to update your old code
from this:
Code: Select all
$products_name = tep_get_products_name($p, $l);
to this:
Code: Select all
$products_name = Product::fetch_name($p, $l);
Re: PHP Deprecated:
Posted: Mon Feb 12, 2024 12:46 pm
by Xpajun
Xpajun wrote: ↑Mon Feb 12, 2024 11:11 am
Not sure if this has been addressed or not, but is there any old to new coding to replace the tep_ functions?
Getting fed up with deleting the errors - almost 1 per second
UPDATE: I've just found a working link to Raiwa's spreadsheet:
Code: Select all
https://docs.google.com/spreadsheets/d/1R-tBvdqGC0NrppEes7z2xQp6xe1zi3LMT46gZ2pUNpg/edit#gid=0
- which does have the new coding for most if not all the tep_changes
Re: PHP Deprecated:
Posted: Mon Feb 12, 2024 12:57 pm
by Xpajun
Thanks everyone for your help