oilsbyashy Merchant Fra Australia Medlem siden oilsbyashy 16 okt. 2023 14:48 I was getting a deprecated command error with litecart and PHP 8.2 for the below: $customer['shipping_address']['postcode'] = preg_replace('#([0-9]{3})-?([0-9]{2})#', '$1$2', $customer['shipping_address']['postcode']); This was the fix: if (isset($customer['shipping_address']['postcode'])) { $postcode = $customer['shipping_address']['postcode']; $postcode = preg_replace('#([0-9]{3})-?([0-9]{2})#', '$1$2', $postcode); $customer['shipping_address']['postcode'] = $postcode; }
tim Founder Fra Sweden Medlem siden tim 16 okt. 2023 19:26 What file is this? PHP 8.2 will go bananas if passing null when expecting a string argument.
oilsbyashy Merchant Fra Australia Medlem siden oilsbyashy 17 okt. 2023 11:58 Sorry tim its the sm_home_delivery.inc file from the addon library - https://www.litecart.net/en/addons/152/home-delivery It notes compatibility to 1.3.6 but with this code modification it works with 2.5.4 and PHP 8.2
tim Founder Fra Sweden Medlem siden tim 17 okt. 2023 13:15 Ok, I moved this forum topic from Feature Requests to the Addons section, connecting it to the right addon. For Public Domain addons you are allowed to upload updates of the addons directly on the addon page.