PHP Deprecated:

Ask the community for help and support.
Post Reply
Xpajun
VIP Member
VIP Member
Posts: 103
Joined: Thu Mar 04, 2021 1:18 pm
Has thanked: 2 times
Been thanked: 6 times

PHP Deprecated:

Post 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 :shock:
Current Store is now running 1.0.7.5 - php 7.3.24
Now working on 1.0.8.19 - php 7.3.24
heatherbell
VIP Member
VIP Member
Posts: 1928
Joined: Mon Oct 07, 2019 4:39 am
Has thanked: 26 times
Been thanked: 165 times

Re: PHP Deprecated:

Post by heatherbell »

burt
Lead Developer
Lead Developer
Posts: 2344
Joined: Tue Oct 29, 2019 9:37 am
Has thanked: 44 times
Been thanked: 131 times

Re: PHP Deprecated:

Post 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); 
Xpajun
VIP Member
VIP Member
Posts: 103
Joined: Thu Mar 04, 2021 1:18 pm
Has thanked: 2 times
Been thanked: 6 times

Re: PHP Deprecated:

Post 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 :shock:
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
Current Store is now running 1.0.7.5 - php 7.3.24
Now working on 1.0.8.19 - php 7.3.24
Xpajun
VIP Member
VIP Member
Posts: 103
Joined: Thu Mar 04, 2021 1:18 pm
Has thanked: 2 times
Been thanked: 6 times

Re: PHP Deprecated:

Post by Xpajun »

Thanks everyone for your help
Current Store is now running 1.0.7.5 - php 7.3.24
Now working on 1.0.8.19 - php 7.3.24
Post Reply