How to fix reference_in_geo_zone() is deprecated?

LiteCart Fan
Depuis Sweden
Membre depuis avr. 2019

I get this message on my checkoutpage after upgrading from 2.2.3 

Deprecated: reference_in_geo_zone is deprecated. Use instead reference::country(SE)->in_geo_zone() in ~/includes/functions/func_reference.inc.php (Line 4)

any ideas whats wrong?

Best Regards ant Merry Christmas

tim
Founder
Depuis Sweden
Membre depuis mai 2013
tim

LiteCart warns that an old command is being replaced with a new. One of your module add-ons needs to be updated.
See the error log which one this could be.

LiteCart Fan
Depuis Sweden
Membre depuis avr. 2019

[24-Dec-2020 12:38:33 Europe/Stockholm] Deprecated: reference_in_geo_zone is deprecated. Use instead reference::country(SE)->in_geo_zone(1) in ~/includes/functions/func_reference.inc.php (Line 4)
~/includes/library/lib_functions.inc.php (Line 13) in reference_in_geo_zone()
~/includes/modules/shipping/sm_pickup.inc.php (Line 22) in __callstatic()
~/includes/modules/mod_shipping.inc.php (Line 52) in options()
~/pages/ajax/checkout_shipping.inc.php (Line 12) in options()
~/includes/library/lib_route.inc.php (Line 118) in include()
~/index.php (Line 40) in process()
Request: GET /ajax/checkout_shipping HTTP/2.0

It could be the shippingmodule then?

vim
LiteCart Fan
Depuis Belgium
Membre depuis oct. 2020
vim

Same here:
QUOTE
Subject: [Error Report] 
LiteCart 2.2.6

[27-Dec-2020 21:38:37 Europe/Brussels] [2 times] Deprecated: reference_in_geo_zone is deprecated. Use instead reference::country(BE)->in_geo_zone() in ~/includes/functions/func_reference.inc.php (Line 4)
  ← ~/includes/library/lib_functions.inc.php (Line 13) in reference_in_geo_zone()
  ← ~/includes/modules/shipping/sm_pickup.inc.php (Line 22) in __callstatic()
  ← ~/includes/modules/mod_shipping.inc.php (Line 52) in options()
  ← ~/includes/modules/mod_shipping.inc.php (Line 111) in options()
  ← ~/pages/product.inc.php (Line 243) in cheapest()
  ← ~/includes/library/lib_route.inc.php (Line 118) in include()
  ← ~/index.php (Line 40) in process()
Request: GET /t-shirts-convent-22-c-3/t-shirt-convent-22-p-52 HTTP/2.0

Is there a solution?

vim
LiteCart Fan
Depuis Belgium
Membre depuis oct. 2020
vim

Hey!
That looks to have done the job! Thanks for your VERY prompt assistance.
I am also using the pre-installed sm_zone_weight module which also uses geo-zones. I'm not sure if that would need an update.
A happy new year to you and your family already!

tim
Founder
Depuis Sweden
Membre depuis mai 2013
tim

👍 The preinstalled module already have the latest syntax.

LiteCart Fan
Depuis Sweden
Membre depuis avr. 2019

@tim
I upgraded the rekommended module but the error is still there?
This error turn up under "Deliviery options" on the orderpage.

Deprecated: reference_in_geo_zone is deprecated. Use instead reference::country(SE)->in_geo_zone(se) in ~/includes/functions/func_reference.inc.php (Line 4)

Best regards
Peter

Deprecated: reference_in_geo_zone is deprecated. Use instead reference::country(SE)->in_geo_zone(se) in ~/includes/functions/func_reference.inc.php (Line 4)

tim
Founder
Depuis Sweden
Membre depuis mai 2013
tim

Post the full error tracing. It's in logs/errors.log.

LiteCart Fan
Depuis Sweden
Membre depuis avr. 2019

LiteCart 2.2.6

[quote][29-Dec-2020 21:36:08 Europe/Stockholm] [10 times] Deprecated: reference_in_geo_zone is deprecated. Use instead reference::country(SE)->in_geo_zone(se) in ~/includes/functions/func_reference.inc.php (Line 4)  
~/includes/library/lib_functions.inc.php (Line 13) in reference_in_geo_zone()  
[b]← ~/includes/modules/payment/pm_invoice.inc.php (Line 23) in __callstatic()  [/b]
~/includes/modules/mod_payment.inc.php (Line 51) in options()  
~/pages/ajax/checkout_payment.inc.php (Line 12) in options()  ← ~/includes/library/lib_route.inc.php (Line 118) in include()  
~/index.php (Line 40) in process()
Request: GET /ajax/checkout_payment HTTP/2.0
Host: www.patronbutiken.se
Client: 46.59.108.55 (h-108-55.A463.priv.bahnhof.se) User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66
Referer: https://www.patronbutiken.se/checkout[/quote]

LiteCart Fan
Depuis Australia
Membre depuis déc. 2018

I also had this issue after upgrading which was caused by the deprecated lines in my other shipping module.  

I solved it by changing the depreciated lines of code which I found by comparing the code in that shipping module with the updated code in the preinstalled module.

LiteCart Fan
Depuis Sweden
Membre depuis avr. 2019

@label
But then the upgrade will be useless? but i understand what you mean

LiteCart Fan
Depuis United States
Membre depuis déc. 2023

Hi Tim,

In version 2.5.5 I think there's a typo in the trigger_error parameters.
Should in_geo_zones be in_geo_zone instead?

File: includes/references/ref_country.inc.php line 109
trigger_error('Passing geo zone last preceeded by zone is deprecated. Instead do \$country->in_geo_zones($geo_zones, $address)', E_USER_DEPRECATED);

LiteCart is great! I evaluated 5 others before I found it, and it meets my needs QUITE WELL!!

Vous
Ce site n'utilise aucun cookie ni aucune technologie de suivi tierce. Nous pensons pouvoir faire mieux que les autres et nous nous soucions vraiment de votre vie privée.